# On Learning and Testing of Counterfactual Fairness through Data Preprocessing

arXiv: https://arxiv.org/abs/2202.12440 · HTML: https://mlsanity.com/paper/2202.12440/

## Key facts

- Cited by 6 papers in the map (data through 14 Oct 2026).
- Builds on 15 of its 39 references that are in the map.
- First posted on arXiv 25 Feb 2022.

## Builds on (most cited first, 15 of 15)

- [Equality of Opportunity in Supervised Learning](https://mlsanity.com/paper/1610.02413/) (2016)
- [Counterfactual Fairness](https://mlsanity.com/paper/1703.06856/) (2017)
- [Fair prediction with disparate impact: A study of bias in recidivism prediction instruments](https://mlsanity.com/paper/1610.07524/) (2016)
- [Mitigating Unwanted Biases with Adversarial Learning](https://mlsanity.com/paper/1801.07593/) (2018)
- [Avoiding Discrimination through Causal Reasoning](https://mlsanity.com/paper/1706.02744/) (2017)
- [Censoring Representations with an Adversary](https://mlsanity.com/paper/1511.05897/) (2015)
- [Fair Inference On Outcomes](https://mlsanity.com/paper/1705.10378/) (2017)
- [Conditional Learning of Fair Representations](https://mlsanity.com/paper/1910.07162/) (2019)
- [A causal framework for discovering and removing direct and indirect discrimination](https://mlsanity.com/paper/1611.07509/) (2016)
- [PC-Fairness: A Unified Framework for Measuring Causality-based Fairness](https://mlsanity.com/paper/1910.12586/) (2019)
- [The Use and Misuse of Counterfactuals in Ethical Machine Learning](https://mlsanity.com/paper/2102.05085/) (2021)
- [Fairness in Algorithmic Decision Making: An Excursion Through the Lens of Causality](https://mlsanity.com/paper/1903.11719/) (2019)
- [Equal Opportunity and Affirmative Action via Counterfactual Predictions](https://mlsanity.com/paper/1905.10870/) (2019)
- [Avoiding Disparity Amplification under Different Worldviews](https://mlsanity.com/paper/1808.08619/) (2018)
- [Wrong side of the tracks: Big Data and Protected Categories](https://mlsanity.com/paper/1412.4643/) (2014)

## Built on by (most cited first, 6 of 6)

- [Counterfactual Fairness by Combining Factual and Counterfactual Predictions](https://mlsanity.com/paper/2409.01977/) (2024)
- [Counterfactually Fair Reinforcement Learning via Sequential Data Preprocessing](https://mlsanity.com/paper/2501.06366/) (2025)
- [RISE: Robust Individualized Decision Learning with Sensitive Variables](https://mlsanity.com/paper/2211.06569/) (2022)
- [Counterfactual Fairness through Transforming Data Orthogonal to Bias](https://mlsanity.com/paper/2403.17852/) (2024)
- [Measuring the Driving Forces of Predictive Performance: Application to Credit Scoring](https://mlsanity.com/paper/2212.05866/) (2022)
- [Counterfactually Safe Reinforcement Learning](https://mlsanity.com/paper/2605.25114/) (2026)

## Abstract (arXiv)

Machine learning has become more important in real-life decision-making but people are concerned about the ethical problems it may bring when used improperly. Recent work brings the discussion of machine learning fairness into the causal framework and elaborates on the concept of Counterfactual Fairness. In this paper, we develop the Fair Learning through dAta Preprocessing (FLAP) algorithm to learn counterfactually fair decisions from biased training data and formalize the conditions where different data preprocessing procedures should be used to guarantee counterfactual fairness. We also show that Counterfactual Fairness is equivalent to the conditional independence of the decisions and the sensitive attributes given the processed non-sensitive attributes, which enables us to detect discrimination in the original decision using the processed data. The performance of our algorithm is illustrated using simulated data and real-world applications.
