counterfactuals : An R Package for Counterfactual Explanation Methods
Open Access
- 1 January 2025
- journal article
- Published by Foundation for Open Access Statistic in Journal of Statistical Software
- Vol. 115 (9) , 1-48
Abstract
Counterfactual explanation methods provide information on how feature values of individual observations must be changed to obtain a desired prediction. Despite the increasing amount of proposed methods in research, only a few implementations exist, whose interfaces and requirements vary widely. In this work, we introduce the counterfactuals R package, which provides a modular and unified R6-based interface for counterfactual explanation methods. We implemented three existing counterfactual explanation methods and propose some optional methodological extensions to generalize these methods to different scenarios and to make them more comparable. We explain the structure and workflow of the package using real use cases and show how to integrate additional counterfactual explanation methods into the package. In addition, we compared the implemented methods for a variety of models and datasets with regard to the quality of their counterfactual explanations and their runtime behavior.Keywords
All Related Versions
This publication has 45 references indexed in Scilit:
- Explainable AI and Causal Understanding: Counterfactual Approaches ConsideredMinds and Machines, 2023
- NICE: an algorithm for nearest instance counterfactual explanationsData Mining and Knowledge Discovery, 2023
- The Intriguing Relation Between Counterfactual Explanations and Adversarial ExamplesMinds and Machines, 2021
- Predictive Distribution Modeling Using Transformation ForestsJournal of Computational and Graphical Statistics, 2021
- Multi-Objective Counterfactual Explanations2020
- Association of plasma retinol levels with incident cancer risk in Chinese hypertensive adults: a nested case–control studyBritish Journal of Nutrition, 2019
- The irace package: Iterated racing for automatic algorithm configurationOperations Research Perspectives, 2016
- Peeking Inside the Black Box: Visualizing Statistical Learning With Plots of Individual Conditional ExpectationJournal of Computational and Graphical Statistics, 2015
- Causality2009
- Multiobjective optimization using evolutionary algorithms — A comparative case study1998