Week 13: How to correct for calibration error

In the previous post, I talked about a reliability diagram to quantify error in a calibration model. Caitlin and I spent time this week discussing the next step: correcting for an unfair model. Disclaimer: I created the plots in this post with Microsoft Excel, and they don't reflect any real data.

What does unfairness look like?

For a running example, let's imagine we were evaluating a model that attempts to predict one's salary. This model will be used to calculate future salaries for new hires, so it is important that the model is not biased against any protected attributes, for example, sex. We have a large dataset that includes salary information for roughly the same number of males and females. We run the model with this labeled dataset and get the following reliability diagram for salary:
In this plot, points on the diagonal black line represent a perfect prediction. Points above the line represent overestimation (true salary was lower than we expected), and points below represent underestimation (true salary was higher than we expected) In this plot, salaries of females who make less than $63,000 are overestimated, while those above $63,000 are underestimated. For males, salaries over $56,000 are overestimated.

As it stands, this model is biased because the lines representing salary predictions for males and females are different from each other. Given a male and female candidate who should truly have an $80,000 salary, the male candidate will be given a $95,000 salary while the female candidate will be given a $75,000 salary.

How to Correct

It is important to keep in mind that the model in this example is already optimal for predicting salary. The large error in the above plot may be because there are few attributes on which to train the model, or because error is only evident when you stratify by sex. This (optimality) is important to remember, because correcting for fairness is a post-processing step that damages the prediction accuracy in order to regain fairness. Thus, there is a tradeoff between fairness and utility.

One approach to correction is to project each of the reliability plots onto the perfect prediction line. This could be done by learning a function that represents one of the reliability plots, and then learning a mapping from that function onto a straight line. For example, in the following plot, the female line (pink) can be approximated with the function y = 4E-15x4 - 6E-10x3 + 2E-05x2 + 1.2716x. Knowing this, we can find another function which, if composed, will generate a straight line (I don't know exactly how this function would be found, but I am looking into it). This approach is rather naiive because it doesn't try to maintain utility.

Instead of trying to fit to a straight line, another approach would be to learn a line that is equally distant from both the male and female line. Such an approximation would look something like this:

In this case, one would learn a mapping from the pink line to the yellow line, and from the blue line to the yellow line. Thus, both the male and female predictions would have the same fairness, but the model would be more useful than the one described above.

Interpretation

In this example, I corrected for under and overestimation for the female and male models by mapping their reliability curves onto a compromise line. If I were to apply this model with correction to a new dataset, it would have the following effects: females who were originally predicted to make less than $60000 would be given a higher prediction salary. Females with salaries over $60000 would experience a deflation in their predicted salary. Similarly, males with salaries below $65000 would see a decrease in salary while males above would see an increase. Comparing the yellow Compromise line to the black Perfect Prediction line, all candidates will now be overestimated. This is evidence of how the utility of the model decreases when correcting for fairness. A company looking to minimize hiring costs would not like this correction because it overestimates everyone's starting salary.

However, if overestimation is a desirable thing (i.e. from the perspective of a candidate who doesn't mind getting a higher salary than they probably should), then correcting this model hurts females who are predicted to make less than $60000 and males who are predicted to make between $65000 and $100000.

Conclusion

This is one possible approach to correcting for bias in a regression model. I do not make any statement that this is the only or best way. Next week, I will meet with my mentor to discuss this model and look in the literature for other ways to solve this problem.

Comments

Popular posts from this blog

Week 31: Datasets for fairness

Week 32-33: Wrapping up

Week 30: Returning to Fairness