Which statement best describes the Equal Opportunity fairness metric in machine learning?
Think about which error type Equal Opportunity focuses on balancing.
Equal Opportunity demands that the model correctly identifies positive cases equally well across groups, meaning the true positive rates should be the same.
Given the following confusion matrices for two groups, what is the difference in false positive rates (FPR) between Group A and Group B?
Group A: TP=40, FP=10, TN=50, FN=5 Group B: TP=30, FP=20, TN=40, FN=10
FPR = FP / (FP + TN). Calculate for each group and subtract.
Group A FPR = 10 / (10 + 50) = 0.1667; Group B FPR = 20 / (20 + 40) = 0.3333; Difference = 0.3333 - 0.1667 = 0.1666 ≈ 0.17.
You want to build a classifier that satisfies Demographic Parity. Which model choice below is most likely to help achieve this?
Demographic Parity focuses on equalizing positive predictions, not just accuracy.
Demographic Parity requires the predicted positive rates to be equal across groups, so training with a constraint targeting this is best.
What does a Disparate Impact value of 0.6 indicate about a model's fairness?
Disparate Impact compares positive prediction rates between groups.
A Disparate Impact of 0.6 means the unprivileged group receives positive predictions at 60% the rate of the privileged group, indicating potential bias.
What error will this Python code raise when calculating the statistical parity difference?
def stat_parity_difference(y_pred, group):
pos_rate_priv = sum(y_pred[group == 0]) / len(y_pred[group == 0])
pos_rate_unpriv = sum(y_pred[group == 1]) / len(y_pred[group == 1])
return pos_rate_unpriv - pos_rate_priv
# y_pred = [1, 0, 1, 1], group = [0, 1, 0]def stat_parity_difference(y_pred, group): pos_rate_priv = sum(y_pred[group == 0]) / len(y_pred[group == 0]) pos_rate_unpriv = sum(y_pred[group == 1]) / len(y_pred[group == 1]) return pos_rate_unpriv - pos_rate_priv # y_pred = [1, 0, 1, 1], group = [0, 1, 0]
Check the data types and operations used for indexing.
Boolean indexing like y_pred[group == 0] works on numpy arrays, but y_pred and group are lists here, so this raises a TypeError.