aif360.sklearn.metrics.equal_opportunity_difference

aif360.sklearn.metrics.equal_opportunity_difference(y_true, y_pred, *, prot_attr=None, priv_group=1, pos_label=1, sample_weight=None)[source]

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.

Parameters:
  • 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.

Returns:

float – Equal opportunity difference.

See also

recall_score()