Interactive Diagnostic Essay · Topic 14

Equality of Odds

A model can be accurate overall and still be wrong in a pattern that tracks who you are. This essay defines what it means for two groups to be treated even-handedly, measures it, and shows the three places you can intervene.

01 / The Same Model, Two Outcomes

Accurate Isn't The Same As Even

Suppose a model screens loan applications and clears 82% of them correctly overall. That single number can hide a great deal. Split the applicants by a protected attribute — say, two demographic groups — and the errors may not be spread evenly at all.

Group A might have most of its genuine defaulters caught, while Group B's slip through more often. Group B might simultaneously have more good applicants wrongly rejected. The overall accuracy is unchanged; the experience of the model is completely different depending on which group you are in.

The question this essay answers

What exactly should be equal between the groups? Two candidate answers look obviously right and turn out to conflict. Picking between them is a decision you have to make on purpose.

The two error rates that matter are the ones Topic 03 taught us to name: the true positive rate (recall) and the false positive rate.

Group A
TRUE POS RATE80.0%
FALSE POS RATE15.8%
ACCURACY83.3%
Group B
TRUE POS RATE55.0%
FALSE POS RATE32.5%
ACCURACY65.0%

Same accuracy class · very different error profile

02 / The Definition

What “Equalized Odds” Actually Requires

A predictor Y^\hat{Y} satisfies equalized odds with respect to a sensitive attribute AA and true outcome YY when the prediction and the attribute are independent conditional on the true label:

Y^⊥A  ∣  Y⟺P(Y^=1∣A=0,Y=y)=P(Y^=1∣A=1,Y=y)\hat{Y} \perp A \;\mid\; Y \quad \Longleftrightarrow \quad P(\hat{Y}{=}1 \mid A{=}0, Y{=}y) = P(\hat{Y}{=}1 \mid A{=}1, Y{=}y)

for both y=0y = 0 and y=1y = 1.

Reading it in the two cases spells out the practical requirement. When y=1y = 1 the condition says the two groups must have the same true positive rate. When y=0y = 0 it says they must have the same false positive rate. Both, not either.

Because FPR\text{FPR} and TPR\text{TPR} are the two axes of the ROC curve, this has a tidy geometric reading: each group's operating point must sit at the same coordinates in ROC space.

The weaker cousin: Equal OpportunityP(Y^=1∣A=0,Y=1)=P(Y^=1∣A=1,Y=1)P(\hat{Y}{=}1 \mid A{=}0, Y{=}1) = P(\hat{Y}{=}1 \mid A{=}1, Y{=}1)

Equal opportunity drops the y=0y = 0 half: only the true positive rates must match. It permits unequal false positive rates, which is sometimes exactly what you want — and sometimes exactly the harm you were trying to prevent.

What it deliberately does not require
  • • Demographic parity — equal flag rates regardless of the true outcome. It ignores the labels entirely, so a model can satisfy it and still be useless.
  • • Equal accuracy per group — a group can match on both rates and still differ in calibration.
03 / Measuring The Gap

Take The Parity Dial

Group A is the reference. Drag the dial to move Group B from its original operating point toward Group A's — watching the true positive rate and the false positive rate close their gaps together. Parity is the point where both gaps reach zero at once.

GROUP B → PARITY0%
TPR GAP:25.0 pp
FPR GAP:16.7 pp
not yet equalized
Note the dial's shape. You cannot close one gap without closing the other here, because both rates move together. In general that is a constraint you have to solve for, not a dial you can simply turn.
ERROR RATES BY GROUP
25%50%75%100%TRUE POS RATEFALSE POS RATE
Group A Group B
04 / The Gap On Loop

What You Are Looking For

On a real audit you would plot exactly this: paired bars per rate, one pair per group. The pulse marks the distance you are trying to eliminate.

Both pairs must close. A model that matches on the true positive rate but not the false positive rate satisfies equal opportunity while still imposing a systematic cost on one group — more of its innocent members get flagged.

Lending makes the asymmetry concrete. A missed defaulter is a loss to the lender. A wrongly rejected applicant is a loss to the applicant. Those two costs are borne by different people, which is precisely why “just maximise accuracy” is not a neutral choice.

05 / Three Places To Intervene

Pre-, In-, and Post-Processing

Every fairness intervention sits at one of three stages. Where you sit determines what you have to change, and what you must trust.

Pre-processing

Change the data before training: repair the labels, reweight the rows, or project the features so the sensitive attribute is harder to recover from them.

Pro: model-agnostic — works with any learner.
Con: you must touch the training data, and the repair itself can destroy real signal.

In-processing

Change the objective: add the parity constraint to the loss, or train adversarially so a second network cannot recover the attribute from the predictions.

Pro: the constraint and the accuracy tradeoff are optimised together.
Con: you need access to the training loop and the sensitive labels at training time.

Post-processing

Leave the model alone and adjust the decisions: give each group its own threshold, chosen so both error rates match.

Pro: works on a frozen black-box model you cannot retrain, and needs only a validation set.
Con: per-group thresholds are legally and politically fraught in many domains.

The uncomfortable part

Parity is not free. Forcing the rates to match generally costs accuracy, because the unconstrained optimum is, by definition, the most accurate point. There is also a known impossibility result: except in degenerate cases you cannot simultaneously have equalized odds and calibration within groups when the groups have different base rates. Someone has to decide which guarantee matters more for this application — that decision is not a modelling choice, it is a policy one.

06 / In Practice

An Audit You Can Actually Run

Fairness is not a metric you compute once at the end. It is a slicing exercise you run alongside the evaluation you already do: take your held-out set — see Topic 12 — and compute every metric you care about per group, not just overall.

The absolute numbers matter less than the gaps. A model with a 3-point TPR gap and a 2-point FPR gap is in a very different place from one with a 25-point gap, even when their headline accuracies are identical.

And remember that the sensitive attribute you have labels for is rarely the only axis that matters. The same slicing should be run across every dimension on which your model could plausibly be uneven — which means the honest answer to “is this model fair?” is usually “fair with respect to these attributes, on this data, by these measures”.

Checklist
  • • Define the sensitive attributes before modelling.
  • • Report TPR and FPR per group, never only overall.
  • • Decide which parity notion is required, and say why.
  • • Measure the accuracy you paid to get it — parity is never free.
  • • Re-run the audit whenever the data or the model changes; fairness does not survive a retrain untouched.

Adapted from MLU-Explain (Amazon, CC BY-SA 4.0).