Choosing Epsilon and MinPts Parameters
What you'll learn: How to select the right epsilon (ε) and MinPts hyperparameters for DBSCAN using practical strategies.
The Challenge
DBSCAN's performance hinges on two critical parameters: epsilon (the neighborhood radius) and MinPts (minimum points to form a core point). Unlike K-Means where you pick K clusters, here you're defining what "dense enough" means—and choosing poorly can fragment natural clusters or merge distinct ones.
Strategy 1: The K-Distance Plot
The most reliable approach uses a k-distance graph:
- For each point, calculate the distance to its k-th nearest neighbor (where k = MinPts)
- Sort these distances in ascending order
- Plot them as a curve
- Look for the "elbow"—where the curve sharply rises
The elbow indicates where distances jump significantly, suggesting the boundary between dense regions and noise. This inflection point gives you a good epsilon value.
Think of it like: Imagine plotting home prices sorted by distance from downtown. The elbow shows where "downtown neighborhoods" end and "suburbs" begin—that's your natural boundary.
Strategy 2: Domain Knowledge
Use what you know about your problem:
- MinPts: A common rule of thumb is
MinPts = 2 × dimensions, with a minimum of 4 for 2D data - Epsilon: Consider the physical meaning—if clustering GPS coordinates, what distance (in meters) defines "nearby"?
Practical Tips
- Start with the k-distance plot for epsilon, then fine-tune
- Higher dimensions need larger MinPts to be statistically meaningful
- Test multiple values and compare using Silhouette Score
Key Takeaway: Use k-distance plots to find the "elbow" for epsilon selection, and apply domain knowledge for MinPts—typically starting with 2× your feature dimensions.