This repository contains the implementation of the paper A Two-Stage Algorithm for Cost-Efficient Multi-instance Counterfactual Explanations by André Artelt and Andreas Gregoriades
Counterfactual explanations constitute among the most popular methods for analyzing the predictions of black-box systems since they can recommend cost-efficient and actionable changes to the input to turn an undesired system's output into a desired output. While most existing methods explain a single instance only, several real-world use cases exist, such as customer satisfaction, where one is interested in a single counterfactual explanation that simultaneously explains multiple instances.
In this work, we propose a flexible two-stage algorithm for finding groups of instances along with cost-efficient multi-instance counterfactual explanations. In particular, the aspect of finding such groups has been mostly ignored in the literature so far.
Can be found next to Lemma 1 in paper.pdf.
The data sets used in this work are stored in Implementation/data/. Note that many of these .csv files in the data folder were downloaded from https://github.com/tailequy/fairness_dataset/tree/main/experiments/data.
All experiments are implemented in Implementation/experiments.py.
Our proposed evolutionary algorithm for computing multi-instance counterfactual explanations is implemented in Implementation/ours. The methods proposed by Warren et al. and Kanamori et al. are implemented in Implementation/warren and Implementation/kanamori which was taken from their repository -- note that for the method proposed by Kanamori et al. the IBM CPLEX solver is required.
- Python 3.8
- Packages as listed in Implementation/REQUIREMENTS.txt
MIT license - See LICENSE.
Accepted in the late-breaking work track at The 2nd World Conference on eXplainable Artificial Intelligence (xAI-2024).
You can cite the version on arXiv until proceedings are available.