Skip to content

ML Models & Algorithms

HDBSCAN (Hierarchical Density-Based Spatial Clustering of Applications with Noise)

In shortA density-based clustering algorithm that finds clusters of varying density by itself and labels points that fit no cluster as noise.

Updated 24 Oct 2026· 2 min read

HDBSCAN (Hierarchical Density-Based Spatial Clustering of Applications with Noise) groups data points that sit in dense regions and treats points in sparse regions as noise. It extends DBSCAN by building a hierarchy of clusters across density levels and keeping the most stable ones, so it handles clusters of different densities and does not need a fixed distance threshold. It is the default clustering step in BERTopic and Top2Vec.

How it works

In simplified steps:

  • It estimates how dense the neighbourhood around each point is, using the distance to its nearby neighbours.
  • It connects points into a tree, from everything joined together down to individual points, as the density requirement rises.
  • It drops branches smaller than the minimum cluster size and keeps the clusters that persist longest across density levels.
  • Points that do not belong to any stable cluster get the label -1.

Unlike K-means, it does not ask for the number of clusters. The main settings are min_cluster_size (the smallest group you would call a cluster) and min_samples (how conservative it is; higher values mark more points as noise). It can also return a membership probability for each point. HDBSCAN is available as its own Python library and, since version 1.3, in scikit-learn.

How it’s used in SEO and marketing

  • Keyword clustering on embeddings, where many long-tail keywords do not belong to any theme.
  • Grouping pages by topic for internal linking and content hubs.
  • Finding outlier pages, unusual backlinks or anomalous traffic patterns.
  • Topic modelling inside BERTopic, where each HDBSCAN cluster becomes a topic.

Example

In BERTopic, document embeddings are first reduced with UMAP (to five dimensions by default), then HDBSCAN clusters them. In MLforSEO’s BERTopic test on 1,373 short titles, the model found seven topics on its own and left 7% of titles unassigned. Those unassigned titles are worth reading: they are often one-off posts, vague headlines or emerging topics.

Limitations and things to watch

  • The noise group can be large on messy data; lower min_samples or use BERTopic’s outlier reduction if you need every item assigned.
  • It struggles on raw high-dimensional embeddings, which is why it is paired with UMAP.
  • Results shift with min_cluster_size, so try a few values and check the clusters by eye.
  • It is slower than K-means on very large datasets.

Learn it on MLforSEO

Where HDBSCAN (Hierarchical Density-Based Spatial Clustering of Applications with Noise) shows up on MLforSEO

Sources and further reading

Other terms from ML Models & Algorithms

See all 55 ML Models & Algorithms terms →