Fairness Metrics: Demographic Parity, Equalized Odds, and Trade-offs › Group Fairness
Language AI HandbookAll chapters Fairness Metrics: Demographic Parity, Equalized Odds, and Trade-offs › Group FairnessOne section · Sections in this chapter2 / 13 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Group fairness, also called statistical fairness or demographic fairness, asks whether a model produces similar outcomes across different demographic groups. The groups are typically defined by a sensitive attribute, such as race, gender, age, or disability status. Group fairness is the most commonly used family of fairness criteria in practice because it maps naturally onto legal and regulatory frameworks, is straightforward to measure from outcome data, and does not require specifying a similarity function between individuals.
A sensitive attribute (also called a protected attribute) is a feature that defines a demographic group. Legal frameworks and ethical guidelines typically protect groups defined by race, sex, national origin, religion, age, and disability. In fairness analysis, we use to denote the sensitive attribute and compare model behavior across its values. The sensitive attribute may or may not be included as an explicit input feature; either way, other features can encode demographic information through correlations.
Let's establish notation. We have:
- : input features (excluding the sensitive attribute, or possibly including it)
- : sensitive attribute (e.g., for group 0, for group 1)
- : true label (the ground truth outcome)
- : predicted label (the model's output)
- : predicted probability score, where for some threshold
Group fairness metrics compare properties of the joint distributions across values of . The key question is whether the distribution of outcomes, conditional on group membership, looks the same for all groups.
Demographic Parity
Demographic parity, also called statistical parity or independence, requires that the model's positive prediction rate is the same across all groups. Formally:
where:
- is the fraction of individuals in group 0 who receive a positive prediction
- is the same quantity for group 1
The intuition is direct: if 30% of group 0 applicants are approved for a loan, then 30% of group 1 applicants should also be approved, regardless of other differences between the groups. The model's decisions, aggregated at the group level, should look the same for both groups. The criterion is also called "independence" because it requires that be statistically independent of : knowing a person's group should give you no information about whether they receive a positive prediction.
In practice, you often measure the demographic parity difference (DPD) and the demographic parity ratio (DPR):
where:
- DPD of 0 and DPR of 1 both indicate perfect demographic parity
- The US Equal Employment Opportunity Commission's "four-fifths rule" considers selection rates below 0.8 (DPR < 0.8) as evidence of adverse impact in employment contexts
- Negative DPD values mean group 1 is selected at a lower rate than group 0
Demographic parity has an important weakness: it makes no reference to the true labels . A model that randomly approves applicants at equal rates satisfies demographic parity, but it is also useless. More subtly, in domains where the base rate of the positive outcome differs across groups, for example if actual default rates differ between demographic groups due to historical economic inequality, enforcing demographic parity forces the model to approve some higher-risk applicants from one group and reject lower-risk applicants from another. Whether this is appropriate is a policy question, not a statistical one.
Demographic parity is most suitable when you believe the differences in observed base rates are themselves artifacts of historical discrimination or measurement bias, rather than reflecting real differences in the underlying construct being predicted. In hiring, if equally qualified candidates from different groups have unequal representation due to past exclusion, demographic parity can serve as a corrective mechanism. If the base rate difference reflects real differences in the outcome variable, demographic parity will intentionally create misclassifications.
Equalized Odds
Equalized odds, introduced by Hardt, Price, and Srebro (2016), adds the true labels back into the picture. It requires that both the true positive rate (TPR) and the false positive rate (FPR) are equal across groups:
where:
- The condition gives the true positive rate: among truly positive individuals, both groups have the same chance of receiving a positive prediction
- The condition gives the false positive rate: among truly negative individuals, both groups have the same chance of receiving a false positive
This is a stronger requirement than demographic parity. It says the model must make the same kinds of errors at the same rates for both groups. If a model is better at detecting true positives for group 0 than group 1, it violates equalized odds even if its overall accuracy is identical across groups. The key insight is that equalized odds conditions on the true label, which means it only makes sense if the true label is reliable and unbiased. If is itself a product of biased measurement or past discrimination, conditioning on it can reproduce that bias.
Equalized odds is also called "separation" in the fairness literature, because it requires that the joint distribution of be the same conditional on . In other words, once you know whether someone truly belongs to the positive class, their group membership should have no bearing on their predicted outcome.
The equalized odds difference measures the maximum disparity across the two conditions. Taking the maximum ensures that a violation of either the TPR or FPR equality is captured:
where:
- The first term inside is the absolute FPR difference: how much more often does one group receive a false positive prediction?
- The second term is the absolute TPR difference: how much more often are one group's truly positive individuals correctly identified?
- A value of 0 indicates perfect equalized odds
Equalized odds protects both types of individuals simultaneously. Among those who are truly positive (qualified candidates, patients who need treatment, customers who will repay a loan), both groups are equally likely to be recognized. Among those who are truly negative, both groups are equally likely to be falsely flagged. This symmetric protection is what makes equalized odds particularly useful in contexts where both kinds of errors carry significant consequences.
Equal Opportunity
Equal opportunity is a relaxation of equalized odds that focuses only on the true positive rate:
where:
- Only qualified or positive-labeled individuals are compared across groups
- The false positive rate is allowed to differ between groups
The motivation is asymmetric: in high-stakes domains like hiring, criminal justice, or medical diagnosis, missing a truly qualified individual (a false negative) is often the most consequential error. Equal opportunity ensures that among truly qualified applicants, both groups have the same chance of being selected. It does not require that both groups receive the same number of false positives, which can matter in contexts where the "false positive" outcome is not especially harmful to the individual being misclassified.
Consider college admissions. Among equally qualified students from different demographic groups, equal opportunity requires that each group has the same admission rate. It does not require that the overall admission rate be equal across groups, nor that the false positive rate (admitting students who will struggle academically) be equal. The focus is entirely on giving qualified individuals from all groups equal access to the positive outcome.
When deciding between equalized odds and equal opportunity, consider whether false positives matter differently than false negatives in your context. If both error types carry significant harm to the affected individuals, equalized odds is more protective. If false negatives are primarily harmful (denying opportunity) while false positives are relatively benign, equal opportunity is sufficient.
Predictive Parity
Predictive parity, also called calibration within groups or conditional use accuracy equality, requires that the precision is equal across groups:
where:
- is the fraction of individuals predicted positive in group who are positive (the precision, or positive predictive value, for group )
This is the flip side of equal opportunity. Instead of asking "given you are truly positive, what is your chance of being predicted positive?", predictive parity asks "given the model predicts you positive, what is the probability you are positive?" A model satisfies predictive parity if its positive predictions are equally reliable for both groups. A score of should mean the same thing regardless of which group you belong to.
Predictive parity has an important connection to calibration. A well-calibrated model produces probability scores such that for all score values . If a model is calibrated within groups, then any threshold applied to both groups will produce equal precision, giving predictive parity.
The COMPAS recidivism risk tool controversy is a useful case study here. The tool's developer, Northpointe, showed that among defendants assigned a "high risk" score, the recidivism rate was similar for Black and white defendants, showing calibration within groups. ProPublica showed that the tool assigned high-risk scores to Black defendants who did not reoffend twice as often as to white defendants who did not reoffend, showing a violation of equalized odds: specifically, a higher false positive rate for Black defendants. Both findings were mathematically correct. They reflect different fairness definitions applied to the same model, and their apparent contradiction is not accidental. As we will see, it is mathematically unavoidable.
Negative Predictive Parity
The symmetric counterpart is negative predictive parity, which requires that the negative predictive value is equal across groups: negative predictive parity requires that the negative predictive value is equal across groups:
This asks: given the model predicts someone negative (rejects, denies, flags as low risk), what is the probability they are negative? If the model is better at correctly identifying true negatives for one group, its negative predictions are more trustworthy for that group. In criminal justice, this means: if the model says "low risk," is it equally likely to be correct for Black and white defendants? Negative predictive parity is rarely discussed compared to the four main criteria above, but in high-stakes contexts, asymmetric treatment of negative predictions can cause harm.