Skip to content

ML Models & Algorithms

DBSCAN

In shortDensity-based clustering that groups closely packed points, finds the number of clusters itself and labels isolated points as noise.

Updated 24 Oct 2026· 2 min read

DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is an unsupervised clustering algorithm that treats clusters as dense regions of data separated by sparser areas. Unlike K-means, you do not tell it how many clusters to find, and it leaves points that do not belong anywhere unassigned as noise, which makes it useful for anomaly detection.

How it works

DBSCAN, published by Ester and colleagues in 1996, uses two settings:

  • eps: the maximum distance at which two points count as neighbours.
  • min_samples: how many neighbours a point needs within eps to be a “core” point.

Core points that are within reach of each other are chained into the same cluster. Points near a core point join its cluster as border points. Anything else is labelled noise (in scikit-learn, cluster -1). Because clusters grow by chaining, they can take any shape, unlike the round clusters K-means produces.

How it’s used in SEO and marketing

  • Customer segmentation with several behavioural features, where some customers genuinely do not fit a segment (MLforSEO’s customer segmentation resource uses DBSCAN as its advanced approach).
  • Finding outlier pages, queries or traffic patterns that deserve a closer look.
  • Grouping competitor websites by characteristics without fixing the number of groups in advance.
  • Clustering page or keyword embeddings where you would rather leave odd items out than force them into a cluster.

Example

You cluster 5,000 customers by recency, frequency, order value and product categories. K-means would push every customer into one of your chosen number of segments. DBSCAN finds four dense groups, such as frequent small-basket buyers and occasional big spenders, and marks 3% of customers as noise. Those outliers are often the most interesting: wholesale buyers, fraud or data errors.

Limitations and things to watch

  • Results are very sensitive to eps: too small and most data becomes noise, too large and clusters merge. A k-distance plot helps choose it.
  • A single eps struggles when clusters have different densities; HDBSCAN was designed to fix this.
  • Distances become less meaningful in high dimensions, so reduce embeddings first (for example with UMAP).
  • Scale numeric features before clustering, or one large-valued feature will dominate the distance.

Learn it on MLforSEO

Where DBSCAN shows up on MLforSEO

Sources and further reading

Other terms from ML Models & Algorithms

See all 55 ML Models & Algorithms terms →