DBSCAN Clustering

Density-based clustering with noise detection. Groups data points by density, automatically detecting the number of clusters and identifying noise/outlier…

Groups data points by density, automatically detecting the number of clusters and identifying noise/outlier points that don't belong to any cluster.

What Is DBSCAN Clustering?

DBSCAN (Density-Based Spatial Clustering of Applications with Noise) groups data points that are closely packed together, marking points in low-density regions as outliers (noise). Unlike K-Means, DBSCAN does not require specifying the number of clusters in advance and can find arbitrarily shaped clusters.

The algorithm uses two parameters: epsilon (eps) — the maximum distance between two points to be considered neighbors — and minSamples — the minimum number of points within eps distance to form a dense region. Core points have ≥ minSamples neighbors; border points are within eps of a core point; noise points are neither.

DBSCAN is particularly effective for datasets with clusters of varying density, non-convex shapes (crescents, rings), and significant noise. However, it struggles when clusters have very different densities, as a single eps value cannot accommodate both.

Formula: Core point: |N_eps(p)| ≥ minSamples Border point: |N_eps(p)| < minSamples but within eps of a core point Noise: neither core nor border N_eps(p) = {q : dist(p,q) ≤ eps}

Example Calculation

Points: (1,1), (1.1,1.2), (0.9,0.8), (5,5), (5.1,5.2), (4.9,4.8), (10,10). eps=1.0, minSamples=2. Cluster 1: {(1,1),(1.1,1.2),(0.9,0.8)} — all within eps of each other. Cluster 2: {(5,5),(5.1,5.2),(4.9,4.8)}. Noise: {(10,10)} — no neighbors within eps.

When to Use This Calculator

Common Mistakes to Avoid

How to Interpret Results

Related Standards & References

Frequently Asked Questions

How do I choose eps and minSamples?

For minSamples, a common heuristic is 2 × number_of_dimensions. For eps, plot the k-nearest-neighbor distance (k = minSamples) for all points, sorted in ascending order. The 'knee' of this curve suggests a good eps value. Too small eps produces many noise points; too large eps merges distinct clusters.

When should I use DBSCAN instead of K-Means?

Use DBSCAN when you do not know the number of clusters, when clusters have irregular shapes, or when the data contains significant noise/outliers. K-Means is faster and works well when clusters are spherical and roughly equal-sized. For varying-density clusters, consider HDBSCAN or OPTICS.