Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .binder/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: aif360-binder
channels:
- conda-forge
- defaults
dependencies:
- python=3.11
- pip
- numpy
- pandas
- scikit-learn
- matplotlib
- seaborn
- jupyter
- ipywidgets
- pip:
- aif360
- cvxpy
- lime
- adversarial-robustness-toolbox>=1.0.0
- tqdm
- lightgbm==3.1.1
- igraph==0.9.8
1 change: 1 addition & 0 deletions .binder/runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.11
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def optimize(self, epsilon=1., dlist=[], verbose=True):
3. Discrimination constraints for all combinations of groups specified
(there is no distinction between protected and unprotected groups).
The constraints are given in eqn 2, 3 in the paper. We use a single
/\epsilon value for all combinations of y and d values
/\\epsilon value for all combinations of y and d values

See section 4.3 in supplementary material of the paper for an example

Expand Down
10 changes: 5 additions & 5 deletions aif360/sklearn/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,8 @@ def smoothed_edf(y_true, y_pred=None, *, prot_attr=None, pos_label=1,
r"""Smoothed empirical differential fairness (EDF).

.. math::
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
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 [#foulds18]_ for more details.

Expand All @@ -865,7 +865,7 @@ def smoothed_edf(y_true, y_pred=None, *, prot_attr=None, pos_label=1,
sample_weight (array-like, optional): Sample weights.

Returns:
float: Smoothed EDF, :math:`\epsilon`. Lower is better.
float: Smoothed EDF, :math:`\\epsilon`. Lower is better.

See also:
:func:`intersection`, :func:`smoothed_base_rate`
Expand Down Expand Up @@ -905,8 +905,8 @@ def df_bias_amplification(y_true, y_pred, *, prot_attr=None, pos_label=1,

Returns:
float: Difference in smoothed EDF between the classifier and the
original dataset, :math:`\epsilon_{\text{classifier}}
- \epsilon_{\text{data}}`. Lower is better.
original dataset, :math:`\\epsilon_{\text{classifier}}
- \\epsilon_{\text{data}}`. Lower is better.

References:
.. [#foulds18] J. R. Foulds, R. Islam, K. N. Keya, and S. Pan,
Expand Down