Table of Contents
Fetching ...

Towards Personalized Treatment Plan: Geometrical Model-Agnostic Approach to Counterfactual Explanations

Daniel Sin, Milad Toutounchian

TL;DR

This work introduces SSBA, a model-agnostic, geometrically grounded method for generating nearest feasible counterfactual explanations by discretizing and sampling points on the decision boundary. It uses pairwise sampling and binary search to construct a set of boundary points and then selects the boundary point closest to the query instance under the $L_2$ norm, optionally enforcing real-world constraints via unary and box restrictions. Compared with DiCE and Alibi, SSBA demonstrates favorable or competitive $L_2$ distances, particularly under feasibility constraints, and benefits from GPU acceleration to substantially reduce runtime. The approach is scalable to high-dimensional data, provides bounded-counterfactuals, and offers a pathway toward interpretable interventions, with future work focusing on denser boundary sampling, topological expansions, and integration with language-based guidance for treatment planning.

Abstract

In our article, we describe a method for generating counterfactual explanations in high-dimensional spaces using four steps that involve fitting our dataset to a model, finding the decision boundary, determining constraints on the problem, and computing the closest point (counterfactual explanation) from that boundary. We propose a discretized approach where we find many discrete points on the boundary and then identify the closest feasible counterfactual explanation. This method, which we later call $\textit{Segmented Sampling for Boundary Approximation}$ (SSBA), applies binary search to find decision boundary points and then searches for the closest boundary point. Across four datasets of varying dimensionality, we show that our method can outperform current methods for counterfactual generation with reductions in distance between $5\%$ to $50\%$ in terms of the $L_2$ norm. Our method can also handle real-world constraints by restricting changes to immutable and categorical features, such as age, gender, sex, height, and other related characteristics such as the case for a health-based dataset. In terms of runtime, the SSBA algorithm generates decision boundary points on multiple orders of magnitude in the same given time when we compare to a grid-based approach. In general, our method provides a simple and effective model-agnostic method that can compute nearest feasible (i.e. realistic with constraints) counterfactual explanations. All of our results and code are available at: https://github.com/dsin85691/SSBA_For_Counterfactuals

Towards Personalized Treatment Plan: Geometrical Model-Agnostic Approach to Counterfactual Explanations

TL;DR

This work introduces SSBA, a model-agnostic, geometrically grounded method for generating nearest feasible counterfactual explanations by discretizing and sampling points on the decision boundary. It uses pairwise sampling and binary search to construct a set of boundary points and then selects the boundary point closest to the query instance under the norm, optionally enforcing real-world constraints via unary and box restrictions. Compared with DiCE and Alibi, SSBA demonstrates favorable or competitive distances, particularly under feasibility constraints, and benefits from GPU acceleration to substantially reduce runtime. The approach is scalable to high-dimensional data, provides bounded-counterfactuals, and offers a pathway toward interpretable interventions, with future work focusing on denser boundary sampling, topological expansions, and integration with language-based guidance for treatment planning.

Abstract

In our article, we describe a method for generating counterfactual explanations in high-dimensional spaces using four steps that involve fitting our dataset to a model, finding the decision boundary, determining constraints on the problem, and computing the closest point (counterfactual explanation) from that boundary. We propose a discretized approach where we find many discrete points on the boundary and then identify the closest feasible counterfactual explanation. This method, which we later call (SSBA), applies binary search to find decision boundary points and then searches for the closest boundary point. Across four datasets of varying dimensionality, we show that our method can outperform current methods for counterfactual generation with reductions in distance between to in terms of the norm. Our method can also handle real-world constraints by restricting changes to immutable and categorical features, such as age, gender, sex, height, and other related characteristics such as the case for a health-based dataset. In terms of runtime, the SSBA algorithm generates decision boundary points on multiple orders of magnitude in the same given time when we compare to a grid-based approach. In general, our method provides a simple and effective model-agnostic method that can compute nearest feasible (i.e. realistic with constraints) counterfactual explanations. All of our results and code are available at: https://github.com/dsin85691/SSBA_For_Counterfactuals
Paper Structure (21 sections, 13 equations, 6 figures, 1 table, 2 algorithms)

This paper contains 21 sections, 13 equations, 6 figures, 1 table, 2 algorithms.

Figures (6)

  • Figure 1: Counterfactual explanation for exemplary point $(11,15)$ crossing a trained SVM's decision boundary. We generate the points in purple to find the closest point to the boundary.
  • Figure 2: Side-by-side comparison of SSBA with DiCE's model-agnostic approaches. We compare the green point (applying our SSBA method) with the yellow points (applying DiCE's model-agnostic methods). The black decision boundary is generated with matplotlib, and the purple dots are generated with SSBA.
  • Figure 3: Side-by-side comparison of SSBA with Alibi's gradient approach. We compare the green point (applying our SSBA method) with the yellow point (applying Alibi's gradient method). The black decision boundary is generated with matplotlib, and the purple dots are generated with SSBA.
  • Figure 4: Using a trained SVM classifier, we can observe the green point's distance to the boundary. The matplotlib generated decision boundary is colored black. Similar as above, the purple dots are generated with SSBA.
  • Figure 5: This is an example of how we compute the distance values in the last column of Table $1(b)$ for the unconstrained case. We sample the distances in black where the points are labelled $y = 1$ (or unhealthy in this case). We then average over these distances.
  • ...and 1 more figures

Theorems & Definitions (2)

  • proof
  • proof