Privacy & Fairness in MLFairness Metrics (Demographic Parity, Equalized Odds)Easy⏱️ ~2 min

What is Demographic Parity?

Definition
Demographic Parity requires that the positive prediction rate be equal across all demographic groups. If 30% of Group A receives positive predictions, then 30% of Group B must also, regardless of underlying differences in qualifications.

The Mathematical Definition

Demographic parity is satisfied when: P(Ŷ=1|A=0) = P(Ŷ=1|A=1), where Ŷ is the predicted outcome and A is the protected attribute. The probability of receiving a positive prediction should be identical regardless of group membership. For loan approval, if 40% of male applicants get approved, 40% of female applicants must also get approved.

Why Demographic Parity Exists

Consider a hiring model trained on historical data. If past hiring was biased (80% of engineers hired were male due to discrimination), the model learns to prefer male candidates. Even removing gender as a feature, the model finds proxies: hobbies, writing style, and school names correlate with gender. Demographic parity forces equal selection rates, breaking the cycle where biased data produces biased decisions.

The Core Limitation

Demographic parity ignores ground truth. If Group A has 50% qualified applicants and Group B has 70%, demographic parity forces equal approval rates anyway. This means either approving unqualified Group A members or rejecting qualified Group B members. The metric treats unequal outcomes as problematic even when they reflect real qualification differences.

💡 Key Insight: Demographic parity is most appropriate when historical data reflects systemic discrimination. It is less appropriate when base rate differences reflect genuine, non-discriminatory factors.
💡 Key Takeaways
Requires equal positive prediction rates across groups regardless of base rates
Models find proxies (hobbies, school names) even when protected attributes are removed
Appropriate when historical data reflects systemic discrimination
Ignores ground truth: forces equal outcomes even when qualification rates differ
Creates accuracy trade-off: may approve unqualified or reject qualified individuals
📌 Interview Tips
1Define the formula clearly: P(positive | Group A) = P(positive | Group B)
2Explain when appropriate: when historical data is fundamentally biased and should not be trusted
← Back to Fairness Metrics (Demographic Parity, Equalized Odds) Overview