Classical & Statistical Learning

DBSCAN

/ DEE-bee-skan /

DBSCAN finds clusters by following the crowds: a cluster is simply a region where the points are packed densely together, separated from other clusters by sparse, empty space. Think of a satellite photo of a country at night — cities glow as dense blobs of light, with dark countryside between them. DBSCAN draws the boundaries of those bright patches no matter their shape, and crucially, it labels the scattered, lonely points in the dark as noise rather than forcing them into a city they don't belong to.

It works with two settings: a radius (how close counts as "near") and a minimum count of neighbors needed to call a spot "crowded." A point with enough neighbors inside its radius is a core point, the heart of a cluster. The algorithm starts at a core point and greedily absorbs every neighbor, and their neighbors, snaking outward through the dense region until the density drops off. Points on the thin edge get pulled in; truly isolated points are left alone and tagged as outliers. Clusters grow organically into whatever shape the density takes.

Its two standout gifts are exactly where k-means fails: it discovers the number of clusters by itself (you never specify it), and it can trace long, curving, irregular shapes — two interlocking crescents, a spiral — that round-cluster methods can't. It's a favorite for spatial data, anomaly detection, and messy real-world point clouds. The honest limits: it struggles when different clusters have very different densities (one radius can't fit both), and choosing that radius is finicky — set it wrong and you either fuse everything into one blob or shatter it into dust.

Two interlocking crescent shapes of points, plus a few scattered specks. k-means would slice both crescents in half with a straight line. DBSCAN, following density, traces each crescent perfectly as one cluster — and flags the lonely specks as noise, belonging to neither. No need to tell it there were two groups.

Density-defined clusters of any shape — and the freedom to call a point "noise."

DBSCAN's killer feature is that it can label points as noise instead of forcing every one into a cluster — perfect for finding outliers. But it assumes clusters share a similar density; when they don't, a single radius setting can't serve them all.

Also called
density-based spatial clustering基于密度的聚类基於密度的聚類密度聚类