Two-stage Algorithm for Fairness-aware Machine Learning

Junpei Komiyama, Hajime ShimaoarXiv 2017 · OpenReview

Abstract

Algorithmic decision making process now affects many aspects of our lives. Standard tools for machine learning, such as classification and regression, are subject to the bias in data, and thus direct application of such off-the-shelf tools could lead to a specific group being unfairly discriminated. Removing sensitive attributes of data does not solve this problem because a disparate impact can arise when non-sensitive attributes and sensitive attributes are correlated. Here, we study a fair machine learning algorithm that avoids such a disparate impact when making a decision. Inspired by the two-stage least squares method that is widely used in the field of economics, we propose a two-stage algorithm that removes bias in the training data. The proposed algorithm is conceptually simple. Unlike most of existing fair algorithms that are designed for classification tasks, the proposed method is able to (i) deal with regression tasks, (ii) combine explanatory attributes to remove reverse discrimination, and (iii) deal with numerical sensitive attributes. The performance and fairness of the proposed algorithm are evaluated in simulations with synthetic and real-world datasets.

Introduction

Machine learning models often inherit societal biases present in their training data. Simply removing "sensitive attributes" (e.g., race, gender, or religion) is rarely enough because other features—like zip code or education level—are often highly correlated with them. This leads to disparate impact, where a model unintentionally discriminates against specific groups.

The authors identify three major gaps in existing fairness-aware algorithms that the proposed Two-stage Discrimination Remover (2SDR) aims to fill:

  1. Task Limitation: Most existing methods are built for classification and cannot handle regression tasks (predicting continuous values like salary).
  2. Reverse Discrimination: Blindly equalizing outcomes can ignore "justifiable" differences. For example, if one group in a dataset works fewer hours on average, a fair model should account for "hours worked" to avoid unfairly penalizing the other group.
  3. Attribute Constraints: Many models only work with binary sensitive attributes and struggle with numerical ones, such as age.
Table 1: Comparison of 2SDR against existing fair ML algorithms, highlighting its ability to handle regression and numeric sensitive attributes.

The 2SDR Algorithm

The proposed 2SDR algorithm is a two-stage approach inspired by the Two-Stage Least Squares (2SLS) method used in econometrics to handle observational bias.

  • Stage 1 (Data Transformation): The algorithm takes the non-sensitive attributes ($X$) and regresses them against the sensitive attributes ($S$). It then calculates the residuals ($U$)—the part of the data that cannot be explained by the sensitive attributes. This "scrubbed" version of the data is essentially a fair representation.
  • Stage 2 (Prediction): These residuals ($U$), along with any "explanatory attributes" ($Z$) that are deemed fair to use (like "hours worked"), are fed into a standard, off-the-shelf linear regressor or classifier.

This approach is a "minimum transformation" method; it preserves as much of the original data structure as possible while ensuring the final predictions are linearly independent of the sensitive attributes.

Experimental Evaluation

The researchers evaluated 2SDR using both synthetic simulations and five diverse real-world datasets:

  • Communities and Crime (C&C): Predicting crime rates (Regression).
  • Adult (Census Income): Predicting if income exceeds $50k (Classification).
  • German Credit: Classifying credit risk (Classification).
  • Compas: Predicting criminal recidivism (Classification).
  • LSAC: Predicting law school bar exam passage (Classification).

Key Insights and Results

Handling Heteroskedasticity

Sensitive groups often have different data distributions (variances). For example, in the C&C dataset, the distribution of unemployment rates differs significantly between different community types. 2SDR is designed to remain fair even under these complex conditions.

Figure 1: Histogram showing how distributions of unemployment rates differ across sensitive groups in the Communities and Crime dataset.

Performance Highlights

  • Compliance with the 80%-Rule: In classification tasks (Adult, German, Compas), 2SDR consistently met the legal "80%-rule" for fairness, whereas standard Ordinary Least Squares (OLS) models failed significantly.
  • Bias Reduction in Regression: On the C&C dataset, 2SDR reduced the correlation between predictions and sensitive attributes from 0.50 down to 0.04, with only a minor increase in Root Mean Square Error (RMSE).
  • Fairness vs. Accuracy: By including "explanatory attributes" ($Z$), the model can significantly improve accuracy without sacrificing fairness. This allows the model to distinguish between "unfair bias" and "justifiable variance."

Conclusion

2SDR provides a versatile framework for fairness-aware machine learning. Because it is a preprocessing-style algorithm, it can be paired with various linear models, making it highly adaptable for practical engineering applications. While the current fairness guarantees are strongest for linear models, future work will explore non-linear transformations and alternative fairness criteria such as "equalized odds."

Summary updated

Abstract

Algorithmic decision making process now affects many aspects of our lives. Standard tools for machine learning, such as classification and regression, are subject to the bias in data, and thus direct application of such off-the-shelf tools could lead to a specific group being unfairly discriminated. Removing sensitive attributes of data does not solve this problem because a \textit{disparate impact} can arise when non-sensitive attributes and sensitive attributes are correlated. Here, we study a fair machine learning algorithm that avoids such a disparate impact when making a decision. Inspired by the two-stage least squares method that is widely used in the field of economics, we propose a two-stage algorithm that removes bias in the training data. The proposed algorithm is conceptually simple. Unlike most of existing fair algorithms that are designed for classification tasks, the proposed method is able to (i) deal with regression tasks, (ii) combine explanatory attributes to remove reverse discrimination, and (iii) deal with numerical sensitive attributes. The performance and fairness of the proposed algorithm are evaluated in simulations with synthetic and real-world datasets.
BibTeX
@misc{komiyama2017two,
  author = {Junpei Komiyama and Hajime Shimao},
  title = {{Two-stage Algorithm for Fairness-aware Machine Learning}},
  year = {2017},
  eprint = {1710.04924},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1710.04924},
}
Figure