Sub topic 8
Why you cannot satisfy every criterion at once
This chapter assumes you can read a confusion matrix, you know precision, recall (TPR) and FPR, and you have met demographic parity, equalized odds and predictive parity in the earlier chapters. You should also be comfortable with basic Python and NumPy.
By now you can compute several fairness gaps for one model. A natural next step is to drive all of them to zero. In general you can't. The obstacle is arithmetic, not a weakness of any training method. If the groups differ in how often the positive outcome occurs, some criteria contradict each other.
Base rates are the cause
The base rate of a group is the share of its members whose true label is 1. Write it as p. For group A it is pA, and for group B it is pB.
Every group metric from the earlier chapters is a function of the confusion matrix. For one group, three identities connect the metrics:
- Selection rate: s = p · TPR + (1 − p) · FPR
- Precision (PPV): PPV = p · TPR / s
- Rearranged: FPR = p / (1 − p) · (1 − PPV) / PPV · TPR
The third identity is the core of the Chouldechova (2017) result. It holds for every group. Suppose two groups have the same PPV and the same TPR. Then their FPRs differ unless pA = pB. Equal PPV, equal TPR and equal FPR can therefore hold together in only two cases:
- The base rates are equal.
- The classifier is perfect, so FPR = 0 and PPV = 1 in every group.
Real models are imperfect, and real groups often have different recorded base rates. So in practice you must choose which criteria to prioritize.
Three pairwise conflicts
Each conflict below assumes pA ≠ pB and an imperfect classifier.
| Pair of criteria | Why they conflict |
|---|---|
| Demographic parity and equalized odds | Equal TPR and FPR make s a weighted average of two shared numbers. The weights are p and 1 − p, so s differs between groups unless TPR = FPR, which means the model is no better than chance. |
| Demographic parity and predictive parity | From PPV = p · TPR / s, equal PPV and equal s force TPR = PPV · s / p. That value differs between groups, so TPR cannot be equal. |
| Equalized odds and predictive parity | The third identity above. Equal TPR and equal PPV force different FPRs. |
Kleinberg, Mullainathan and Raghavan (2016) proved a related result for scores. A score cannot be calibrated within each group and also have equal average scores for positives and equal average scores for negatives across groups. The exceptions are the same two cases. Pleiss et al. (2017) showed that calibration and equal error rates can be forced together only by degrading the predictions. The method withholds information from some groups' predictions.
Seeing it in numbers
The following script builds two groups with different base rates. Both groups get exactly the same TPR and FPR, so equalized odds holds. It then reports what happens to the other criteria.
import numpy as np
def metrics_from_rates(base_rate, tpr, fpr):
"""Selection rate and precision implied by a base rate, TPR and FPR."""
tp = base_rate * tpr
fp = (1 - base_rate) * fpr
selection_rate = tp + fp
precision = tp / selection_rate
return selection_rate, precision
tpr, fpr = 0.80, 0.10 # identical in both groups
base_rates = {"A": 0.30, "B": 0.50}
for g, p in base_rates.items():
s, ppv = metrics_from_rates(p, tpr, fpr)
print(f"group {g}: base rate={p:.2f} TPR={tpr:.2f} FPR={fpr:.2f} "
f"selection rate={s:.3f} PPV={ppv:.3f}")The output is:
group A: base rate=0.30 TPR=0.80 FPR=0.10 selection rate=0.310 PPV=0.774
group B: base rate=0.50 TPR=0.80 FPR=0.10 selection rate=0.450 PPV=0.889Equalized odds holds exactly. Demographic parity is off by 0.14, and predictive parity is off by about 0.115. Neither gap comes from a bug or from a poorly tuned model. Both follow from the base rates.
Now go the other way. Fix PPV and TPR to be equal, and solve for the FPR each group needs:
def required_fpr(base_rate, tpr, ppv):
"""FPR implied by a base rate, TPR and PPV (Chouldechova identity)."""
return base_rate / (1 - base_rate) * (1 - ppv) / ppv * tpr
tpr, ppv = 0.80, 0.80
for g, p in {"A": 0.30, "B": 0.50}.items():
print(f"group {g}: required FPR = {required_fpr(p, tpr, ppv):.3f}")The output is:
group A: required FPR = 0.086
group B: required FPR = 0.200With equal PPV and TPR, group B must tolerate more than twice the false positive rate of group A. That is a form of unequal treatment, and it comes from the fixed relationship between the metrics.
Choosing under the constraint
No formula picks the right criterion. The choice depends on the deployment context from the first chapter. The following questions help.
- Who bears each error? If a false negative denies someone a benefit, such as a loan or a job interview, equal opportunity protects qualified people in every group. If a false positive causes harm, such as a wrongful fraud flag or an arrest, equal FPR matters more.
- How are the outputs used? If humans read scores as probabilities, calibration by group matters. A score of 0.7 should mean the same thing for everyone. If the output is a hard decision, error rates matter more.
- Can you trust the labels? Equalized odds and predictive parity treat the recorded label as ground truth. If the label is a proxy shaped by past decisions, such as "was arrested" standing in for "committed a crime", then base-rate differences may be an artifact. In that case demographic parity, or a repair of the label, may be the better target.
- What do law and policy require? Some settings fix the criterion for you. Examples are the "four-fifths rule" used on selection rates in US employment guidance, and sector-specific rules on credit or insurance. Check with legal and policy owners before you pick a metric.
Common errors
- Reporting one metric and calling the model fair. Report at least demographic parity, equal opportunity or equalized odds, and predictive parity, along with the base rates. The base rates explain why the gaps look the way they do.
- Treating the result as an excuse. The impossibility says you can't satisfy all criteria exactly. It doesn't say you can ignore all of them. Large gaps on the criterion that matches the harm still need action.
- Forgetting that the proof is about exact equality. Approximate satisfaction is often achievable. For example, a small FPR gap and a small PPV gap can coexist when base rates are close. The gaps grow with the base-rate difference and with classifier error.
- Applying the identity to estimates without uncertainty. Base rates, TPR and PPV are all estimated from samples. For small groups, an apparent violation can be noise. The next chapter covers how to judge this.
- Assuming a better model removes the conflict. Improving accuracy shrinks the conflict, because the exceptions are the perfect classifier and equal base rates. It rarely removes it, because real tasks carry irreducible noise.
Check your understanding
Exercise
Group A has base rate 0.20 and group B has base rate 0.40. A classifier has TPR = 0.75 and FPR = 0.05 in both groups. (1) Which of demographic parity and predictive parity hold? (2) Compute the PPV for each group.
Show answer
(1) Equalized odds holds because TPR and FPR match. The base rates differ and the classifier is imperfect, so demographic parity and predictive parity cannot hold. (2) Group A: TP = 0.20 × 0.75 = 0.15, FP = 0.80 × 0.05 = 0.04, PPV = 0.15 / 0.19 ≈ 0.789. Group B: TP = 0.40 × 0.75 = 0.30, FP = 0.60 × 0.05 = 0.03, PPV = 0.30 / 0.33 ≈ 0.909. The selection rates are 0.19 and 0.33, so demographic parity also fails.
Exercise
A hospital uses a model to flag patients for an expensive follow-up program. Doctors read the output as a risk score. The groups have different recorded base rates. Which criterion would you prioritize, and what do you give up?
Show answer
Calibration within groups, with predictive parity at the chosen threshold, is a reasonable priority because doctors read the scores as probabilities. With differing base rates and an imperfect model, you then give up equal TPR and FPR across groups, so one group may miss follow-up more often or be flagged unnecessarily more often. You should report those error-rate gaps, check whether the recorded base rates reflect unequal access to care in the labels, and decide with clinicians whether the gaps are acceptable.