Sequential Conditional (Marginally Optimal) Transport on Probabilistic Graphs for Interpretable Counterfactual Fairness

fairness
optimal transport
causality
paper
Arthur
Agathe
Author

Ewen Gallic

Published

December 9, 2024

Our paper titled Sequential Conditional (Marginally Optimal) Transport on Probabilistic Graphs for Interpretable Counterfactual Fairness, co-authored with Agathe Fernandes Machado, Arthur Charpentier, has been accepted for publication in the proceedings of the 39th Annual AAAI Conference on Artificial Intelligence.

The working paper is available here:

The poster that Agathe will be presenting in Philadelphia is available here:

Abstract

In this paper, we link two existing approaches to derive counterfactuals: adaptations based on a causal graph, as suggested in Plečko and Meinshausen (2020) and optimal transport, as in De Lara et al. (2024). We extend “Knothe’s rearrangement” Bonnotte (2013) and “triangular transport” Zech and Marzouk (2022) to probabilistic graphical models, and use this counterfactual approach, referred to as sequential transport, to discuss fairness at the individual level. After establishing the theoretical foundations of the proposed method, we demonstrate its application through numerical experiments on both synthetic and real datasets.

A replication ebook is available on Agathe’ Github:

The corresponding R codes are also available on Agathe’s Github:

We also prepared some slides:

1 Small Package

We defined some of the functions used in this ebook in a small R package, {seqtransfairness}, which can be downloaded from the github repository associated with the paper.

To install the package:

remotes::install_github(
  repo = "fer-agathe/sequential_transport", subdir = "seqtransfairness"
)

Then, the package can be loaded as follows:

library(seqtransfairness)

Alternatively, if you have downloaded the Github repository, you will find a copy of the package in the seqtransfairness folder. To load the package, the load_all() function from R package {devtools} can be used. This is what is done inside the scripts.

The functions, placed in the seqtransfairness/R/ folder are documented in the package. Hence, once the package is loaded with the load_all() function, the help pages can be accessed (e.g., by typing in the R console: ?seqtransfairness, or ?seq_trans).

# Simulate data
sim_dat <- simul_dataset()
# Causal graph:
variables <- c("S", "X1", "X2", "Y")
adj <- matrix(
  # S  X1 X2 Y
  c(0, 1, 1, 1,# S
    0, 0, 1, 1,# X1
    0, 0, 0, 1,# X2
    0, 0, 0, 0  # Y
  ),
  ncol = length(variables),
  dimnames = rep(list(variables), 2),
  byrow = TRUE
)
# To visualize the causal graph:
# causal_graph <- fairadapt::graphModel(adj)
# plot(causal_graph)

# Sequential transport according to the causal graph
transported <- seq_trans(data = sim_dat, adj = adj, s = "S", S_0 = 0, y = "Y")
transported
# Transported values from S=0 to S=1, using the causal graph.
predict(transported)
# Transport of two new observations
new_obs <- data.frame(X1 = c(-2, -1), X2 = c(-1, -2), S = c(0, 0))
predict(transported, newdata = new_obs, data = sim_dat)
Figure 1: Our poster.