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.
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
Learn it in a course
Read about it on the blog
Sources and further reading
Other terms from ML Models & Algorithms
- BERT (Bidirectional Encoder Representations from Transformers)Google's 2018 transformer language model that reads text in both directions to produce context-aware embedding…
- BERTopicA modular topic modelling technique that clusters transformer embeddings and labels each cluster with class-ba…
- BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies)BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies) clusters very large numeric datasets by s…
- BM25A classic ranking function that scores documents by how often query words appear, adjusted for word rarity and…
- Boyer-MooreA fast exact string-search algorithm that compares a pattern from right to left and skips ahead after mismatch…
- c-TF-IDFClass-based TF-IDF: treats each cluster as one document to find the words that best describe it, used by BERTo…
- Centroid-based ClusteringA clustering family that groups data around central points (centroids), each the average of its cluster's memb…
- Convolutional Neural Network (CNN)A deep learning architecture that scans data with small learned filters to detect local patterns; the classic…
- DBSCANDensity-based clustering that groups closely packed points, finds the number of clusters itself and labels iso…


