Optimal Transport on Categorical Data for Counterfactuals using Compositional Data and Dirichlet Transport
Agathe Fernandes Machado, Arthur Charpentier, Ewen Gallic
TL;DR
This paper tackles counterfactual analysis for categorical data by transforming categories into compositional data on the simplex and performing optimal transport directly within this domain. It introduces two parallel routes: (i) a Gaussian mapping in Euclidean coordinates after classical simplex transforms (ALR/CLR/ILR) and (ii) Dirichlet transport with a cost that respects the simplex geometry, enabling a push-forward between measures on $\mathcal{S}_d$. Theoretical results establish the existence and structure of OT maps on the simplex, along with practical matching algorithms and interpolation schemes, and the approach is demonstrated on German Credit and Adult datasets. While offering a principled framework for counterfactuals with categorical data, the paper also notes computational intensity and reliance on well-calibrated probabilistic predictors as key limitations.
Abstract
Recently, optimal transport-based approaches have gained attention for deriving counterfactuals, e.g., to quantify algorithmic discrimination. However, in the general multivariate setting, these methods are often opaque and difficult to interpret. To address this, alternative methodologies have been proposed, using causal graphs combined with iterative quantile regressions (Plečko and Meinshausen (2020)) or sequential transport (Fernandes Machado et al. (2025)) to examine fairness at the individual level, often referred to as ``counterfactual fairness.'' Despite these advancements, transporting categorical variables remains a significant challenge in practical applications with real datasets. In this paper, we propose a novel approach to address this issue. Our method involves (1) converting categorical variables into compositional data and (2) transporting these compositions within the probabilistic simplex of $\mathbb{R}^d$. We demonstrate the applicability and effectiveness of this approach through an illustration on real-world data, and discuss limitations.
