Demographic Parity (Statistical Parity)#
Requires the positive-prediction rate to be equal across groups, independent of the true label.
Important
✨ AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.
What it is#
Demographic parity (or statistical parity) asks that the model’s positive decisions be independent of the protected attribute — every group receives a positive prediction at the same rate:
Crucially it looks only at the prediction \(\hat{Y}\), never at the true label \(Y\).
Where it sits among fairness criteria#
This is the independence criterion, \(\hat{Y} \perp A\). It is the simplest and most label-blind of the three families — independence (here), separation (equalized odds / equal opportunity) and sufficiency (predictive parity).
Measuring it#
Two common gap metrics, with \(a\) the disadvantaged group:
The ratio connects to the legal four-fifths (80%) rule: a selection-rate ratio below 0.8 is treated as evidence of adverse impact.
Example#
A hiring model marks 60% of men but only 40% of women as interview-worthy. The rates differ, so demographic parity is violated (and the 0.40 / 0.60 ≈ 0.67 ratio fails the four-fifths rule).
The catch#
Because it ignores the label, demographic parity can be satisfied only by approving unqualified members of one group to match rates — which may raise risk and clash with equal opportunity, equalized odds and predictive parity.
Limitations#
Ignores genuine differences in qualification (the true label).
Conflicts with the error-rate and calibration criteria when base rates differ.
In code#
from fairlearn.metrics import demographic_parity_difference, demographic_parity_ratio
dpd = demographic_parity_difference(y_true, y_pred, sensitive_features=A)
dpr = demographic_parity_ratio(y_true, y_pred, sensitive_features=A)
Theme: Fairness & Calibration · All terminology
Hint
Mind map — connected ideas
Equal Opportunity (Fairness) · Equalized Odds (Fairness) · Predictive Parity (Calibration)
Hint
More in Fairness & Calibration
Equal Opportunity (Fairness) · Equalized Odds (Fairness) · Fairness Guardrails · Fairness parity · Four-Fifths (80%) Rule · Predictive Parity (Calibration) · Selection Rate
See also
Source article Adapted (context, re-expressed) in our own words from: Demographic Parity (Statistical Parity) (insightful-data-lab.com).