Same model.Same threshold.More than twice thefalse-alarm ratefor one group.

An invented town of 100,000, split in two: 50,000 people in group A and 50,000 in group B. Invented, so we know who is really ill. One model, a program that scores how likely each person is to be ill, scores everyone. Anyone scoring 0.50 or more (the threshold) is flagged: sent for a second test.

Of A’s healthy people, 7.3% are flagged anyway. Of B’s, 16.5%: 2.2 times the rate.

This has happened.

In 2016 a risk score used in US courts was shown to flag Black defendants who did not reoffend more often than white ones. Its maker answered, truthfully, that the score was fair. Both were right, and this pad shows how. Start with where a person can land: caught, missed, false alarm, rightly cleared. Four rooms for each group.

A rate is a height.

A false-alarm rate is a share of the healthy: 7.3% of A’s healthy people are flagged, 16.5% of B’s. So every block is drawn equally tall, and wider when it holds more people: a rate is how much of the block’s height a room takes.

Same measurements,different scores.

measurement 1measurement 2postcodegroup

The model is told four things about a person. Take two people with the same test readings, readings that point neither way: one in group A, one in B. The illness is commoner in B: 50.1% of B is ill, 29.7% of A (that share is a group’s base rate). So the model scores the one in A 0.30 and the one in B 0.51: not flagged, flagged. That keeps a score honest within each group; the name for that is calibration.

Misses gothe other way.

A’s ill are missed 28.6% of the time, B’s 15.5%. Accuracy is close, 86.4% and 84.0%: similar accuracy, opposite mistakes.

Three ways to be fair.

Meaning one: flag the same share. A model is fair if it flags the same share of each group (the textbook name: demographic parity). This one flags 26.3% of A and 50.5% of B: 24.2 percentage points apart.

Make the same mistakes.

Meaning two: make the same mistakes. A model is fair if both groups get the same false-alarm rate and the same miss rate (the textbook name: equalised odds). Here false alarms are 7.3% in A against 16.5% in B, and misses 28.6% against 15.5%: 9.1 and 13.1 percentage points apart.

Mean the same thing.

Meaning three: mean the same thing. A model is fair if a number means the same in both groups. For a score: 0.7 should come true about 70% of the time in each (the two lines on the chart; that is calibration). For a flag: the same share of the flagged should really be ill (that is precision). Here it is 80.4% in A and 83.7% in B: close, but 3.3 percentage points apart.

Each sounds fair.

1 · same share flagged2 · same mistakes3 · same meaning

Back to the courts. In 2016 ProPublica reported that the risk score, COMPAS, flagged Black defendants who did not go on to reoffend more often than white ones: a higher false-alarm rate, so it failed meaning two. Northpointe, its maker, replied that its scores were equally predictive for both groups: the same precision, so it passed meaning three. Each side checked a different meaning of fair. Our groups are invented and say nothing about any real score.

Three dials.

Now give each group its own threshold. To be fair by meanings two and three together, three gaps must close at once: precision, false alarms, misses. Each gauge shows one gap, group A minus group B; all three at zero is the goal. The dot on the square chart is the pair of thresholds in use.

Match the mistakes.

Keep A at 0.50 and raise B to 0.72. False alarms match and, in this town, so do misses: the measurements work the same way in both groups. But precision is now 80.4% in A and 90.6% in B.

Match the meaning.

Lower B to 0.41 and precision matches: a flag is right equally often in both groups. Now false alarms are 14.2 percentage points apart, and misses 17.0.

Try every pair.

Is there a pair of thresholds that closes all three gaps? Each point of the chart is one pair, 40,000 in all. Along the red-and-blue curve the mistakes match; along the black one precision does; the two never cross. So the page tries every pair, and keeps the best one that still catches half of each group’s ill (the hatched bands catch fewer).

The closest it gets.

The best pair is 0.76 for A and 0.86 for B. It misses 50.0% of A’s ill and 45.8% of B’s, and its largest gap is still 4.2 percentage points.

Unless it flags no one.

Drop the rule and push both thresholds near 1. Every gap closes, to 0.5 percentage points, because the model flags almost no one and catches 7% of the ill. That is the corner where the curves touch: a useless model.

Why they can’t meet.

Ask for two of the three and count. Catch half of each group’s ill: 7,421 in A, 12,518 in B. Be right four flags in five in both: that is one wrong flag for every four right ones, 1,855 in A and 3,129 in B. A wrong flag is a healthy person, and B has fewer of them: 5.3% of A’s healthy are flagged, 12.5% of B’s.

Misses matched, precision matched, and the false alarms are forced apart, only because B has more ill people for every healthy one. Two papers proved it in 2016 (Chouldechova; Kleinberg, Mullainathan and Raghavan).

Make the base rates equal.

The same town again, but now 40% of each group is ill, and the model is trained afresh. The curves fall onto the dashed line. At 0.73 for A and 0.74 for B, almost one threshold, every gauge reads zero to within 0.1 percentage points. Only the base rates changed (in this town that is enough).

Delete the column.

measurement 1measurement 2postcodegroup

Could the model just not be told the group? Train it again without that column. At 0.50, false-alarm rates are 9.4% in A and 14.1% in B: closer, but about half of the gap (52%) is still there. And it is a slightly worse model: it gets 15,084 people wrong, up from 14,811.

Postcode knows.

The ten postcodes are mixed unevenly. From postcode alone a model guesses a person’s group right 84.3% of the time; from the two measurements, 57.1%; a coin, 50%. Deleting a column does not delete what it says: other columns stand in for it. They are called proxies.

Delete postcode too.

measurement 1measurement 2postcodegroup

Now the model sees only the two measurements. False-alarm rates are 11.3% and 11.8%, miss rates 20.9% and 21.1%: nearly the same mistakes, meaning two. It holds here only because the measurements work the same way in both groups. The price: 15,293 people wrong, 482 more than the model that saw every column: group and postcode told it something true about who is ill. Little here; in other data it can be a lot.

And calibration breaks.

The same score now means different things. Of the people scored 0.2 to 0.3, 16.3% are ill in group A and 33.4% in group B. Blind to the group, this model makes the same mistakes in both, and its scores no longer mean the same thing: meaning two kept, meaning three lost. Hiding the group does not escape the choice.

Your rules.

Pick a rule: the page finds the thresholds that keep it with the fewest mistakes (false alarms plus misses), and the gauges show what that costs the other meanings. Equal flag rates is meaning one. Drag on the chart, or change the base rates: make them equal and, in this town, all three gauges can read zero.

How wrong am I?More for some of you than others.

  1. One model and one threshold can make one kind of mistake far more often for one group: here, healthy people in B were flagged 2.2 times as often.
  2. When an illness is commoner in one group, no useful flag can close every gap at once: fix one and another opens.
  3. Hiding the group does not settle it: postcode gives it back, and hiding both trades one gap for another. Choose which gap to close, and say so.

Fair is a choiceyou state.

Every rule on this pad is paid for somewhere: false alarms for one group, misses for the other, or a flag that means less for one of them. Which gauge to zero depends on which mistake costs whom, and that choice has to be made out loud.

The exam says the model is right. Nobody has asked whether using it changed anything. Next: Did It Work?