ML Models & Algorithms
Density-based Clustering
In shortClustering that groups points in dense regions, finds the number of clusters itself and leaves isolated points unassigned as noise.
Density-based clustering is a family of clustering methods that defines a cluster as a crowded region of data, separated from other crowded regions by sparse space. It works out how many clusters there are on its own, can find clusters of any shape, and leaves points that sit in empty space unassigned. DBSCAN, HDBSCAN, OPTICS and Mean Shift are the best-known examples.
How it works
Take DBSCAN, the classic algorithm. It has two settings: a radius (eps) and a minimum number of neighbours (min_samples).
- A point with at least min_samples neighbours within the radius is a core point.
- Core points that are within reach of each other are joined into the same cluster.
- Points near a core point but without enough neighbours of their own become border points of that cluster.
- Everything else is noise and gets the label -1.
HDBSCAN extends this by trying many density levels and keeping the most stable clusters, so it copes with clusters of different densities and you do not need to choose a radius.
This contrasts with centroid-based clustering such as K-means, where you must set the number of clusters up front, every point is forced into a cluster and clusters tend to be round.
How it’s used in SEO and marketing
- Keyword and content clustering on embeddings, where many items genuinely fit no topic.
- Spotting anomalies: unusual traffic spikes, spammy backlinks or odd customer behaviour show up as noise points.
- Local SEO: grouping locations or listings that sit close together geographically.
- Topic modelling: BERTopic and Top2Vec use HDBSCAN as their clustering step.
Example
MLforSEO’s guide to automating internal linking clusters pages by their embeddings with K-means by default, then recommends switching to HDBSCAN on big, messy sites because it “is allowed to say this page doesn’t belong to any cluster”. Those unassigned pages are often the orphans, thin pages or one-off posts worth reviewing on their own.
Limitations and things to watch
- Results are sensitive to the settings; small changes to eps or min_cluster_size can merge or split clusters.
- Distance becomes less meaningful in very high dimensions, so embeddings are usually reduced first (for example with UMAP).
- A large noise group is not always a failure, but check it before discarding those points.
- DBSCAN struggles when clusters have very different densities; HDBSCAN handles that better.
Learn it on MLforSEO
Where Density-based Clustering shows up on MLforSEO
Learn it in a course
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…