DBSCAN: Density-Based Clustering

Clusters defined by crowding rather than by distance to a centre, which is why it finds shapes k-means cannot.

DBSCAN: Density-Based Clustering

This module needs JavaScript: the numbers are computed in the page rather than recorded.

Worth knowing

A core point has at least minPts neighbours within eps. Clusters grow outward from core points.
Points reachable from a core point but not core themselves are border points. Everything else is noise.
You never say how many clusters to find. The density parameters decide, and the count falls out.
Because clusters spread through connected dense regions, they can be any shape at all — which is what k-means cannot do.

Overview

DBSCAN groups points with dense neighbourhoods instead of requiring a preset cluster count. eps sets the neighbourhood radius and minPts sets how many points must be nearby, including the point itself; sparse points can remain noise.

In this guide
  1. Core, border, and noise points
  2. Explore the parameters
  3. When DBSCAN is a good fit
  4. Common mistakes with DBSCAN
  5. Sources and next steps
  • A core point has at least minPts points in its eps neighbourhood.
  • A border point is within eps of a core point but has too few neighbours to be core.
  • A noise point is neither core nor reachable from one.

Starting from a core point, DBSCAN expands through neighbouring core points and includes their border points. A chain of connected dense regions can trace a curved cluster; no distance to a cluster centre is used.

Explore the parameters

Choose Data as Two crescents, then adjust eps (neighbourhood radius) and minPts. If eps is too small, points become noise or clusters fragment. If it is too large, separate groups can merge. Raising minPts requires stronger local support, which often labels more points as noise. Switch Data to Three blobs and some noise and compare how points are assigned.

These settings depend on feature scale and distance metric. Standardize features when their units or ranges differ substantially; otherwise a large-scale feature can dominate the neighbourhood distance. A sorted k-distance plot can help identify a candidate eps, but its knee is a heuristic that still needs validation.

When DBSCAN is a good fit

It is useful when clusters may be non-convex, the number of groups is unknown, and outliers should not be forced into a cluster. K-means is often simpler and faster for compact, similarly scaled groups when every point needs an assignment.

DBSCAN struggles when groups have very different densities because one radius may be too small for a sparse group and too large for a dense one. High-dimensional distances can also become less informative. HDBSCAN explores density structure across scales and may help, but it brings its own choices and is not a universal fix.

Common mistakes with DBSCAN

  • Using unscaled features with incompatible units: the radius then reflects the largest-scale feature.
  • Treating noise as an error: noise is a legitimate output; inspect it before deciding what it means.
  • Assuming the number of groups is always recovered: parameter settings can merge, split, or erase clusters.
  • Using DBSCAN as a predictor for new points without checking support: the original method labels a fitted dataset; new-point assignment needs a defined procedure.

Sources and next steps

Check yourself

0 of 3

Answer without scrolling back up.

  1. Why can DBSCAN separate two interleaved crescents when k-means cannot?

  2. What is a border point?

  3. What is DBSCAN's main structural weakness?

Cheat sheet

DBSCAN: Density-Based Clustering

Set epsilon and minPts, then watch DBSCAN grow clusters by density. See how it finds arbitrary shapes, labels noise, and never asks you to choose k.

MACHINE LEARNING · vizlearn.in/machine_learning/dbscan_clustering.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.

Teaching a course with this? Individual teachers can use it freely; for a whole department or programme, see institutional licences.