- Introduced by
- Vega-Pons, S. & Ruiz-Shulcloper, J. (ensemble clustering framework); McInnes, L. et al. (HDBSCAN base)
- Year
- 2011–2017
- Type
- Consensus clustering ensemble
- Family
- Machine learning
What does it do?
Ensemble HDBSCAN runs HDBSCAN many times under different min_cluster_size and min_samples settings, optionally varying the distance metric or using data subsamples, and combines the resulting partitions into one consensus clustering.
HDBSCAN's output can change noticeably with these parameters, so pooling runs is intended to give more stable and reproducible assignments on noisy, high-dimensional data. The gain in stability is something to check on the data at hand rather than a guarantee.
The intuition behind the method
HDBSCAN's output can shift noticeably when min_cluster_size or min_samples is changed by a small amount. Ensemble HDBSCAN treats this sensitivity as something to average over: run the algorithm across a grid or sample of parameter settings, record which pairs of points land in the same cluster across runs, and then apply a consensus step that groups two points only when enough runs agree. The result is intended to reflect density structure that persists across settings rather than the artefacts of a single parameter choice.
History
The cluster ensemble framework, in which several clusterings of the same dataset are generated and then combined into one final clustering, is surveyed by Vega-Pons and Ruiz-Shulcloper (2011), who also present a taxonomy of these methods. HDBSCAN was released as software by McInnes, Healy and Astels in 2017, and the 2017 reference on this page describes that software implementation. Combining HDBSCAN runs in an ensemble is an adaptation of the general framework rather than a single standard algorithm with a known originator, so users typically assemble the pipeline from HDBSCAN and custom consensus code.
When to use it
Use Ensemble HDBSCAN when (1) the dataset has complex, varying-density clusters not well captured by spherical-cluster methods like k-means, (2) results need to be robust to HDBSCAN hyperparameter choices, or (3) reproducibility across analysts running slightly different settings is required. It is particularly valuable on high-dimensional data — genomics, text embeddings, sensor streams — where density structure is real but parameter sensitivity is high. Avoid it when computational budget is tight and a single well-tuned HDBSCAN run suffices, or when clusters are roughly spherical and k-means or GMM is faster and simpler. It is not appropriate for labeled data where supervised or semi-supervised methods apply.
Limitations and considerations
- Significantly more computationally expensive than a single HDBSCAN run; cost scales with the number of ensemble members.
- The consensus step introduces its own hyperparameter choices (threshold, consensus algorithm) that must be validated.
- Noise handling across runs is non-trivial: points labeled as noise in many runs may be ambiguously placed.
- No widely adopted standard implementation; users typically must assemble the pipeline from HDBSCAN and custom consensus code.
- The co-association matrix holds one entry per pair of points, so its memory and computation grow with the square of the number of points. For large datasets this may require subsampling or sparse or graph-based alternatives.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Can reduce sensitivity to HDBSCAN hyperparameters by averaging over many configurations; the size of the gain depends on the data.
- Inherits HDBSCAN's ability to find arbitrarily shaped, varying-density clusters and identify genuine noise points.
- Can yield more reproducible cluster assignments than a single HDBSCAN run; whether it does on a given dataset must be checked.
- The co-association matrix gives pairwise agreement across runs, which can feed downstream uncertainty analysis; it is not a per-cluster membership probability.
- Individual runs can be parallelized across cores, which reduces wall-clock time but not total compute.
Applications
- Single-cell RNA-seq clustering where density structure varies across cell populations and reproducibility is critical.
- Topic clustering of document embeddings where cluster shape is irregular and parameter sensitivity is high.
- Anomaly detection pre-processing: stable cluster assignments help distinguish genuine noise from borderline points.
- Customer segmentation on high-dimensional behavioral data where marketing decisions require reproducible segments.
- Satellite or sensor image pixel clustering under varying spatial density.
How it works
How it works
A set of HDBSCAN configurations is defined by varying min_cluster_size, min_samples, and optionally the distance metric or a data subsample fraction. The configurations can be drawn systematically from a grid or sampled randomly, covering the plausible parameter space for the dataset.
Each configuration is run independently to produce a full cluster assignment, including HDBSCAN noise labels. Each run contributes one partition of the data. Noise points from a given run are treated as singletons for the co-association step, so they never share a cluster with other points in that run.
A co-association matrix is constructed over all pairs of data points. For points i and j, the entry is the number of runs in which both points are assigned to the same non-noise cluster, divided by the total number of runs. Noise points count as singletons, so they never contribute to a shared cluster. High co-association indicates cohesion that persists across parameter settings; values near zero indicate points that rarely group together or are often labelled as noise.
The co-association matrix is converted to a dissimilarity (1 minus co-association) and passed to average-link hierarchical clustering, which produces a dendrogram. The final partition is obtained by cutting the dendrogram at a chosen level; this cut level is the consensus threshold, and it sets how strongly points must co-occur across runs before they are grouped. Graph-partitioning approaches on the co-association graph are an alternative.
The consensus partition is assessed using internal indices such as silhouette score, DBCV (Density-Based Clustering Validation), or Calinski-Harabasz, since ground-truth labels are typically unavailable. Stability across bootstrap replicates provides an additional quality check.
Common pitfalls
- Using too few ensemble members for the co-association matrix to settle. Check whether the matrix still changes materially as runs are added before accepting the consensus partition.
- Handling noise labels inconsistently across runs, for example dropping noise points in some runs but keeping them as members in others. This changes the co-association values of borderline points and can make the consensus depend on implementation details.
- Evaluating only with silhouette score, which penalizes non-convex clusters that density-based methods are designed to find; DBCV is better matched to density-based partitions.
- Choosing the consensus cut level without validation, which can over-merge distinct clusters or over-split a single one.
- Applying the ensemble to very small datasets where individual HDBSCAN runs already vary strongly; averaging over unstable partitions then gives little stability gain.
Frequently asked questions
How many HDBSCAN runs should the ensemble include?
No fixed number of runs is established for this method. Instead, add runs and check whether the co-association matrix still changes materially; once it stops changing, further runs add compute cost with diminishing gains in stability.
How should noise points be handled in the ensemble?
Treat each run's noise points as singletons when building the co-association matrix, so they count as in their own cluster for that run. After consensus, points with consistently low co-association with any group can be designated as stable noise.
Which consensus algorithm works best with HDBSCAN partitions?
Average-link hierarchical clustering on 1 minus the co-association matrix is a straightforward default, and it lets the consensus threshold be applied as a dendrogram cut. Because it operates on a dense matrix, its cost grows quickly with the number of points, so graph-based methods such as spectral clustering on the co-association graph may be more practical on very large datasets. The choice of consensus method should be validated on the data at hand.
How do I choose the consensus threshold?
Treat the cut level as a hyperparameter and select it using an internal validity index (DBCV or silhouette), then check that the selected level is stable under resampling. No universal default cut level applies, because the appropriate value depends on how tight or loose the clusters are in the data.
When should I prefer a single HDBSCAN run over the ensemble?
If domain knowledge reliably pins down the hyperparameters, or if computational budget is very limited, a single well-tuned HDBSCAN run is faster and often sufficient. The ensemble pays off most when hyperparameter choice is uncertain or when different analysts must reproduce the same segmentation.
Related methods
Sources
McInnes, L., Healy, J., & Astels, S. (2017). hdbscan: Hierarchical density based clustering. Journal of Open Source Software, 2(11), 205.
Open DOI referenceVega-Pons, S., & Ruiz-Shulcloper, J. (2011). A survey of clustering ensemble methods. International Journal of Pattern Recognition and Artificial Intelligence, 25(03), 337–372.
Open DOI reference