What is the purpose of fairness metrics in machine learning?
Fairness metrics help us check if a model treats different groups of people equally, avoiding bias and unfair treatment.
Click to reveal answer
beginner
Explain 'Demographic Parity' as a fairness metric.
Demographic Parity means the model should give positive outcomes equally across different groups, regardless of their group membership.
Click to reveal answer
intermediate
What does 'Equalized Odds' measure in fairness?
Equalized Odds checks if the model has equal true positive rates and false positive rates for all groups, ensuring fairness in errors and correct predictions.
Click to reveal answer
intermediate
Define 'Predictive Parity' in fairness metrics.
Predictive Parity means the model's positive predictions should be equally accurate for all groups, so the chance that a positive prediction is correct is the same.
Click to reveal answer
advanced
Why can it be difficult to satisfy all fairness metrics at once?
Because some fairness metrics can conflict with each other, improving one might make another worse. This is called the fairness trade-off.
Click to reveal answer
Which fairness metric requires equal positive prediction rates across groups?
ADemographic Parity
BEqualized Odds
CPredictive Parity
DCalibration
✗ Incorrect
Demographic Parity means the model should give positive outcomes at the same rate for all groups.
Equalized Odds ensures equal rates of which of the following across groups?
APositive prediction values
BOverall accuracy
CTrue positive and false positive rates
DNegative prediction values
✗ Incorrect
Equalized Odds requires equal true positive rates and false positive rates for all groups.
Predictive Parity focuses on equalizing what aspect of model predictions?
AThe accuracy of positive predictions
BThe proportion of positive predictions
CThe false negative rate
DThe overall error rate
✗ Incorrect
Predictive Parity means the chance that a positive prediction is correct should be equal across groups.
What is a common challenge when applying multiple fairness metrics simultaneously?
AThey always improve model accuracy
BThey require no data preprocessing
CThey guarantee fairness without tuning
DThey can conflict and cause trade-offs
✗ Incorrect
Fairness metrics can conflict, so improving one may worsen another, creating trade-offs.
Which fairness metric is concerned with equalizing error rates between groups?
ADemographic Parity
BEqualized Odds
CPredictive Parity
DStatistical Parity
✗ Incorrect
Equalized Odds focuses on equalizing true positive and false positive error rates across groups.
Describe three common fairness metrics used to evaluate machine learning models and explain what each one measures.
Think about how each metric checks fairness from a different angle: outcomes, errors, or prediction accuracy.
You got /4 concepts.
Explain why it might be impossible to satisfy all fairness metrics at the same time in a machine learning model.
Consider how improving fairness for one group or metric can affect others negatively.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of fairness metrics in machine learning models?
easy
A. To improve the speed of model training
B. To check if the model treats different groups equally
C. To increase the size of the training dataset
D. To reduce the number of model parameters
Solution
Step 1: Understand fairness metrics
Fairness metrics are designed to measure if a model treats different groups fairly and without bias.
Step 2: Compare options
Options B, C, and D relate to performance or data size, not fairness.
Final Answer:
To check if the model treats different groups equally -> Option B
Quick Check:
Fairness metrics = check equal treatment [OK]
Hint: Fairness metrics check equality across groups [OK]
Common Mistakes:
Confusing fairness with accuracy
Thinking fairness improves training speed
Mixing fairness with data size
2. Which of the following is a correct way to calculate demographic parity difference between two groups?
easy
A. Sum of false negatives in both groups
B. Ratio of training samples in each group
C. Difference in positive prediction rates between groups
D. Difference in model training times
Solution
Step 1: Recall demographic parity definition
Demographic parity measures if the positive prediction rates are similar across groups.
Step 2: Evaluate options
Difference in positive prediction rates between groups matches this definition. Options A, C, and D are unrelated to demographic parity.
Final Answer:
Difference in positive prediction rates between groups -> Option C
3. Given the following confusion matrices for two groups, what is the equal opportunity difference?
Group A: TP=40, FN=10, FP=20, TN=30
Group B: TP=30, FN=20, FP=15, TN=35
medium
A. 0.25
B. 0.10
C. 0.05
D. 0.20
Solution
Step 1: Calculate true positive rates (TPR) for both groups
TPR = TP / (TP + FN). For Group A: 40 / (40 + 10) = 0.8. For Group B: 30 / (30 + 20) = 0.6.
A. The difference sign is reversed; should be group1 - group0
B. Using y_true instead of y_pred for positive rates
C. Not handling division by zero if group has no samples
D. Using sum instead of mean for positive rate
Solution
Step 1: Understand statistical parity difference
It is usually calculated as positive rate of group 1 minus positive rate of group 0.
Step 2: Check code difference calculation
The code returns pos_rate_group0 - pos_rate_group1, which reverses the sign.
Final Answer:
The difference sign is reversed; should be group1 - group0 -> Option A
Quick Check:
Sign order matters in parity difference [OK]
Hint: Stat parity = group1 rate minus group0 rate [OK]
Common Mistakes:
Mixing up group order in subtraction
Ignoring zero division errors
Confusing y_true and y_pred
5. You want to ensure your loan approval model is fair by equalizing false positive rates (FPR) across two groups. Given these FPRs:
Group X: 0.10
Group Y: 0.25
Which action best reduces this fairness gap?
hard
A. Adjust the model threshold for Group Y to be more strict
B. Increase training data size for Group X
C. Remove Group Y samples from training
D. Use accuracy as the only metric to evaluate fairness
Solution
Step 1: Understand false positive rate difference
Group Y has a higher FPR (0.25) than Group X (0.10), meaning more false alarms for Group Y.
Step 2: Choose action to reduce FPR gap
Adjusting the decision threshold for Group Y to be more strict reduces false positives, lowering FPR closer to Group X.
Final Answer:
Adjust the model threshold for Group Y to be more strict -> Option A
Quick Check:
Threshold tuning reduces FPR gap [OK]
Hint: Higher threshold for high FPR group to reduce false positives [OK]
Common Mistakes:
Ignoring threshold adjustment
Removing data harms fairness
Using accuracy alone misses fairness issues
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.