TL;DR
CARVE (Cluster Analysis with Resampling for Validation and Exploration) is a new open-source Python and R package that tackles the notorious non-reproducibility of unsupervised clustering. By utilizing a robust, resampling-based framework, CARVE evaluates both the stability and generalizability of clustering solutions at the global, cluster, and individual sample levels. This allows researchers to confidently select the right algorithm and number of clusters ($k$) even when dealing with messy, high-dimensional biomedical data.
What Problem Does This Paper Address?
Clustering is a foundational tool in modern data science, especially in fields like genomics where it is used to discover novel cell types or disease subtypes. However, clustering is notoriously sensitive. Change the algorithm, tweak the preprocessing, or alter the number of clusters $k$, and you can get wildly different results from the exact same dataset (as shown in Figure 1).
To decide which clustering solution to trust, scientists traditionally rely on Cluster Validation Indices (CVIs) like the Silhouette score or Davies–Bouldin index. The catch? These indices rely on strict geometric assumptions—implicitly expecting clusters to be nice, neat, spherical, and well-separated. Real-world biological data is rarely so well-behaved; it is often high-dimensional, heavy-tailed, and non-linear. When applied to this complex data, traditional CVIs frequently fail, leading to over- or under-clustering and, ultimately, non-reproducible scientific claims.
Methods
CARVE replaces rigid geometric assumptions with a model-agnostic, resampling-based approach. The workflow operates by repeatedly splitting the data to evaluate two core properties:
- Stability: Does the clustering algorithm find the same groupings when applied to different random subsamples of the data? CARVE measures this by computing the Adjusted Rand Index (ARI) on the overlap between two independent subsamples.
- Generalizability: Can the cluster labels learned on one subset of the data be accurately predicted on unseen, held-out samples? CARVE trains a classifier (a Random Forest by default) on one subsample's cluster assignments and evaluates its predictive accuracy on a holdout set.
Rather than just providing a single global score, CARVE aggregates these metrics across iterations to offer multi-level diagnostics:
- Global level: Helps select the optimal $k$ and algorithm using principled selection rules (such as the "1-Standard-Error rule").
- Cluster level: Identifies which specific clusters are robust and which are ambiguous or continuous.
- Sample level: Highlights individual "spurious" data points that have uncertain cluster membership.
Datasets
The authors evaluated CARVE against traditional CVIs using both synthetic benchmarks and real biological datasets:
- Synthetic Benchmarks: Six distinct simulation environments (each with a true cluster count of $k^* = 5$) designed to test different geometric challenges: isotropic Gaussians, heavy-tailed $t$-distributions, datasets with up to 1,536 nuisance (noisy) dimensions, and nonlinearly embedded manifolds (circles, moons, and Swiss rolls).
- Klein Dataset: A real droplet-based single-cell RNA-seq (scRNA-seq) dataset tracking mouse embryonic stem cells through four distinct differentiation time points.
- Levine Dataset: A 32-dimensional mass cytometry (CyTOF) dataset consisting of 5,000 cells spanning 14 manually gated bone-marrow cell populations.
Key Insights and Ideas
- Stability alone is a trap: A very simple, coarse clustering solution (e.g., splitting a complex dataset into just two massive groups) can be incredibly stable under resampling, but completely uninformative. By pairing stability with generalizability, CARVE ensures that the selected solution is both robust and genuinely reflective of the underlying data structure.
- Granularity matters: Traditional validation methods give you one scalar number for the whole dataset. CARVE’s "aha moment" is providing cluster- and sample-level metrics. A researcher can look at a violin plot of cluster stability and say, "Clusters 1 and 2 are rock-solid, but Cluster 4 is highly unstable and deserves skepticism."
Key Results
- Synthetic Performance: Across all six synthetic tasks, CARVE consistently recovered the true number of clusters ($k^*=5$) or near-optimal partitions, even as the signal-to-noise ratio decreased. Traditional CVIs like the Gap statistic and Calinski–Harabasz degraded severely on non-linear shapes (circles and moons) and heavy-tailed distributions.
- Real-World Biological Discovery:
- On the Klein scRNA-seq data, traditional CVIs collapsed the data into just $k=2$ clusters, completely missing the biological progression. CARVE correctly identified $k=4$ clusters, perfectly mapping to the four distinct embryonic stem cell differentiation stages.
- On the Levine mass cytometry data, traditional CVIs selected an overly coarse $k=7$ solution that lumped distinct T-cells and Natural Killer (NK) cells into a single bucket. CARVE selected $k=10$ (achieving a high ARI of ~0.84 against manual ground-truth gating), successfully separating CD4+ T, CD8+ T, and CD16− NK cells into distinct, biologically meaningful groups.
Limitations and Future Work
While CARVE's stability selection rules proved robust across all dimensions, the authors noted that the generalizability metric can degrade in very high-dimensional spaces ($p$). This happens because the default 100-tree Random Forest classifier struggles to capture cluster geometry when the feature count explodes. In these scenarios, users must manually increase the number of trees or supply a custom, higher-capacity classifier.
Looking ahead, the most pressing frontier for clustering validation is multimodal data. As modern biology increasingly generates single-cell datasets that simultaneously measure transcriptomic, proteomic, and epigenetic modalities, extending CARVE's resampling framework to validate joint-modality integration pipelines is a key area for future development.
Summary updated