Fairness definitions in ML: demographic parity and equalized odds

Updated

Demographic parity requires that prediction outcomes be independent of a sensitive attribute, while equalized odds requires equal error rates across groups. These definitions can conflict, as shown by trade-off theorems. Practical tools such as Fairlearn and the What-If Tool help evaluate and mitigate disparities.

Fairness definitions in ML: demographic parity and equalized odds
Photo: Nikodem Nijaki, CC BY-SA 3.0

Why fairness definitions matter

Human biases can be unintentionally replicated by machine learning algorithms. The Google Machine Learning Crash Course notes that evaluating a model responsibly requires auditing training data and evaluating predictions for bias.

To address these concerns, researchers have developed formal definitions of fairness. The textbook Fairness and Machine Learning introduces non-discrimination criteria in a decision-theoretic setting.

Demographic parity

Demographic parity requires that the predicted outcome be independent of the sensitive attribute. This means that the proportion of positive predictions should be the same across groups defined by that attribute.

This definition focuses on the distribution of outcomes rather than on correctness. It does not consider whether the model's predictions are accurate for each group.

Equalized odds and equality of opportunity

Equalized odds requires that true positive and false positive rates be equal across groups. The paper "Equality of Opportunity in Supervised Learning" proposes this criterion and shows how to adjust a predictor to remove discrimination.

Equality of opportunity is a relaxation that requires only equal true positive rates. The paper describes both as oblivious measures that depend only on joint statistics of predictor, target, and sensitive attribute.

Trade-offs between fairness definitions

Fairness conditions can be mutually incompatible. The paper on inherent trade-offs proves that three fairness conditions cannot be satisfied simultaneously except in highly constrained special cases.

This result means that practitioners must choose which definition to prioritize, as no single model can meet all reasonable fairness criteria at once.

Tools for assessing fairness

Several open-source tools support fairness assessment and mitigation. The Fairlearn project provides metrics and algorithms, emphasizing that fairness is sociotechnical and requires considering societal context.

Visual tools allow users to explore model behavior. The What-If Tool enables users to test performance in hypothetical situations and visualize different fairness metrics.

Steps to assess fairness in a machine learning modelStep 1: Identify sensitive attribute; Step 2: Choose fairness metric; Step 3: Evaluate model on data; Step 4: Assess disparities; Step 5: Apply mitigationSteps to assess fairness in a machinelearning modelIdentify sensitive attributeChoose fairness metricEvaluate model on dataAssess disparitiesApply mitigation
Steps to assess fairness in a machine learning model
Comparison of common fairness definitions
DefinitionConditionGroup focusExample
Demographic parityPrediction independent of sensitive attributeProportions of outcomes across groupsEqual selection rates for loan approval
Equalized oddsEqual true positive and false positive rates across groupsError rates for each groupSimilar misclassification across genders
Equality of opportunityEqual true positive rates across groupsPositive outcomes for qualified individualsSame detection rate for qualified applicants

Frequently asked questions

What is demographic parity?

Demographic parity requires that the predicted outcome be independent of a sensitive attribute, so the proportion of positive predictions is equal across groups.

What is equalized odds?

Equalized odds requires that true positive and false positive rates are equal across groups, ensuring similar error rates.

How do fairness definitions conflict?

Research shows that three fairness conditions cannot be satisfied simultaneously except in special cases, so trade-offs are inevitable.

What tools can help measure fairness?

Fairlearn provides metrics and algorithms, while the What-If Tool allows visual probing of model behavior for different fairness metrics.

What is the difference between equalized odds and equality of opportunity?

Equalized odds requires equal true positive and false positive rates, while equality of opportunity requires only equal true positive rates.