Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create branch * complete literature review * reword * update overview, use bibtex for refs * fix latex alignment * suggested changes * update readme * update end section Co-authored-by: Rob Taylor <rob@synthesized.io>
- Loading branch information
Showing
8 changed files
with
112 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@book{fairmlbook, | ||
title={Fairness and Machine Learning}, | ||
author={Solon Barocas and Moritz Hardt and Arvind Narayanan}, | ||
publisher={fairmlbook.org}, | ||
url={http://www.fairmlbook.org}, | ||
year = {2019} | ||
} | ||
|
||
@article{gouic2020projection, | ||
title={Projection to fairness in statistical learning}, | ||
author={Gouic, Thibaut Le and Loubes, Jean-Michel and Rigollet, Philippe}, | ||
journal={arXiv preprint arXiv:2005.11720}, | ||
year={2020} | ||
} | ||
|
||
@misc{compas, | ||
title={How We Analyzed the COMPAS Recidivism Algorithm}, | ||
author={Jeff Larson, Surya Mattu, Lauren Kirchner and Julia Angwin}, | ||
journal={ProPublica}, | ||
url={https://www.propublica.org/article/how-we-analyzed-the-compas-recidivism-algorithm}, | ||
year={2016} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,125 +1,65 @@ | ||
Fairness | ||
Overview | ||
======== | ||
|
||
This is a general guide to assessing fairness in supervised learning tasks (classification, regression) | ||
using structural datasets. | ||
|
||
Literature Review | ||
----------------- | ||
|
||
In most supervised learning problems, a model is trained on a set of features :math:`X`, to predict or estimate | ||
a target variable :math:`Y`. The resulting prediction of a trained model is denoted by :math:`R`. Additionally, we | ||
define :math:`A` as a subset of :math:`X`, which corresponds to legally protected attributes such as | ||
ethnicity, gender, etc. | ||
|
||
.. math:: | ||
define :math:`A`, a subset of :math:`X`, which corresponds to legally protected attributes. | ||
|
||
\underbrace{\text{Title}\hspace{2mm}\overbrace{\text{Gender}\hspace{2mm} \text{Ethnicity}}^{A}\hspace{2mm}\text{Legal Status}}_{X}\hspace{3mm}\overbrace{\text{Raw Score}}^{Y}\hspace{3mm}\overbrace{\text{Predicted Score}}^{R} | ||
.. raw:: html | ||
|
||
.. There are multiple definitions of fairness in literature. | ||
<div style="width: 100%; margin: auto; text-align: center;"> | ||
|
||
There is a large amount of literature on fairness and bias, in the context of data science and | ||
machine learning, in academia. | ||
:math:`\underbrace{\text{Title}\quad \overbrace{\text{Gender}\quad \text{Ethnicity}}^{A}\quad \text{Legal Status}}_{X}\quad \overbrace{\text{Raw Score}}^{Y}\quad \overbrace{\text{Predicted Score}}^{R}` :footcite:p:`compas` | ||
|
||
There is a large number of research papers covering bias and fairness in AI and methods of | ||
reducing the problems of their presence in datasets or machine learning models. | ||
Some of them involve data preprocessing, however those solutions might sometimes be problematic | ||
due to hidden correlations present between sensitive groups and columns that seem inoffensive. | ||
.. raw:: html | ||
|
||
Algorithmic Fairness | ||
^^^^^^^^^^^^^^^^^^^^ | ||
</div> | ||
|
||
However, the great majority of solutions for ensuring fairness involve algorithmic fairness, which | ||
presumes the existence of a predictor or some type of machine learning model. Even more, it is a | ||
requirement for applying methods that address bias issues through the need of actual predictions, | ||
which are needed to calculate various probabilities, such as true and false positive rates, positive and | ||
negative predictive values and many more. These are then used to enforce metrics such as equalized odds, | ||
statistical or predictive parity. | ||
|
||
Equalized odds | ||
^^^^^^^^^^^^^^ | ||
|
||
Equalized odds is satisfied by a predictor when it produces a true positive rate and a false positive rate | ||
that are equal across the sensitive groups. This implies that the model has the same chance of correctly | ||
classifying a true positive as positive and incorrectly classifying a true positive as negative. | ||
There are multiple definitions of fairness in literature, and while many can be contentious, results are often | ||
considered fair if they are independent of legally protected characteristics such as age, gender, and ethnicity | ||
:footcite:p:`fairmlbook`. | ||
|
||
.. math:: | ||
P(\hat{y} \mid y = 0, G = male) = P(\hat{y} \mid y = 0, G = female) | ||
Statistical parity | ||
^^^^^^^^^^^^^^^^^^ | ||
P(R \mid A) = P(R) | ||
Alternatively, statistical parity (also know as group fairness or demographic parity) is achieved when members | ||
of the different sub-groups of protected categories (i.e. male and female for the protected category of gender) | ||
are predicted to belong to the positive class at the same rate. | ||
In practice, most legally protected attributes tend to be categorical, therefore for the sake of simplicity | ||
we model protected or sensitive variables as discrete random variables, which gives us the following for independence. | ||
|
||
.. math:: | ||
P(\hat{y} \mid G = male) = P(\hat{y} \mid G = female) | ||
It is clear to see that while both of these solutions seem fair, they constrain the model in different ways and | ||
it has actually been shown that it is not mathematically possible to enforce two or more methods on the same model [2], | ||
which raises a dilemma on the true meaning of bias and what type of fairness is the most desirable. | ||
|
||
While any of methods can be employed to produce workable results in practice, they are not exhaustive, as some use cases | ||
might not be focused on producing an ML model as an end result. Data synthesis is a good example of a different purpose, | ||
as the desired result is a new dataset that accurately reflects the intrinsic traits and column distributions of the original data, | ||
with the added benefits of resolving privacy and anonimity issues, as well as possibly extending the dataset to better reflect | ||
underrepresented parts of the data, with the goal of becoming more relevant in decision-making computations. | ||
As such, the aim of Fairlens is to analyze datasets and produce fairness scores in the absence of a machine learning model, | ||
picking up discrepancies between different sensitive demographics with respect to a target column, usually representing | ||
a score or classification. | ||
P(R \mid A = a) = P(R)\quad \forall a \in A | ||
Types of Biases | ||
--------------- | ||
|
||
Some of the predominant causes of unfairness resulting from structural datasets are highlighted in the | ||
works of Kamishima et al. on a regularization approach to fairness in models [1]. In summary, the | ||
following are ways in which biases can exist in structural data. | ||
|
||
Prejudice | ||
^^^^^^^^^ | ||
.. math:: | ||
\text{or} | ||
Prejudice occurs when the target column in a dataset, or any column used in a prediction model, is | ||
dependant on a sensitive column. There are three types of prejudice. | ||
.. math:: | ||
- Direct prejudice occurs when a sensitive column is directly used in a prediction model therefore the | ||
classification results will depend on sensitive features producing direct discrimination. | ||
- Indirect prejudice is defined as the presence of a statistical dependence between a sensitive feature and | ||
the target. This results in a high correlation between the values of the sensitive column and the target. | ||
Even if the target is no longer a function of the sensitive data, it is still clearly influenced by it. | ||
- Latent prejudice is defined as a statistical dependence between a sensitive variable and a non-sensitive one. | ||
For example, if there exists a correlation between a sensitive column and a non-sensitive column | ||
which is then used by the predictor, we can say the determination is discriminatory, as the | ||
dependence is still present, but a layer deeper. | ||
P(R \mid A = a) = P(R \mid A = b)\quad \forall a,b \in A | ||
Underestimation | ||
^^^^^^^^^^^^^^^ | ||
While :footcite:t:`fairmlbook` proposes 2 alternative fairness or non-discrimination criteria, separation and sufficiency, | ||
which are applicable to a range of problems, we have chosen to work with independence because of its generality | ||
:footcite:p:`gouic2020projection`. | ||
Working with this abstract definition of fairness, we quantify the bias of a variable :math:`T` in a group :math:`a`, | ||
as the statistical distance between the the probability distributions of :math:`P(T \mid A = a)` and :math:`P(T)`. | ||
|
||
Underestimation appears when a model is not fully converged due to the size limitations of a training dataset. Assuming | ||
the presence of a an algorithm that is able to learn without commiting indirect prejudice, it is going to produce a fair | ||
predictor if the the training examples are infinite. | ||
.. image:: ../_static/distance.png | ||
|
||
However, if the size of the data is limited and some groups are underrepresented, the model might unintentionally produce | ||
unfair results based on the local observations of the sample distributions. | ||
Using this definition, we can carry out hypothesis tests to measure the significance of an observed bias in a variable | ||
in a sensitive subgroup. The advantage of using this method is that the target variable can be continuous, categorical | ||
or binary, depending on the metric or test used. | ||
|
||
Negative Legacy | ||
^^^^^^^^^^^^^^^ | ||
FairLens consists of a range of metrics and tests for statistical similarity and correlation, along with Monte Carlo | ||
methods for hypothesis testing, which can be used to assess fairness in the aformentioned way. The fairness of | ||
a variable, with respect to sensitive attributes, is assessed by measuring the bias of the variable in each | ||
possible sensitive subgroup and taking the weighted average. | ||
|
||
Negative legacy is generated by biased sampling or labelling in a dataset. This can appear in data collected by organizations | ||
that, historically, have been discriminatory towards minorities, without assessing individuals based on objective criteria. This | ||
results in less samples of positive outcomes for some groups, leading to sample selection bias which is considerably difficult to | ||
detect in training data. | ||
In practice, :math:`R` can be substituted with any column in the data. For instance, if :math:`R` is the target column | ||
:math:`Y` in a dataset, then using the above methods will yeild results indicating inherent biases present in the | ||
dataset. This can be useful for mitigating bias in the data itself, which may nip the problem in the bud. | ||
On the other hand, using the predictions as :math:`R` will indicate the algorithmic bias of the model. | ||
|
||
References | ||
---------- | ||
|
||
[1] Mehrabi N, Morstatter F, Saxena N, Lerman K, Galstyan A. A survey on bias and fairness in machine learning. | ||
ACM Computing Surveys (CSUR). 2021 Jul 13;54(6):1-35. | ||
|
||
|
||
[1] Kamishima, T., Akaho, S., and Sakuma, J. Fairness aware learning through regularization approach. | ||
In IEEE 11th International Conference on Data Mining, pp. 643–650, 2011. | ||
|
||
[2] Garg, Pratyush, John Villasenor, and Virginia Foggo. Fairness metrics: A comparative analysis. | ||
In 2020 IEEE International Conference on Big Data (Big Data), pp. 3662-3666. IEEE, 2020. | ||
.. footbibliography:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ User Guide | |
:glob: | ||
:caption: Getting Started | ||
|
||
fairness | ||
quickstart | ||
|
||
.. toctree:: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters