equal_opportunity_difference(y_true, y_pred, prot_attr=None, priv_group=1, pos_label=1, sample_weight=None)¶
A relaxed version of equality of opportunity.
Returns the difference in recall scores (TPR) between the unprivileged and privileged groups. A value of 0 indicates equality of opportunity.
- y_true (pandas.Series) – Ground truth (correct) target values.
- y_pred (array-like) – Estimated targets as returned by a classifier.
- prot_attr (array-like, keyword-only) – Protected attribute(s). If
None, all protected attributes in y_true are used.
- priv_group (scalar, optional) – The label of the privileged group.
- pos_label (scalar, optional) – The label of the positive class.
- sample_weight (array-like, optional) – Sample weights.
float – Equal opportunity difference.