Skip to content

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.

Updated 24 Oct 2026· 2 min read

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

Sources and further reading

Other terms from ML Models & Algorithms

See all 55 ML Models & Algorithms terms →