Why Is My Classifier Discriminatory?

Irene Chen, Fredrik D. Johansson, David Sontag

Introduction

As machine learning algorithms increasingly affect decision making in society, many have raised concerns about the fairness and biases of these algorithms, especially in applications to healthcare or criminal justice, where human lives are at stake (Angwin et al., 2016; Barocas & Selbst, 2016). It is often hoped that the use of automatic decision support systems trained on observational data will remove human bias and improve accuracy. However, factors such as data quality and model choice may encode unintentional discrimination, resulting in systematic disparate impact.

We study fairness in prediction of outcomes such as recidivism, annual income, or patient mortality. Fairness is evaluated with respect to protected groups of individuals defined by attributes such as gender or ethnicity (Ruggieri et al., 2010). Following previous work, we measure discrimination in terms of differences in prediction cost across protected groups (Calders & Verwer, 2010; Dwork et al., 2012; Feldman et al., 2015). Correcting for issues of data provenance and historical bias in labels is outside of the scope of this work. Much research has been devoted to constraining models to satisfy cost-based fairness in prediction, as we expand on below. The impact of data collection on discrimination has received comparatively little attention.

Fairness in prediction has been encouraged by adjusting models through regularization (Bechavod & Ligett, 2017; Kamishima et al., 2011), constraints (Kamiran et al., 2010; Zafar et al., 2017), and representation learning (Zemel et al., 2013). These attempts can be broadly categorized as model-based approaches to fairness. Others have applied data preprocessing to reduce discrimination (Hajian & Domingo-Ferrer, 2013; Feldman et al., 2015; Calmon et al., 2017). For an empirical comparison, see for example Friedler et al. (2018). Inevitably, however, restricting the model class or perturbing training data to improve fairness may harm predictive accuracy (Corbett-Davies et al., 2017).

A tradeoff of predictive accuracy for fairness is sometimes difficult to motivate when predictions influence high-stakes decisions. In particular, post-hoc correction methods based on randomizing predictions (Hardt et al., 2016; Pleiss et al., 2017) are unjustifiable for ethical reasons in clinical tasks such as severity scoring. Moreover, as pointed out by Woodworth et al. (2017), post-hoc correction may lead to suboptimal predictive accuracy compared to other equally fair classifiers.

Disparate predictive accuracy can often be explained by insufficient or skewed sample sizes or inherent unpredictability of the outcome given the available set of variables. With this in mind, we propose that fairness of predictive models should be analyzed in terms of model bias, model variance, and outcome noise before they are constrained to satisfy fairness criteria. This exposes and separates the adverse impact of inadequate data collection and the choice of the model on fairness. The cost of fairness need not always be one of predictive accuracy, but one of investment in data collection and model development. In high-stakes applications, the benefits often outweigh the costs.

In this work, we use the term “discrimination" to refer to specific kinds of differences in the predictive power of models when applied to different protected groups. In some domains, such differences may not be considered discriminatory, and it is critical that decisions made based on this information are sensitive to this fact. For example, in prior work, researchers showed that causal inference may help uncover which sources of differences in predictive accuracy introduce unfairness (Kusner et al., 2017). In this work, we assume that observed differences are considered discriminatory and discuss various means of explaining and reducing them.

We give a procedure for analyzing discrimination in predictive models with respect to cost-based definitions of group fairness, emphasizing the impact of data collection. First, we propose the use of bias-variance-noise decompositions for separating sources of discrimination. Second, we suggest procedures for estimating the value of collecting additional training samples. Finally, we propose the use of clustering for identifying subpopulations that are discriminated against to guide additional variable collection. We use these tools to analyze the fairness of common learning algorithms in three tasks: predicting income based on census data, predicting mortality of patients in critical care, and predicting book review ratings from text. We find that the accuracy in predictions of the mortality of cancer patients vary by as much as 20%20\% between protected groups. In addition, our experiments confirm that discrimination level is sensitive to the quality of the training data.

Background

A popular cost-based definition of fairness is the equalized odds criterion, which states that a binary classifier Y^\hat{Y} is fair if its false negative rates (FNR) and false positive rates (FPR) are equal across groups (Hardt et al., 2016). We define FPR and FNR with respect to protected group a∈Aa\in\mathcal{A} by

Exact equality, \mboxFPR0(Y^)=\mboxFPR1(Y^)\mbox{FPR}_{0}(\hat{Y})=\mbox{FPR}_{1}(\hat{Y}), is often hard to verify or enforce in practice. Instead, we study the degree to which such constraints are violated. More generally, we use differences in cost functions γa\gamma_{a} between protected groups a∈Aa\in\mathcal{A} to define the level of discrimination Γ\Gamma,

A score-based classifier is calibrated if the prediction score assigned to a unit equals the fraction of positive outcomes for all units assigned similar scores. It is impossible for a classifier to be calibrated in every protected group and satisfy multiple cost-based fairness criteria at once, unless accuracy is perfect or base rates of outcomes are equal across groups (Chouldechova, 2017). A relaxed version of this result (Kleinberg et al., 2016) applies to the discrimination level Γ\Gamma. Inevitably, both constraint-based methods and our approach are faced with a choice between which fairness criteria to satisfy, and at what cost.

Sources of perceived discrimination

There are many potential sources of discrimination in predictive models. In particular, the choice of hypothesis class H\mathcal{H} and learning objective has received a lot of attention (Calders & Verwer, 2010; Zemel et al., 2013; Fish et al., 2016). However, data collection—the chosen set of predictive variables XX, the sampling distribution p(X,A,Y)p(X,A,Y), and the training set size nn—is an equally integral part of deploying fair machine learning systems in practice, and it should be guided to promote fairness. Below, we tease apart sources of discrimination through bias-variance-noise decompositions of cost-based fairness criteria. In general, we may think of noise in the outcome as the effect of a set of unobserved variables UU, potentially interacting with XX. Even the optimal achievable error for predictions based on XX may be reduced further by observing parts of UU. In Figure 1, we illustrate three common learning scenarios and study their fairness properties through bias, variance, and noise.

The expected discrimination level Γ‾(Y^)\overline{\Gamma}(\hat{Y}) of a predictive model Y^\hat{Y} learned from a random training set DD, is

Γ‾(Y^)\overline{\Gamma}(\hat{Y}) is not observed in practice when only a single training set dd is available. If nn is small, it is recommended to estimate Γ‾\overline{\Gamma} through re-sampling methods such as bootstrapping (Efron, 1992).

Following Domingos (2000), we define bias BB, variance VV and noise NN at a point (x,a)(x,a) below.

In words, the bias BB is the loss incurred by the main prediction relative to the optimal prediction. The variance VV is the average loss incurred by the predictions learned from different datasets relative to the main prediction. The noise NN is the remaining loss independent of the learning algorithm, often known as the Bayes error. We use these definitions to decompose Γ‾\overline{\Gamma} under various definitions of γa\gamma_{a}.

With γ‾a\overline{\gamma}_{a} the group-specific zero-one loss or class-conditional versions (e.g. FNR, FPR), or the mean squared error, γ‾a\overline{\gamma}_{a} and the discrimination level Γ‾\overline{\Gamma} admit decompositions of the form

where we leave out Y^\hat{Y} in the decomposition of Γ‾\overline{\Gamma} for brevity. With B,VB,V defined as in (2), we have

For the zero-one loss, cv(x,a)=1c_{v}(x,a)=1 if y^m(x,a)=y∗(x,a)\hat{y}_{m}(x,a)=y^{*}(x,a), otherwise cv(x,a)=−1c_{v}(x,a)=-1. For the squared loss cv(x,a)=1c_{v}(x,a)=1. The noise term for population losses is

and for class-conditional losses w.r.t class y∈{0,1}y\in\{0,1\},

Conditioning and exchanging order of expectation, the cases of mean squared error and zero-one losses follow from Domingos (2000). Class-conditional losses follow from a case-by-case analysis of possible errors. See the supplementary material for a full proof. ∎

Theorem 1 points to distinct sources of perceived discrimination. Significant differences in bias B‾0−B‾1\overline{B}_{0}-\overline{B}_{1} indicate that the chosen model class is not flexible enough to fit both protected groups well (see Figure 1(c)). This is typical of (misspecified) linear models which approximate non-linear functions well only in small regions of the input space. Regularization or post-hoc correction of models effectively increase the bias of one of the groups, and should be considered only if there is reason to believe that the original bias is already minimal.

Differences in variance, V‾0−V‾1\overline{V}_{0}-\overline{V}_{1}, could be caused by differences in sample sizes n0,n1n_{0},n_{1} or group-conditional feature variance \mboxVar(X∣A)\mbox{Var}(X\mid A), combined with a high capacity model. Targeted collection of training samples may help resolve this issue. Our decomposition does not apply to post-hoc randomization methods (Hardt et al., 2016) but we may treat these in the same way as we do random training sets and interpret them as increasing the variance V‾a\overline{V}_{a} of one group to improve fairness.

When noise is significantly different between protected groups, discrimination is partially unrelated to model choice and training set size and may only be reduced by measuring additional variables.

If N‾0≠N‾1\overline{N}_{0}\neq\overline{N}_{1}, no model can be 0-discriminatory in expectation without access to additional information or increasing bias or variance w.r.t. to the Bayes optimal classifier.

By definition, Γ‾=0  ⟹  (N‾1−N‾0)=(B‾0−B‾1)+(V‾0−V‾1)\overline{\Gamma}=0\implies(\overline{N}_{1}-\overline{N}_{0})=(\overline{B}_{0}-\overline{B}_{1})+(\overline{V}_{0}-\overline{V}_{1}). As the Bayes optimal classifier has neither bias nor variance, the result follows immediately. ∎

In line with Proposition 1, most methods for ensuring algorithmic fairness reduce discrimination by trading off a difference in noise for one in bias or variance. However, this trade-off is only motivated if the considered predictive model is close to Bayes optimal and no additional predictive variables may be measured. Moreover, if noise is homoskedastic in regression settings, post-hoc randomization is ill-advised, as the difference in Bayes error N‾0−N‾1\overline{N}_{0}-\overline{N}_{1} is zero, and discrimination is caused only by model bias or variance (see the supplementary material for a proof).

Group-specific variance V‾a\overline{V}_{a} may be estimated through sample splitting or bootstrapping (Efron, 1992). In contrast, the noise N‾a\overline{N}_{a} and bias B‾a\overline{B}_{a} are difficult to estimate when XX is high-dimensional or continuous. In fact, no convergence results of noise estimates may be obtained without further assumptions on the data distribution (Antos et al., 1999). Under some such assumptions, noise may be approximately estimated using distance-based methods (Devijver & Kittler, 1982), nearest-neighbor methods (Fukunaga & Hummels, 1987; Cover & Hart, 1967), or classifier ensembles (Tumer & Ghosh, 1996). When comparing the discrimination level of two different models, noise terms cancel, as they are independent of the model. As a result, differences in bias may be estimated even when the noise is not known (see the supplementary material).

Testing for significant discrimination

When sample sizes are small, perceived discrimination may not be statistically significant. In the supplementary material, we give statistical tests both for the discrimination level Γ(Y^)\Gamma(\hat{Y}) and the difference in discrimination level between two models Y^,Y^′\hat{Y},\hat{Y}^{\prime}.

Reducing discrimination through data collection

In light of the decomposition of Theorem 1, we explore avenues for reducing group differences in bias, variance, and noise without sacrificing predictive accuracy. In practice, predictive accuracy is often artificially limited when data is expensive or impractical to collect. With an investment in training samples or measurement of predictive variables, both accuracy and fairness may be improved.

Standard regularization used to avoid overfitting is not guaranteed to improve or preserve fairness. An alternative route is to collect more training samples and reduce the impact of the bias-variance trade-off. When supplementary data is collected from the same distribution as the existing set, covariate shift may be avoided (Quionero-Candela et al., 2009). This is often achievable; labeled data may be expensive, such as when paying experts to label observations, but given the means to acquire additional labels, they would be drawn from the original distribution. To estimate the value of increasing sample size, we predict the discrimination level Γ‾(Y^D)\overline{\Gamma}(\hat{Y}_{D}) as DD increases in size.

The population prediction loss γ‾(Y^,n)\overline{\gamma}(\hat{Y},n), and group-specific losses γ‾0(Y^,n),γ‾1(Y^,n)\overline{\gamma}_{0}(\hat{Y},n),\overline{\gamma}_{1}(\hat{Y},n), for a fixed learning algorithm Y^\hat{Y}, behave asymptotically as inverse power-law curves with parameters (α,β,δ)(\alpha,\beta,\delta). That is, ∃M,M0,M1\exists M,M_{0},M_{1} such that for n≥M,na≥Man\geq M,n_{a}\geq M_{a},

Intercepts, δ,δa\delta,\delta_{a} in (3) represent the asymptotic bias B‾(Y^D∞)\overline{B}(\hat{Y}_{D_{\infty}}) and the Bayes error N‾\overline{N}, with the former vanishing for consistent estimators. Accurately estimating δ\delta from finite samples is often challenging as the first term tends to dominate the learning curve for practical sample sizes.

In experiments, we find that the inverse power-laws model fit group conditional (γa\gamma_{a}) and class-conditional (FPR, FNR) errors well, and use these to extrapolate Γ‾(Y^,n)\overline{\Gamma}(\hat{Y},n) based on estimates from subsampled data.

2 Measuring additional variables

When discrimination Γ‾\overline{\Gamma} is dominated by a difference in noise, N‾0−N‾1\overline{N}_{0}-\overline{N}_{1}, fairness may not be improved through model selection alone without sacrificing accuracy (see Proposition 1). Such a scenario is likely when available covariates are not equally predictive of the outcome in both groups. We propose identification of clusters of individuals in which discrimination is high as a means to guide further variable collection—if the variance in outcomes within a cluster is not explained by the available feature set, additional variables may be used to further distinguish its members.

Let a random variable CC represent a (possibly stochastic) clustering such that C=cC=c indicates membership in cluster cc. Then let ρa(c)\rho_{a}(c) denote the expected prediction cost for units in cluster cc with protected attribute aa. As an example, for the zero-one loss we let

and define ρ\rho analogously for false positives or false negatives. Clusters cc for which ∣ρ0(c)−ρ1(c)∣|\rho_{0}(c)-\rho_{1}(c)| is large identify groups of individuals for which discrimination is worse than average, and can guide targeted collection of additional variables or samples. In our experiments on income prediction, we consider particularly simple clusterings of data defined by subjects with measurements above or below the average value of a single feature x(c)x(c) with c∈{1,…,k}c\in\{1,\ldots,k\}. In mortality prediction, we cluster patients using topic modeling. As measuring additional variables is expensive, the utility of a candidate set should be estimated before collecting a large sample (Koepke & Bilenko, 2012).

Experiments

We analyze the fairness properties of standard machine learning algorithms in three tasks: prediction of income based on national census data, prediction of patient mortality based on clinical notes, and prediction of book review ratings based on review text.A synthetic experiment validating group-specific learning curves is left to the supplementary material. We disentangle sources of discrimination by assessing the level of discrimination for the full data,estimating the value of increasing training set size by fitting Type II learning curves, and using clustering to identify subgroups where discrimination is high. In addition, we estimate the Bayes error through non-parametric techniques.

In our experiments, we omit the sensitive attribute AA from our classifiers to allow for closer comparison to previous works, e.g. Hardt et al. (2016); Zafar et al. (2017). In preliminary results, we found that fitting separate classifiers for each group increased the error rates of both groups due to the resulting smaller sample size, as classifiers could not learn from other groups. As our model objective is to maximize accuracy over all data points, our analysis uses a single classifier trained on the entire population.

Predictions of a person’s salary may be used to help determine an individual’s market worth, but systematic underestimation of the salary of protected groups could harm their competitiveness on the job market. The Adult dataset in the UCI Machine Learning Repository (Lichman, 2013) contains 32,561 observations of yearly income (represented as a binary outcome: over or under $50,000) and twelve categorical or continuous features including education, age, and marital status. Categorical attributes are dichotomized, resulting in a total of 105 features.

We follow Pleiss et al. (2017) and strive to ensure fairness across genders, which is excluded as a feature from the predictive models. Using an 80/20 train-test split, we learn a random forest predictor, which is is well-calibrated for both groups (Brier (1950) scores of 0.13 and 0.06 for men and women). We find the difference in zero-one loss Γ\mbox\sczo(Y^)\Gamma^{\mbox{{\sc zo}}}(\hat{Y}) has a 95%-confidence intervalDetails for computing statistically significant discrimination can be found in the supplementary material. .085±.069.085\pm.069 with decision thresholds at 0.5. At this threshold, the false negative rates are 0.388±0.0260.388\pm 0.026 and 0.448±0.0640.448\pm 0.064 for men and women respectively, and the false positive rates 0.111±0.0110.111\pm 0.011 and 0.033±0.0080.033\pm 0.008. We focus on random forest classifiers, although we found similar results for logistic regression and decision trees.

We examine the effect of varying training set size nn on discrimination. We fit inverse power-law curves to estimates of \mboxFPR(Y^,n)\mbox{FPR}(\hat{Y},n) and \mboxFNR(Y^,n)\mbox{FNR}(\hat{Y},n) using repeated sample splitting where at least 20% of the full data is held out for evaluating generalization error at every value of nn. We tune hyperparameters for each training set size for decision tree classifiers and logistic regression but tuned over the entire dataset for random forest. We include full training details in the supplementary material. Metrics are averaged over 50 trials. See Figure 2(a) for the results for random forests. Both FPR and FNR decrease with additional training samples. The discrimination level Γ\mbox\scfnr\Gamma^{\mbox{{\sc fnr}}} for false negatives decreases by a striking 40% when increasing the training set size from 1000 to 10,000. This suggests that trading off accuracy for fairness at small sample sizes may be ill-advised. Based on fitted power-law curves, we estimate that for unlimited training data drawn from the same distribution, we would have Γ\mbox\scfnr(Y^)≈0.04\Gamma^{\mbox{{\sc fnr}}}(\hat{Y})\approx 0.04 and Γ\mbox\scfpr(Y^)≈0.08\Gamma^{\mbox{{\sc fpr}}}(\hat{Y})\approx 0.08.

In Figure 2(b), we compare estimated upper and lower bounds on noise (ElowE_{low} and EupE_{up}) for men and women using the Mahalanobis and Bhattacharyya distances (Devijver & Kittler, 1982), and a kk-nearest neighbor method (Cover & Hart, 1967) with k=5k=5 and 5-fold cross validation. Men have consistently higher noise estimates than women, which is consistent with the differences in zero-one loss found using all models. For nearest neighbors estimates, intervals for men and women are non-overlapping, which suggests that noise may contribute substantially to discrimination.

To guide attempts at reducing discrimination further, we identify clusters of individuals for whom false negative predictions are made at different rates between protected groups, with the method described in Section 4.2. We find that for individuals in executive or managerial occupations (12% of the sample), false negatives are more than twice as frequent for women (0.412) as for men (0.157). For individuals in all other occupations, the difference is significantly smaller, 0.543 for women and 0.461 for men, despite the fact that the disparity in outcome base rates in this cluster is large (0.26 for men versus 0.09 for women). A possible reason is that in managerial occupations the available variable set explains a larger portion of the variance in salary for men than for women. If so, further sub-categorization of managerial occupations could help reduce discrimination in prediction.

2 Intensive care unit mortality prediction

Unstructured medical data such as clinical notes can reveal insights for questions like mortality prediction; however, disparities in predictive accuracy may result in discrimination of protected groups. Using the MIMIC-III dataset of all clinical notes from 25,879 adult patients from Beth Israel Deaconess Medical Center (Johnson et al., 2016), we predict hospital mortality of patients in critical care. Fairness is studied with respect to five self-reported ethnic groups of the following proportions: Asian (2.2%), Black (8.8%), Hispanic (3.4%), White (70.8%), and Other (14.8%). Notes were collected in the first 48 hours of an intensive care unit (ICU) stay; discharge notes were excluded. We only included patients that stayed in the ICU for more than 48 hours. We use the tf-idf statistics of the 10,000 most frequent words as features. Training a model on 50% of the data, selecting hyper-parameters on 25%, and testing on 25%, we find that logistic regression with L1-regularization achieves an AUC of 0.81. The logistic regression is well-calibrated with Brier scores ranging from 0.06-0.11 across the five groups; we note better calibration is correlated with lower prediction error.

We report cost and discrimination level in terms of generalized zero-one loss (Pleiss et al., 2017). Using an ANOVA test (Fisher, 1925) with p<0.001p<0.001, we reject the null hypothesis that loss is the same among all five groups. To map the 95% confidence intervals, we perform pairwise comparisons of means using Tukey’s range test (Tukey, 1949) across 5-fold cross-validation. As seen in Figure 3(a), patients in the Other and Hispanic groups have the highest and lowest generalized zero-one loss, respectively, with relatively few overlapping intervals. Notably, the largest ethnic group (White) does not have the best accuracy, whereas smaller ethnic groups tend towards extremes. While racial groups differ in hospital mortality base rates (Table 1 in the Supplementary material), Hispanic (10.3%) and Black (10.9%) patients have very different error rates despite similar base rates.

To better understand the discrimination induced by our model, we explore the effect of changing training set size. To this end, we repeatedly subsample and split the data, holding out at least 20% of the full data for testing. In Figure 3(b), we show loss averaged over 50 trials of training a logistic regression on increasingly larger training sets; estimated inverse power-law curves show good fits. We see that some pairwise differences in loss decrease with additional training data.

Next, we identify clusters for which the difference in prediction errors between protected groups is large. We learn a topic model with k=50k=50 topics generated using Latent Dirichlet Allocation (Blei et al., 2003). Topics are concatenated into an n×kn\times k matrix QQ where qicq_{ic} designates the proportion of topic c∈[k]c\in[k] in note i∈[n]i\in[n]. Following prior work on enrichment of topics in clinical notes (Marlin et al., 2012; Ghassemi et al., 2014), we estimate the probability of patient mortality YY given a topic cc as p^(Y∣C=c):=(∑i=1nyiqic)/(∑i=1nqic)\hat{p}(Y|C=c):=(\sum_{i=1}^{n}y_{i}q_{ic})/(\sum_{i=1}^{n}q_{ic}) where yiy_{i} is the hospital mortality of patient ii. We compare relative error rates given protected group and topic using binary predicted mortality y^i\hat{y}_{i}, actual mortality yiy_{i}, and group aia_{i} for patient ii through

which follows using substitution and conditioning on AA. These error rates were computed using a logistic regression with L1 regularization using an 80/20 train-test split over 50 trials. While many topics have consistent error rates across groups, some topics (e.g. cardiac patients or cancer patients as shown in Figure 3(c)) have large differences in error rates across groups. We include more detailed topic descriptions in the supplementary material. Once we have identified a subpopulation with particularly high error, for example cancer patients, we can consider collecting more features or collecting more data from the same data distribution. We find that error rates differ between 0.120.12 and 0.300.30 across protected groups of cancer patients, and between 0.050.05 and 0.200.20 for cardiac patients.

3 Book review ratings

In the supplementary material, we study prediction of book review ratings from review texts (Gnanesh, 2017). The protected attribute was chosen to be the gender of the author as determined from Wikipedia. In the dataset, the difference in mean-squared error Γ\mbox\scmse(Y^)\Gamma^{\mbox{{\sc mse}}}(\hat{Y}) has 95%-confidence interval 0.136±0.0480.136\pm 0.048 with \mboxMSEM=0.224\mbox{MSE}_{M}=0.224 for reviews for male authors and \mboxMSEF=0.358\mbox{MSE}_{F}=0.358. Strikingly, our findings suggest that Γ\mbox\scmse(Y^)\Gamma^{\mbox{{\sc mse}}}(\hat{Y}) may be completely eliminated by additional targeted sampling of the less represented gender.

Discussion

We identify that existing approaches for reducing discrimination induced by prediction errors may be unethical or impractical to apply in settings where predictive accuracy is critical, such as in healthcare or criminal justice. As an alternative, we propose a procedure for analyzing the different sources contributing to discrimination. Decomposing well-known definitions of cost-based fairness criteria in terms of differences in bias, variance, and noise, we suggest methods for reducing each term through model choice or additional training data collection. Case studies on three real-world datasets confirm that collection of additional samples is often sufficient to improve fairness, and that existing post-hoc methods for reducing discrimination may unnecessarily sacrifice predictive accuracy when other solutions are available.

Looking forward, we can see several avenues for future research. In this work, we argue that identifying clusters or subpopulations with high predictive disparity would allow for more targeted ways to reduce discrimination. We encourage future research to dig deeper into the question of local or context-specific unfairness in general, and into algorithms for addressing it. Additionally, extending our analysis to intersectional fairness (Buolamwini & Gebru, 2018; Hébert-Johnson et al., 2017), e.g. looking at both gender and race or all subdivisions, would provide more nuanced grappling with unfairness. Finally, additional data collection to improve the model may cause unexpected delayed impacts (Liu et al., 2018) and negative feedback loops (Ensign et al., 2017) as a result of distributional shifts in the data. More broadly, we believe that the study of fairness in non-stationary populations is an interesting direction to pursue.

Acknowledgements

The authors would like to thank Yoni Halpern and Hunter Lang for helpful comments, and Zeshan Hussain for clinical guidance. This work was partially supported by Office of Naval Research Award No. N00014-17-1-2791 and NSF CAREER award #1350965.

References

Appendix A Testing for significant discrimination

with ma=∑i=1m\mathds1[ai=a]m_{a}=\sum_{i=1}^{m}\mathds{1}[a_{i}=a], may be used to form an estimate ΓS(Y^)=∣γ0S(Y^)−γ1S(Y^)∣\Gamma^{S}(\hat{Y})=|\gamma^{S}_{0}(\hat{Y})-\gamma^{S}_{1}(\hat{Y})|. By the central limit theorem, for sufficiently large mm, γaS(Y^)∼N(μa,σa2/ma)\gamma^{S}_{a}(\hat{Y})\sim\mathcal{N}(\mu_{a},\sigma_{a}^{2}/m_{a}) and (γ0S−γ1S)∼N(μ0−μ1,σ02/m0+σ12/m1)(\gamma^{S}_{0}-\gamma^{S}_{1})\sim\mathcal{N}(\mu_{0}-\mu_{1},\sigma_{0}^{2}/m_{0}+\sigma_{1}^{2}/m_{1}). As a result, the significance of ΓS(Y^)\Gamma^{S}(\hat{Y}) can be tested with a two-tailed z-test or using the test of Woodworth et al. (2017). If sample sizes are small and the target binary, more appropriate tests are available (Brown et al., 2001). In addition, we will often want to compare the discrimination levels Γ(Y^),Γ(Y^′)\Gamma(\hat{Y}),\Gamma(\hat{Y}^{\prime}) of predictors Y^,Y^′\hat{Y},\hat{Y}^{\prime}, resulting from different learning algorithms, models, or sets of observed variables. The random variable ∣ΓS(Y^)−ΓS(Y^′)∣|\Gamma^{S}(\hat{Y})-\Gamma^{S}(\hat{Y}^{\prime})| is not Normal distributed, but is an absolute difference of folded-normal variables. However, for any α∈{−1,1}\alpha\in\{-1,1\}, Zα:=α(γ0S(Y^)−γ1S(Y^))−(γ0S(Y^′)−γ1S(Y^′))Z_{\alpha}:=\alpha(\gamma_{0}^{S}(\hat{Y})-\gamma_{1}^{S}(\hat{Y}))-(\gamma_{0}^{S}(\hat{Y}^{\prime})-\gamma_{1}^{S}(\hat{Y}^{\prime})) is Normal distributed. Further, by enumerating the signs of (γ0S(Y^)−γ1S(Y^))(\gamma_{0}^{S}(\hat{Y})-\gamma_{1}^{S}(\hat{Y})) and (γ0S(Y^′)−γ1S(Y^′))(\gamma_{0}^{S}(\hat{Y}^{\prime})-\gamma_{1}^{S}(\hat{Y}^{\prime})), we can show that ∣ΓS−ΓS′∣=min⁡α∈{−1,1}∣Zα∣|\Gamma^{S}-{\Gamma^{S}}^{\prime}|=\min_{\alpha\in\{-1,1\}}|Z_{\alpha}|. As a result, to reject the null hypothesis H0:Γ=Γ′H_{0}:\Gamma=\Gamma^{\prime}, we require that the observed values of both Z−1Z_{-1} and Z1Z_{1} are unlikely under H0H_{0} at given significance.

Appendix B Additional experimental details

Adult Income Dataset (Lichman, 2013). The dataset has 32,561 instances. The target variable indicates whether or not income is larger than 50K dollars, and the sensitive feature is Gender. Each data object is described by 14 attributes which include 8 categorical and 6 numerical attributes. We quantize the categorical attributes into binary features and keep the continuous attributes, which results in 105 features for prediction. We note the label imbalance as 30% of male adults have income over 50K whereas only 10% of female adults have income over 50K. Additionally 24% of all adults have salary over 50K, and the dataset has 33% women and 67% men.

Goodreads reviews Gnanesh (2017), only included in the supplemental materials. The dataset was collected from Oct 12, 2017 to Oct 21, 2017 and has 13,244 reviews. The target variable is the rating of the review, and the sensitive feature is the gender of the author. Genders were gathered by querying Wikipedia and using pronoun inference, and the dataset is a subset of the original Goodreads dataset because it only includes reviews about the top 100 most popular authors. Each datum consists of the review text, vectorized using Tf-Idf. The review scores occurred with counts 578, 2606, 4544, 5516 for scores 1,3,4, and 5 respectively. Books by women authors and men authors had average scores of 4.088 and 4.092 respectively.

MIMIC-III dataset (Johnson et al., 2016). The dataset includes 25,879 adult patients admitted to the intensive care unit of the Beth Israel Deaconess Medical Center in downtown Boston. Clinical notes from the first 48 hours are used to predict hospital mortality after 48 hours. Of all adult patients, 13.8% patients died in the hospital. We are interested in the difference in performance between the five self-reported ethnic groups and following data sizes and hospital mortality rates.

B.2 Synthetic experiments

To illustrate the effect of training set size and model choice, and the validity of the power-law learning curve assumption, we conduct a small synthetic experiment in which p(A=1)=0.3p(A=1)=0.3 and X∼N(μA,σA2)X\sim\mathcal{N}(\mu_{A},\sigma_{A}^{2}) with μ0=0,μ1=1,σ0=1,σ1=2\mu_{0}=0,\mu_{1}=1,\sigma_{0}=1,\sigma_{1}=2. The outcome is a quadratic function with heteroskedastic noise, Y=2X2−2X+.1+ϵX2Y=2X^{2}-2X+.1+\epsilon X^{2}, with ϵ∼N(0,1)\epsilon\sim\mathcal{N}(0,1). We fit decision tree, random forest and ridge regressors of the outcome YY to XX using default parameters in the implementation in scikit-learn (Pedregosa et al., 2011), but limiting the decision tree to depth T≤4T\leq 4. The size of the training set is varied exponentially between 252^{5} and 2172^{17} samples, and at each size, trees are fit 200 times. In Figure 4, we show the resulting learning curves γ‾0(Y^,n)\overline{\gamma}_{0}(\hat{Y},n) and γ‾1(Y^,n)\overline{\gamma}_{1}(\hat{Y},n) as well as fits of Pow3 curves to them. Shown in dotted lines are extrapolations of learning curves from different sample sizes, illustrating the difficulty of estimating the intercepts δa\delta_{a} and the Bayes error with high accuracy.

B.3 Book review ratings

Sentiment and rating prediction from text reveal quantitative insights from unstructured data; however deficiencies in algorithmic prediction may incorrectly represent populations. Using a dataset of 13,244 reviews collected from Goodreads (Gnanesh, 2017) with inferred author sex scraped from Wikipedia, we seek to predict the review rating based on the review text. We use as features the Tf-Idf statistics of the 5000 most frequent words. Our protected attribute is gender of the author of the book, and the target attribute is the rating (1-5) of the review. The data is heavily imbalanced, with 18% reviews about female authors versus 82% reviews about male authors.

We observe statistically significant levels of discrimination with respect to mean squared error (MSE) with linear regression, decision trees and random forests. Using a random forest and training on 80% of the dataset and testing on 20%, we find that our Γ\mbox\scmse(Y^)\Gamma^{\mbox{{\sc mse}}}(\hat{Y}) has 95%-confidence interval 0.136±0.0480.136\pm 0.048 with \mboxMSEM=0.224\mbox{MSE}_{M}=0.224 for reviews for male authors and \mboxMSEF=0.358\mbox{MSE}_{F}=0.358 for reviews for female authors using a difference in means statistical test. Results were found after hyperparameter turning for each training set size and taking an average over 50 trials. We observe similar patterns with linear regression and decision trees.

To estimate the impact of additional training data, we evaluate the effect of varying training set size nn on predictive performance and discrimination. Through repeated sample spitting, we train a random forest on increasing training set sizes, reserving at least 20% of the dataset for testing. In Figure 5(a), additional training data lowers \mboxMSEF\mbox{MSE}_{F} and \mboxMSEM\mbox{MSE}_{M}, fitting an inverse power-law. Based on the intercept terms of the extrapolated power-laws (δM=0.0011\delta_{M}=0.0011 for reviews with male authors and δF=0.0013\delta_{F}=0.0013 for reviews with female authors), we may expect that Γ‾\overline{\Gamma} can be explained more by differences in bias and variance than by noise since our estimated difference in noise ∣δF−δM∣≈0|\delta_{F}-\delta_{M}|\approx 0.

In order to further measure the effect of collecting more samples, we analyze a one-sized increase in training data. Because of the initial skew of author genders in the dataset, we vary the number of reviews for female authors, creating a shift in populations in the training data. We fix the training set size of reviews for male authors at nM=1939n_{M}=1939, which represents the size of the full data for female authors NFN_{F}, reserving 20% of the dataset as test data. We then vary the training data size for female authors nFn_{F} such that the ratio nF/nMn_{F}/n_{M} varies evenly between 0.1 to 1.0. Using a linear regression in Figure 5(b), we see that as the ratio nF/nMn_{F}/n_{M} increases, \mboxMSEF\mbox{MSE}_{F} decreases far below \mboxMSEM\mbox{MSE}_{M} and far below our best reported MSE of the random forest on the full dataset. This suggests that shifting the data ratio and collecting more data for the under-represented group can adapt our model to reduce discrimination.

B.4 Clinical notes

Here we include additional details about topic modeling. Topics were sampled using Markov Chain Monte Carlo after 2,500 iterations. We present the topics with highest and lowest variance in error rates among groups in Table 2. Error rates were computed using a logistic regression with L1 regularization over 10,000 TF-IDF features using 80/20 training and testing data split over 50 trials. Based on the most representative words for each topic, we can infer topic descriptions, for example cancer patients for topic 48 and cardiac patients for topic 45.

We identified patients with notes corresponding to topic 48, corresponding to cancer, as a subpopulation with large differences in errors between groups. By varying the training size while saving 20% of the data for testing, we estimate that more data would not be beneficial for decreasing error (see Figure 6(c)). The mean over 50 trials is reported with hyperparameters chosen for each training size. Instead, we recommend collecting more features (e.g. structured data from lab results, more detailed patient history) as a way of improving error for this subpopulation.

Furthermore, we compute the 95% confidence intervals for false positive and false negative rates for a logistic regression with L1 regularization in Figure 6(a) and Figure 6(b).

Appendix C Exploring model choice

If a difference in bias is the dominating source of discrimination between groups, changing the class of models under consideration could have a large impact on discrimination.Consider for example Figure 1c in which the true outcome has higher complexity in regions where one protected group is more densely distributed than the other. Increasing model capacity in such cases, or exploring other model classes of similar capacity, may reduce as long as the bias-variance trade-off is beneficial. Bias is not identifiable in general, as this requires estimation or bounding of noise components NaN_{a}, or an assumption that they are equal, N‾0=N‾1\overline{N}_{0}=\overline{N}_{1}, or negligible, N‾a≈0\overline{N}_{a}\approx 0. However, as noise is in-dependent of model choice, a difference in bias of different models is identifiable even if the noise is not known, provided that the variance is estimated. With ΔB‾=B‾0−B‾1\Delta\overline{B}=\overline{B}_{0}-\overline{B}_{1}, and ΔV‾=V‾0−V‾1\Delta\overline{V}=\overline{V}_{0}-\overline{V}_{1}, and Y^,Y^′\hat{Y},\hat{Y}^{\prime}, two predictors for comparison, we may test the hypothesis H0:ΔB‾(Y^)+ΔV‾(Y^)=ΔB‾(Y^′)+ΔV‾(Y^′)H_{0}:\Delta\overline{B}(\hat{Y})+\Delta\overline{V}(\hat{Y})=\Delta\overline{B}(\hat{Y}^{\prime})+\Delta\overline{V}(\hat{Y}^{\prime}).

Appendix D Regression with homoskedastic noise

By definition of N‾\overline{N}, we can state the following result.

Homoskedastic noise, i.e. ∀x∈X,a∈A:N(x,a)=N\forall x\in\mathcal{X},a\in\mathcal{A}:N(x,a)=N, does not contribute to discrimination level Γ‾\overline{\Gamma} under the squared loss L(y,y′)=(y−y′)2L(y,y^{\prime})=(y-y^{\prime})^{2}.

In contrast, for the zero-one loss and class-specific variants, the expected noise terms N‾a\overline{N}_{a} do not cancel, as they depend on the factor cn(x,a)c_{n}(x,a).

Appendix E Bias-variance decomposition. Proof of Theorem 1.

We begin by showing that L(y,Y^D(x,a))=L(y^∗(x,a),Y^D(x,a))+c0(x,a)L(y,y^∗(x,a))L(y,\hat{Y}_{D}(x,a))=L(\hat{y}^{*}(x,a),\hat{Y}_{D}(x,a))+c_{0}(x,a)L(y,\hat{y}^{*}(x,a)) with c0(x,a)={+1,\mboxify^∗(x,a)=Y^D(x,a);−1,\mboxotherwise}c_{0}(x,a)=\{+1,\mbox{ if }\hat{y}^{*}(x,a)=\hat{Y}_{D}(x,a);-1,\mbox{otherwise}\}.

As the above should be zero for all options, this implies that c0=2∗\mathds1[Y^D(x,a)=y^∗(x,a)]−1c_{0}=2*\mathds{1}[\hat{Y}_{D}(x,a)=\hat{y}^{*}(x,a)]-1.

We have that if y^m(x,a)≠y^∗(x,a)\hat{y}^{m}(x,a)\neq\hat{y}^{*}(x,a),

A similar calculation for the case where y^m(x,a)=y^∗(x,a)\hat{y}^{m}(x,a)=\hat{y}^{*}(x,a) yields the claim.

Since datasets are drawn independently of the protected attribute AA,

and an analogous results hold for class-specific losses, Theorem 1 follows from lemmas A1–A2.

Appendix F Difference between power law curves

Let f(x)=ax−b+cf(x)=ax^{-b}+c and g(x)=dx−e+hg(x)=dx^{-e}+h. Then d(x)=f(x)−g(x)d(x)=f(x)-g(x) has at most 2 local minima. We see this by re-writing d(x)d(x)

Since f(x)f(x) has a single critical point (for x>0x>0), f(x)f(x) can switch signs at most twice. The curves f(x)=100x2+1f(x)=\frac{100}{x^{2}}+1 and g(x)=50xg(x)=\frac{50}{x} intersect twice on x∈[0,∞]x\in[0,\infty]. If b=eb=e, d(x)d(x) has a single zero,