Counterfactual Explanations for k-means and Gaussian Clustering

Georgios Vardakas, Antonia Karra, Evaggelia Pitoura, Aristidis Likas
1/17/2025
cs.LG

No confident code implementation found for this paper.

Abstract

Counterfactuals have been recognized as an effective approach to explain classifier decisions. Nevertheless, they have not yet been considered in the context of clustering. In this work, we propose the use of counterfactuals to explain clustering solutions. First, we present a general definition for counterfactuals for model-based clustering that includes plausibility and feasibility constraints. Then we consider the counterfactual generation problem for k-means and Gaussian clustering assuming Euclidean distance. Our approach takes as input the factual, the target cluster, a binary mask indicating actionable or immutable features and a plausibility factor specifying how far from the cluster boundary the counterfactual should be placed. In the k-means clustering case, analytical mathematical formulas are presented for computing the optimal solution, while in the Gaussian clustering case (assuming full, diagonal, or spherical covariances) our method requires the numerical solution of a nonlinear equation with a single parameter only. We demonstrate the advantages of our approach through illustrative examples and quantitative experimental comparisons.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{vardakas2025counterfactual,
  title  = {Counterfactual Explanations for k-means and Gaussian Clustering},
  author = {Georgios Vardakas and Antonia Karra and Evaggelia Pitoura and Aristidis Likas},
  year   = {2025},
  eprint = {2501.10234},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.10234v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.10234.svg)](https://codeofpaper.com/paper/2501.10234)

Discussion