# A routine to choose eps and minPts for DBSCAN

DBSCAN is most cited clustering algorithm according to some literature and it can find arbitrary shape clusters based on density. It has two parameters eps (as neighborhood radius) and minPts (as minimum neighbors to consider a point as core point) which I believe it highly depends on them.

Is there any routine or commonly used method to choose these parameters?

There are plenty of publications that propose methods to choose these parameters.

The most notable is OPTICS, a DBSCAN variation that does away with the epsilon parameter; it produces a hierarchical result that can roughly be seen as "running DBSCAN with every possible epsilon".

For minPts, I do suggest to not rely on an automatic method, but on your domain knowledge.

A good clustering algorithm has parameters, that allow you to customize it to your needs.

A parameter that you overlooked is the distance function. The first thing to do for DBSCAN is to find a good distance function for your application. Do not rely on Euclidean distance being the best for every application!

• Although user can choose distance function, I doubt it is a parameter. – Mehraban Mar 10 '14 at 7:06
• Of course it is. It is as much a parameter as the kernel function for any other kernelized method (you can in fact kernelize DBSCAN trivially this way), and in my experience other distances such as Canberra or Clark can significantly improve results. – Anony-Mousse Mar 10 '14 at 7:25
• I don't underestimate the distance function influence on clustering, But I think it is somehow general, not specific to dbscan or every other clustering algorithm; while eps and minPts are explicitly dbscan parameters. – Mehraban Mar 10 '14 at 11:26
• There are plenty of non-distance-based algorithms, too. And when you consider minPts to be the same as e.g. k for nearest neighbor classification, then you could say the same for the minPts parameter. I guess the main difference is that for distance, there is an "often" sensible default: Euclidean distance; whereas for minPts the value will be data specific. – Anony-Mousse Mar 10 '14 at 11:40
• OPTICS itself will not give you partitions, but a cluster order. To get partitions, use the xi extraction described in the OPTICS paper. See each variants paper to understand the differences. – Anony-Mousse Feb 5 '18 at 7:45