Week 21: How to fix a model?

Last week, I posted about my thought process working through evaluating and correcting for fairness in statistical parity. The next time I met with Caitlin, I tried explaining my thought process and how I evaluated fairness. It did not go well. I think the difficulty in this project is trying to come up with a reasonable way to evaluate fairness and correct models without being completely arbitrary.

So after trying to talk out my example (from last week's post) with Caitlin, we ended up being even more confused by the time we met with Elke. We want to use some existing methodology so that it is easier to justify our process, but the fundamental characteristic of research is that no one else has solved this particular problem before. Fortunately, there has been work in the realm of correcting a calibration model, so we decided to go from there.

In this paper entitled Predicting Good Probabilities with Supervised Learning, the authors talk about two methods for calibrating a skewed model. (I also found this easier to read article that summarizes the aforementioned paper and gives some nice Python code.) One method, Platt scaling, is ideal for models that are skewed with a sigmoid curve. Here's an example from sci-kit learn that shows a classic sigmoid curve:
The orange curve shown above is sigmoid shaped. The x-axis of the plot represents the predicted classifier (probabilistic classifier) in bins, and the y-axis represents the fraction of positive outcomes in each bin. You could consider the model represented by the orange line to be underconfident; when observations are not clearly 0 or 1, the model tends to assign them a neutral score of 0.5. This results in large deviations around the middle of the plot. Platt scaling uses logistic regression to push the sigmoid curve closer to the diagonal line (a perfectly diagonal line is a perfect prediction). Logistic regression is a very confident model; observations get mostly 0 or 1, and it is unlikely for the model to assign something in between. Transforming a sigmoid curve (underconfident) with logistic regression (overconfident) results in a more accurate plot.

The other method is isotonic regression. Isotonic regression works best on models that are skewed in one direction and not in both directions like sigmoid. It assumes that the model has learned the correct ordering of observations and fits a stepwise non-decreasing line to the data. In essence, this method just learns a more complicated model on the data, under the constraint that data observations cannot be reordered. Here's the classic picture from the sci-kit literature that shows a stepwise function (but not correcting a model using isotonic regression):

What I didn't talk about: boosting. Boosting is another common method in fixing classifiers. In the next week, I'll be attempting to learn about and code up Isotonic regression on a trivial example while Caitlin does the same for Boosting.

Comments

Popular posts from this blog

Week 31: Datasets for fairness

Week 32-33: Wrapping up

Week 30: Returning to Fairness