Accuracy:
DP gap:
EO gap:
qualified (Y=1)
not qualified (Y=0)
group A
group B
Drag — rotate · Scroll — zoom
Drag the cyan / magenta knobs above each score cloud to move that group's decision threshold. Points behind the knob's row are approved.

🧪 Fairness–Accuracy Trade-off — AI Classifier Bias Lab

A statistically real model of algorithmic bias: two groups with equal underlying qualification but historically biased recorded scores, two independently draggable decision thresholds, and live demographic parity / equalized odds gaps computed from the actual population — not a scripted animation.

🔬 How it works

Latent merit m ~ N(0,1) is identical for both groups; the true label is Y = 1 if m+ε>0. The observed score is S = m − bias·[B] + ε_s. A decision is D = 1 if S > threshold_group. Accuracy, demographic parity gap |P(D=1|A)−P(D=1|B)|, and equalized odds gap (average of the TPR and FPR differences between groups) are recomputed from the live population on every threshold change.

🎮 How to use

Drag the cyan or magenta knob above each score cloud to move that group's threshold, or use the matching slider. Try "Auto-equalize demographic parity" then watch the equalized odds gap — closing one gap generally opens the other, because with biased data one threshold per group can't satisfy both fairness definitions at once.

💡 Did you know?

This is the same impossibility that made the COMPAS recidivism debate famous: demographic parity, equalized odds and calibration cannot all hold simultaneously once base rates differ between groups, unless the classifier is perfect. This lab lets you find that boundary yourself instead of taking it on faith.