aif360.sklearn.metrics
.average_odds_difference
- aif360.sklearn.metrics.average_odds_difference(y_true, y_pred, *, prot_attr=None, priv_group=1, pos_label=1, sample_weight=None)[source]
A relaxed version of equality of odds.
Returns the average of the difference in FPR and TPR for the unprivileged and privileged groups:
\[\dfrac{(FPR_{D = \text{unprivileged}} - FPR_{D = \text{privileged}}) + (TPR_{D = \text{unprivileged}} - TPR_{D = \text{privileged}})}{2}\]A value of 0 indicates equality of odds.
- 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 – Average odds difference.