# Selective inference for k-means clustering

arXiv: https://arxiv.org/abs/2203.15267 · HTML: https://mlsanity.com/paper/2203.15267/

## Key facts

- Cited by 22 papers in the map (data through 14 Oct 2026).
- Builds on 34 of its 104 references that are in the map.
- First posted on arXiv 29 Mar 2022.

## Builds on (most cited first, 30 of 34)

- [UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction](https://mlsanity.com/paper/1802.03426/) (2018)
- [Statistical guarantees for the EM algorithm: From population to sample-based analysis](https://mlsanity.com/paper/1408.2156/) (2014)
- [Exact post-selection inference, with application to the lasso](https://mlsanity.com/paper/1311.6238/) (2013)
- [Optimal Inference After Model Selection](https://mlsanity.com/paper/1410.2597/) (2014)
- [Statistical and Computational Guarantees of Lloyd's Algorithm and its Variants](https://mlsanity.com/paper/1612.02099/) (2016)
- [Exact Post-Selection Inference for Sequential Regression Procedures](https://mlsanity.com/paper/1401.3889/) (2014)
- [Robust Covariance and Scatter Matrix Estimation under Huber's Contamination Model](https://mlsanity.com/paper/1506.00691/) (2015)
- [Optimality of Spectral Clustering in the Gaussian Mixture Model](https://mlsanity.com/paper/1911.00538/) (2019)
- [Selective Inference for Hierarchical Clustering](https://mlsanity.com/paper/2012.02936/) (2020)
- [Valid Inference Corrected for Outlier Removal](https://mlsanity.com/paper/1711.10635/) (2017)
- [Testing for a Change in Mean After Changepoint Detection](https://mlsanity.com/paper/1910.04291/) (2019)
- [Computing Valid p-value for Optimal Changepoint by Selective Inference using Dynamic Programming](https://mlsanity.com/paper/2002.09132/) (2020)
- [More Powerful Conditional Selective Inference for Generalized Lasso by Parametric Programming](https://mlsanity.com/paper/2105.04920/) (2021)
- [More powerful post-selection inference, with application to the Lasso](https://mlsanity.com/paper/1801.09037/) (2018)
- [Selective Inference for Group-Sparse Linear Models](https://mlsanity.com/paper/1607.08211/) (2016)
- [Regularized EM Algorithms: A Unified Framework and Statistical Guarantees](https://mlsanity.com/paper/1511.08551/) (2015)
- [Post-Selection Inference for Changepoint Detection Algorithms with Application to Copy Number Variation Data](https://mlsanity.com/paper/1812.03644/) (2018)
- [A significance test for forward stepwise model selection](https://mlsanity.com/paper/1405.3920/) (2014)
- [Splitting strategies for post-selection inference](https://mlsanity.com/paper/2102.02159/) (2021)
- [Influential Feature PCA for high dimensional clustering](https://mlsanity.com/paper/1407.5241/) (2014)
- [Statistical Significance for Hierarchical Clustering](https://mlsanity.com/paper/1411.5259/) (2014)
- [Selective inference in regression models with groups of variables](https://mlsanity.com/paper/1511.01478/) (2015)
- [Unifying approach to selective inference with applications to cross-validation](https://mlsanity.com/paper/1703.06559/) (2017)
- [Permutation methods for factor analysis and PCA](https://mlsanity.com/paper/1710.00479/) (2017)
- [Finite mixture models do not reliably learn the number of components](https://mlsanity.com/paper/2007.04470/) (2020)
- [Scientific intuition inspired by machine learning generated hypotheses](https://mlsanity.com/paper/2010.14236/) (2020)
- [More powerful selective inference for the graph fused lasso](https://mlsanity.com/paper/2109.10451/) (2021)
- [Multicarving for high-dimensional post-selection inference](https://mlsanity.com/paper/2006.04613/) (2020)
- [Selective Inference for Latent Block Models](https://mlsanity.com/paper/2005.13273/) (2020)
- [Statistical significance of variables driving systematic variation](https://mlsanity.com/paper/1308.6013/) (2013)

## Built on by (most cited first, 22 of 22)

- [CAD-DA: Controllable Anomaly Detection after Domain Adaptation by Statistical Inference](https://mlsanity.com/paper/2310.14608/) (2023)
- [Generalized Data Thinning Using Sufficient Statistics](https://mlsanity.com/paper/2303.12931/) (2023)
- [Efficient Sparse PCA via Block-Diagonalization](https://mlsanity.com/paper/2410.14092/) (2024)
- [Kernel Biclustering algorithm in Hilbert Spaces](https://mlsanity.com/paper/2208.03675/) (2022)
- [Quantifying Statistical Significance of Deep Nearest Neighbor Anomaly Detection via Selective Inference](https://mlsanity.com/paper/2502.12978/) (2025)
- [Change Point Detection in the Frequency Domain with Statistical Reliability](https://mlsanity.com/paper/2502.03062/) (2025)
- [Statistical Inference for Autoencoder-based Anomaly Detection after Representation Learning-based Domain Adaptation](https://mlsanity.com/paper/2508.07049/) (2025)
- [Weighted Conformal Clustering](https://mlsanity.com/paper/2606.00436/) (2026)
- [Bounded P-values in Parametric Programming-based Selective Inference](https://mlsanity.com/paper/2307.11351/) (2023)
- [Adaptively Robust and Sparse K-means Clustering](https://mlsanity.com/paper/2407.06945/) (2024)
- [Inferring independent sets of Gaussian variables after thresholding correlations](https://mlsanity.com/paper/2211.01521/) (2022)
- [Unsupervised Learning of Phylogenetic Trees via Split-Weight Embedding](https://mlsanity.com/paper/2312.16074/) (2023)
- [Interpretable Clustering with the Distinguishability Criterion](https://mlsanity.com/paper/2404.15967/) (2024)
- [Two-cluster test](https://mlsanity.com/paper/2507.08382/) (2025)
- [Hierarchical Clustering With Confidence](https://mlsanity.com/paper/2512.06522/) (2025)
- [The Condition-Number Principle for Prototype Clustering](https://mlsanity.com/paper/2604.07744/) (2026)
- [Drawing Lines in Psychological Space: What K-means Clustering Reveals in Simulated and Real Psychometric Data](https://mlsanity.com/paper/2605.06989/) (2026)
- [Testing hypotheses via orthogonalization](https://mlsanity.com/paper/2606.29732/) (2026)
- [Automatic Statistical Test for Rationally Expressible Algorithms by Selective Inference, with Applications to Feature Selection](https://mlsanity.com/paper/2608.04667/) (2026)
- [Nonparametric Hypothesis Testing of High-dimensional Clustering With Application to Single-cell RNA Data](https://mlsanity.com/paper/2609.05683/) (2026)
- [Statistical Testing for Multiple Instance Learning via Selective Inference with Applications to Computational Pathology](https://mlsanity.com/paper/2609.31712/) (2026)
- [Selective Inference for Clustering Under Unknown Covariance](https://mlsanity.com/paper/2610.17458/) (2026)

## Abstract (arXiv)

We consider the problem of testing for a difference in means between clusters of observations identified via k-means clustering. In this setting, classical hypothesis tests lead to an inflated Type I error rate. To overcome this problem, we take a selective inference approach. We propose a finite-sample p-value that controls the selective Type I error for a test of the difference in means between a pair of clusters obtained using k-means clustering, and show that it can be efficiently computed. We apply our proposal in simulation, and on hand-written digits data and single-cell RNA-sequencing data.
