The one idea: DBSCAN groups points by density instead of distance-to-a-center — a cluster is any region where points are packed tightly enough, connected chain by chain, regardless of what shape that region traces out. It needs no K, and points that don't belong to any dense region get labeled noise instead of being forced into a cluster. That's the exact fix for K-Means' two biggest weaknesses: forcing round shapes, and never admitting a point doesn't fit anywhere.
⚠️ The trap: DBSCAN looks like it "just works" once it runs without erroring, and its hyperparameters (eps,min_samples) feel like a formality to set once and forget. They aren't. A single globalepsassumes every true cluster is roughly the same density — feed it a dataset with one tight cluster and one sparse one, and DBSCAN will either merge the sparse cluster into noise or shred the tight one into scattered points, because one epsilon can't be simultaneously right for both. Density-based clustering trades "wrong shape assumption" for "wrong density assumption" — it doesn't eliminate the assumption, it moves it.
K-Means' lesson ended on a cliffhanger: crescents, rings, and clusters of unequal spread all break its round, similarly-sized-territory assumption, and the fix was "try DBSCAN." This lesson is that fix, worked through on exactly the shapes that broke K-Means.
The algorithm: three kinds of points, one epsilon
DBSCAN (Density-Based Spatial Clustering of Applications with Noise) needs two hyperparameters instead of K:
eps(ε) — the radius of a neighborhood around each point.min_samples— how many points (including the point itself) must fall within that radius for the neighborhood to…
Keep reading: Dbscan and Density Based Clustering
Unlock the full Machine Learning track — every lesson, the AI tutor, and full mock assessments.
- Full lesson content
- AI tutor for this section
- Practice questions