aif360.sklearn.metrics.df_bias_amplification

aif360.sklearn.metrics.df_bias_amplification(y_true, y_pred, *, prot_attr=None, pos_label=1, concentration=1.0, sample_weight=None)[source]

Differential fairness bias amplification.

Measures the increase in unfairness attributable to a classifier compared to the original data. See [1] for more details.

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.

  • pos_label (scalar, optional) – The label of the positive class.

  • concentration (scalar, optional) – Dirichlet smoothing concentration parameter \(|R_Y|\alpha\) (must be non-negative).

  • sample_weight (array-like, optional) – Sample weights.

Returns:

float – Difference in smoothed EDF between the classifier and the original dataset, \(\epsilon_{\text{classifier}} - \epsilon_{\text{data}}\). Lower is better.

References