Table of Contents
Fetching ...

Model-Based Counterfactual Explanations Incorporating Feature Space Attributes for Tabular Data

Yuta Sumiya, Hayaru shouno

TL;DR

This work tackles counterfactual explanations for tabular data by addressing categorical perturbations through TargetEncoding and by learning a latent CF generator with normalizing flows (FastDCFlow). The method optimizes a joint objective over likelihood, validity, and proximity to generate diverse, proximal CFs rapidly, enabling per-input CF sets without heavy optimization. TE improves perturbation realism and diversity, while the normalizing-flow latent space supports efficient, model-based CF generation that balances multiple quality metrics. Empirical results on three open datasets show FastDCFlow achieving strong diversity and proximity, competitive validity, and superior speed compared with baselines, highlighting its practical potential for real-world decision support with tabular data.

Abstract

Machine-learning models, which are known to accurately predict patterns from large datasets, are crucial in decision making. Consequently, counterfactual explanations-methods explaining predictions by introducing input perturbations-have become prominent. These perturbations often suggest ways to alter the predictions, leading to actionable recommendations. However, the current techniques require resolving the optimization problems for each input change, rendering them computationally expensive. In addition, traditional encoding methods inadequately address the perturbations of categorical variables in tabular data. Thus, this study propose FastDCFlow, an efficient counterfactual explanation method using normalizing flows. The proposed method captures complex data distributions, learns meaningful latent spaces that retain proximity, and improves predictions. For categorical variables, we employed TargetEncoding, which respects ordinal relationships and includes perturbation costs. The proposed method outperformed existing methods in multiple metrics, striking a balance between trade offs for counterfactual explanations. The source code is available in the following repository: https://github.com/sumugit/FastDCFlow.

Model-Based Counterfactual Explanations Incorporating Feature Space Attributes for Tabular Data

TL;DR

This work tackles counterfactual explanations for tabular data by addressing categorical perturbations through TargetEncoding and by learning a latent CF generator with normalizing flows (FastDCFlow). The method optimizes a joint objective over likelihood, validity, and proximity to generate diverse, proximal CFs rapidly, enabling per-input CF sets without heavy optimization. TE improves perturbation realism and diversity, while the normalizing-flow latent space supports efficient, model-based CF generation that balances multiple quality metrics. Empirical results on three open datasets show FastDCFlow achieving strong diversity and proximity, competitive validity, and superior speed compared with baselines, highlighting its practical potential for real-world decision support with tabular data.

Abstract

Machine-learning models, which are known to accurately predict patterns from large datasets, are crucial in decision making. Consequently, counterfactual explanations-methods explaining predictions by introducing input perturbations-have become prominent. These perturbations often suggest ways to alter the predictions, leading to actionable recommendations. However, the current techniques require resolving the optimization problems for each input change, rendering them computationally expensive. In addition, traditional encoding methods inadequately address the perturbations of categorical variables in tabular data. Thus, this study propose FastDCFlow, an efficient counterfactual explanation method using normalizing flows. The proposed method captures complex data distributions, learns meaningful latent spaces that retain proximity, and improves predictions. For categorical variables, we employed TargetEncoding, which respects ordinal relationships and includes perturbation costs. The proposed method outperformed existing methods in multiple metrics, striking a balance between trade offs for counterfactual explanations. The source code is available in the following repository: https://github.com/sumugit/FastDCFlow.
Paper Structure (15 sections, 12 equations, 5 figures, 8 tables, 1 algorithm)

This paper contains 15 sections, 12 equations, 5 figures, 8 tables, 1 algorithm.

Figures (5)

  • Figure 1: Counterfactual scenario.
  • Figure 2: Overview of CFs training and generation using FastDCFlow.
  • Figure 3: The boxplot showcases $\hat{y}_i^{tes}$ and $\hat{y}_i^{cf}$ values from FastDCFlow trained using TE and OHE across the Adult, Bank, and Churn datasets. In each graph, four boxplots, from left to right, represent: $\hat{y}_i^{tes}$ with TE (blue), $\hat{y}_i^{cf}$ with TE (orange), $\hat{y}_i^{tes}$ with OHE (blue), and $\hat{y}_i^{cf}$ with OHE (orange).
  • Figure 4: Relationship between $M$ and RT for each model.
  • Figure 5: Changes in evaluation metrics with adjustments to the temperature parameter in model-based methods. Each line represents an evaluation metric (including DiCE diversity loss), and each column corresponds to a dataset. VAE-based methods produce similar values in all evaluations, leading to nearly overlapping plots.