Explainable HDBSCAN
Explainable Hierarchical Density-Based Spatial Clustering of Applications with Noise · Also known as: XAI-HDBSCAN, Interpretable HDBSCAN, Explainable Hierarchical DBSCAN, HDBSCAN with XAI
Explainable HDBSCAN combines the hierarchical density-based clustering algorithm HDBSCAN with post-hoc explainability methods — primarily SHAP — to reveal which input features drive cluster membership and separation. It retains HDBSCAN's ability to find clusters of varying shape and density while adding a principled, auditable explanation layer.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Use Explainable HDBSCAN when you need density-based clustering on data with clusters of irregular shape or varying density AND you must justify cluster membership to stakeholders, regulators, or reviewers. It is especially appropriate in exploratory work on high-dimensional tabular data where both discovery and interpretability matter. Avoid it when clusters are known to be globular and k-means suffices; when the dataset is very small (fewer than ~100 points), where density estimation is unreliable; or when you need hard real-time decisions, since SHAP computation adds meaningful overhead.
Strengths & limitations
- Finds clusters of arbitrary shape and varying density without requiring the number of clusters to be specified in advance.
- Natively identifies and labels noise/outlier points rather than forcing them into a cluster.
- SHAP-based explanations are model-agnostic and satisfy desirable properties (efficiency, symmetry, dummy, additivity).
- The condensed cluster tree provides an intrinsic visual summary of the hierarchical structure even before SHAP is applied.
- Feature-importance rankings from SHAP can guide domain experts to validate whether cluster separations are scientifically meaningful.
- SHAP attribution is a post-hoc approximation; KernelSHAP is computationally expensive for large datasets.
- Cluster assignments are not differentiable, making SHAP surrogate fitting imprecise for ambiguously assigned boundary points.
- HDBSCAN's hyperparameters (min_cluster_size, min_samples) require tuning and can strongly affect results, complicating reproducibility.
- Noise-labeled points receive no stable cluster attribution, which may frustrate downstream use cases that require every point to be assigned.
Frequently asked
Does HDBSCAN require specifying the number of clusters?
No. Unlike k-means, HDBSCAN infers the number of clusters from the data's density structure. You set min_cluster_size (the smallest group you consider meaningful) rather than a target cluster count.
Which SHAP explainer should I use with HDBSCAN?
Because HDBSCAN does not produce a differentiable model, KernelSHAP or a surrogate classifier (e.g., a random forest fitted on the cluster labels) is typically used. TreeExplainer is applicable if the surrogate is a tree-based model and is much faster than KernelSHAP.
How do I handle noise points in the explanation?
Noise points (label -1) are by definition ambiguous; their SHAP values reflect proximity to no stable cluster. It is good practice to treat them separately, reporting which features most contributed to their outlier status rather than conflating them with clustered observations.
How do I validate that my clusters are real and not artifacts?
Use bootstrapped stability analysis (e.g., HDBSCAN's built-in cluster persistence scores), compute silhouette or DBCV scores, and check whether SHAP-identified driving features align with domain knowledge. Replicating clusters on a held-out or independently collected sample provides the strongest validation.
Can Explainable HDBSCAN be used with high-dimensional data like text embeddings?
Yes, but dimensionality reduction (e.g., UMAP) is strongly recommended before clustering in very high-dimensional spaces, as distance metrics lose meaning in such spaces. SHAP is then applied to the original features by fitting a surrogate on cluster assignments.
Sources
- McInnes, L., Healy, J., & Astels, S. (2017). hdbscan: Hierarchical density based clustering. Journal of Open Source Software, 2(11), 205. DOI: 10.21105/joss.00205 ↗
- Lundberg, S. M., & Lee, S.-I. (2017). A unified approach to interpreting model predictions. Advances in Neural Information Processing Systems, 30, 4765–4774. link ↗
How to cite this page
ScholarGate. (2026, June 3). Explainable Hierarchical Density-Based Spatial Clustering of Applications with Noise. ScholarGate. https://scholargate.app/en/machine-learning/explainable-hdbscan
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Explainable DBSCANMachine learning↔ compare
- Explainable Gaussian Mixture ModelMachine learning↔ compare
- Explainable Isolation ForestMachine learning↔ compare
- Explainable K-MeansMachine learning↔ compare
- Explainable Random ForestMachine learning↔ compare
- HDBSCANMachine learning↔ compare