This project implements the paper “Robustness implies Fairness in Casual Algorithmic Recourse” using the R language.
This study explores the concept of individual fairness and adversarial robustness in causal algorithmic recourse and addresses the challenge of achieving both. To resolve the challenges, we propose a new framework for defining adversarially robust recourse.
The new setting views the protected feature as a pseudometric and demonstrates that individual fairness is a special case of adversarial robustness. Finally, we introduce the fair robust recourse problem to achieve both desirable properties and show how it can be satisfied both theoretically and empirically.
If you find it useful, please consider citing:
@misc{https://doi.org/10.48550/arxiv.2302.03465,
doi = {10.48550/ARXIV.2302.03465},
url = {https://arxiv.org/abs/2302.03465},
author = {Ehyaei, Ahmad-Reza and Karimi, Amir-Hossein and
Schölkopf, Bernhard and Maghsudi, Setareh},
title = {Robustness Implies Fairness in Casual Algorithmic Recourse},
publisher = {arXiv},
year = {2023},
}
In our experiments, we validate our claims through experiments and assess the effects of different recourse definitions on individual fairness. At first, we perform numerical simulations on various models and classifiers. Next, we apply our findings to both a real-world and semi-synthetic dataset as a case study. The codes and instructions for reproducing our experiments are available at Github.
Since the recourse actions require knowledge of the underlying SCM, we
begin by defining two linear and non-linear ANM models for the SCM. In
our experiments, we utilize two non-protected continuous features
For the non-linear SCM (ANM) the following structural equations:
where utils/scm_models.R
.
To add the ground truth label, we consider both linear and non-linear
functions in the form of
The file named utils/labels.R
holds the label functions. For each
model, we generate 10,000 samples through utilizing the structural
equations of the SCMs. The following presents two examples of data
generation.
For each dataset, we split the samples into 80% for training and 20% for
testing. Then, we train a logistic regression (LR), support vector
machine (SVM), and gradient boosting machine (GBM) using all features or
just the non-protected features
- GLM: use
alpha = seq(0, 1, 0.1)
withlambda_search = TRUE
. - SVM: set
gamma = 0.01
,rank_ratio = 0.1
, and use a Gaussian kernel. - GBM: search for the optimal model among the following
parameters:
learn_rate = c(0.01, 0.1)
,max_depth = c(3, 5, 9)
, andsample_rate = c(0.8, 1.0)
.
To find the classifier’s scripts see utils/models.R
. The decision
boundary for the two models is displayed in the figures below.
We consider discrete and trivial pseudometric (
Since the main objective of this work is not to provide an algorithmic
solution for causal recourse, we use a brute-force search to find the
optimal action. The function for calculating recourse and robust
recourse can be found in the utils/models.R
file. In the below the
adversarial recourse in some simulations, with
We use the Adult Income Demographic dataset (ACSIncome), an updated
version of the UCI Adult dataset , which contains over 195,000 records
from California state in 2018. The data was obtained by using the
Folktables Python package . To fetch data, we used the
utils/fetch_adult_data.py
script.
The data processing and modeling procedures adopted in this study are consistent with those reported in Nabi and Shpitser work.
Furthermore, we consider a semi-synthetic SCM proposed by Karimi et al that is based on a loan approval scenario. The data aims to reflect the intuitive relationships between variables in a practical loan approval process.
This semi-synthetic data consists of gender, age, education, loan amount, duration, income, and saving variables with the following structural equations and exogenous distributions:
The labels
[1] Dominguez-Olmedo, Ricardo, Amir H. Karimi, and Bernhard Schölkopf. “On the adversarial robustness of causal algorithmic recourse.” International Conference on Machine Learning. PMLR, 2022.
[2] von Kügelgen, Julius, et al. “On the fairness of causal algorithmic recourse.” Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 36. No. 9. 2022.
[3] Karimi, Amir-Hossein, Bernhard Schölkopf, and Isabel Valera. “Algorithmic recourse: from counterfactual explanations to interventions.” Proceedings of the 2021 ACM conference on fairness, accountability, and transparency. 2021.
[4] Glymour, Madelyn, Judea Pearl, and Nicholas P. Jewell. Causal inference in statistics: A primer. John Wiley & Sons, 2016.
[5] Peters, Jonas, Dominik Janzing, and Bernhard Schölkopf. Elements of causal inference: foundations and learning algorithms. The MIT Press, 2017.