Hostname: page-component-74656f9884-g96k6 Total loading time: 0 Render date: 2026-11-10T14:23:35.635Z Has data issue: false hasContentIssue false

Declarative Approaches to Counterfactual Explanations for Classification

Published online by Cambridge University Press:  27 December 2021

LEOPOLDO BERTOSSI*
Affiliation:
Universidad Adolfo Ibáñez, Faculty of Engineering and Sciences, Santiago, Chile and Millennium Institute for Foundational Research on Data (IMFD) Santiago, Chile (e-mail: leopoldo.bertossi@uai.cl)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

We propose answer-set programs that specify and compute counterfactual interventions on entities that are input on a classification model. In relation to the outcome of the model, the resulting counterfactual entities serve as a basis for the definition and computation of causality-based explanation scores for the feature values in the entity under classification, namely responsibility scores. The approach and the programs can be applied with black-box models, and also with models that can be specified as logic programs, such as rule-based classifiers. The main focus of this study is on the specification and computation of best counterfactual entities, that is, those that lead to maximum responsibility scores. From them one can read off the explanations as maximum responsibility feature values in the original entity. We also extend the programs to bring into the picture semantic or domain knowledge. We show how the approach could be extended by means of probabilistic methods, and how the underlying probability distributions could be modified through the use of constraints. Several examples of programs written in the syntax of the DLV ASP-solver, and run with it, are shown.