Table of Contents
Fetching ...

Actionable and diverse counterfactual explanations incorporating domain knowledge and causal constraints

Szymon Bobek, Łukasz Bałec, Grzegorz J. Nalepa

TL;DR

This work tackles the problem of generating counterfactual explanations that are both actionable and plausible in real-world settings by embedding domain knowledge and causal constraints. The authors introduce DANCE, a framework that learns linear and nonlinear feature dependencies (via data-driven graphs or expert input) and optimizes a composite loss balancing fidelity, proximity, sparsity, diversity, and plausibility using Tree-structured Parzen Estimation. Comprehensive evaluation on 140 OpenML datasets and a real-world Freshmail case study demonstrates that DANCE often outperforms existing methods on key metrics while producing domain-consistent suggestions. The study highlights the practical value of incorporating domain constraints in XAI to improve adoption, trust, and impact in marketing security and beyond, with open-source code for reproducibility.

Abstract

Counterfactual explanations enhance the actionable interpretability of machine learning models by identifying the minimal changes required to achieve a desired outcome of the model. However, existing methods often ignore the complex dependencies in real-world datasets, leading to unrealistic or impractical modifications. Motivated by cybersecurity applications in the email marketing domain, we propose a method for generating Diverse, Actionable, and kNowledge-Constrained Explanations (DANCE), which incorporates feature dependencies and causal constraints to ensure plausibility and real-world feasibility of counterfactuals. Our method learns linear and nonlinear constraints from data or integrates expert-provided dependency graphs, ensuring counterfactuals are plausible and actionable. By maintaining consistency with feature relationships, the method produces explanations that align with real-world constraints. Additionally, it balances plausibility, diversity, and sparsity, effectively addressing key limitations in existing algorithms. The work is developed based on a real-life case study with Freshmail, the largest email marketing company in Poland and supported by a joint R&D project Sendguard. Furthermore, we provide an extensive evaluation using 140 public datasets, which highlights its ability to generate meaningful, domain-relevant counterfactuals that outperform other existing approaches based on widely used metrics. The source code for reproduction of the results can be found in a GitHub repository we provide.

Actionable and diverse counterfactual explanations incorporating domain knowledge and causal constraints

TL;DR

This work tackles the problem of generating counterfactual explanations that are both actionable and plausible in real-world settings by embedding domain knowledge and causal constraints. The authors introduce DANCE, a framework that learns linear and nonlinear feature dependencies (via data-driven graphs or expert input) and optimizes a composite loss balancing fidelity, proximity, sparsity, diversity, and plausibility using Tree-structured Parzen Estimation. Comprehensive evaluation on 140 OpenML datasets and a real-world Freshmail case study demonstrates that DANCE often outperforms existing methods on key metrics while producing domain-consistent suggestions. The study highlights the practical value of incorporating domain constraints in XAI to improve adoption, trust, and impact in marketing security and beyond, with open-source code for reproducibility.

Abstract

Counterfactual explanations enhance the actionable interpretability of machine learning models by identifying the minimal changes required to achieve a desired outcome of the model. However, existing methods often ignore the complex dependencies in real-world datasets, leading to unrealistic or impractical modifications. Motivated by cybersecurity applications in the email marketing domain, we propose a method for generating Diverse, Actionable, and kNowledge-Constrained Explanations (DANCE), which incorporates feature dependencies and causal constraints to ensure plausibility and real-world feasibility of counterfactuals. Our method learns linear and nonlinear constraints from data or integrates expert-provided dependency graphs, ensuring counterfactuals are plausible and actionable. By maintaining consistency with feature relationships, the method produces explanations that align with real-world constraints. Additionally, it balances plausibility, diversity, and sparsity, effectively addressing key limitations in existing algorithms. The work is developed based on a real-life case study with Freshmail, the largest email marketing company in Poland and supported by a joint R&D project Sendguard. Furthermore, we provide an extensive evaluation using 140 public datasets, which highlights its ability to generate meaningful, domain-relevant counterfactuals that outperform other existing approaches based on widely used metrics. The source code for reproduction of the results can be found in a GitHub repository we provide.

Paper Structure

This paper contains 23 sections, 10 equations, 13 figures, 3 tables, 1 algorithm.

Figures (13)

  • Figure 1: Example of a relation between input variables that will not be captured by existing methods, but can be modeled with linear or conditional constraints and our approach.
  • Figure 2: Relationship graph for a Wine dataset. The edges represent the magnitude in which change in the parent node values impact the children node values. For instance increase in residual sugar decreases the alcohol in the wine and the counterfactual that not preserve this constrain is considered implausible and not actionable.
  • Figure 3: Combined evaluation metric visualized in a form of spiderplot. The larger the area, the better the method.
  • Figure 4: Decrease in performance with respect to different metrics of a model with plausibility optimization turned on.
  • Figure 5: Workflow of the case study. The marketing campaign is processed through the SendGuard system to assess its quality. If the campaign is deemed of poor quality, the DANCE method generates counterfactual suggestions for potential modifications to enhance its possible open rate among addressees.
  • ...and 8 more figures