aif360.sklearn.metrics
.smoothed_edf
- aif360.sklearn.metrics.smoothed_edf(y_true, y_pred=None, *, prot_attr=None, pos_label=1, concentration=1.0, sample_weight=None)[source]
Smoothed empirical differential fairness (EDF).
\[e^{-\epsilon} \leq \frac{\sum_{A=s_i}{P(y|x)} + \alpha}{N_{s_i} + |R_Y|\alpha} \frac{N_{s_j} + |R_Y|\alpha}{\sum_{A=s_j}{P(y|x) + \alpha}} \leq e^\epsilon\]See [1] for more details.
Note
If only y_true is provided, this will return the maximum epsilon for any two intersectional groups (smoothed EDF of the original dataset). If both y_true and y_pred are provided, only y_pred is used.
- Parameters:
y_true (pandas.Series) – Ground truth (correct) target values. If y_pred is provided, this is ignored.
y_pred (array-like, optional) – 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 – Smoothed EDF, \(\epsilon\). Lower is better.
See also
References