2
$\begingroup$

I'm using optics from dbscan package:

set.seed(2)
n <- 400
x <- cbind(
  x = runif(4, 0, 1) + rnorm(n, sd=0.1),
  y = runif(4, 0, 1) + rnorm(n, sd=0.1)
)
plot(x, col=rep(1:4, time = 100))
### run OPTICS
res <- optics(x, eps = 1, minPts = 10)
### identify clusters by cutting the reachability plot (black is noise)
res <- optics_cut(res, eps_cl = .05)
plot(x, col = res$cluster+1L)
table(res$cluster)

minPts is set to 10, yet when looking at the output i get:

  0   1   2   3   4   5   6   7 
243  17  19  32  13   7  39  30 

How is it possible that cluster number 5 contains only 7 points while the minimum number of points should be 10? Am i missing something here?

-- edit

optics_cut is probably not enforcing minPts value, nevertheless dbscan itself gives weird results:

set.seed(2)
require(dbscan)
res <- dbscan(x, eps = .05, minPts = 10)
table(res$cluster)

  0   1   2   3   4   5   6   7 
231  32  21  33  42  16  17   8 

The same thing happens in fpc's implementation...

$\endgroup$

1 Answer 1

4
$\begingroup$

A DBSCAN cluster always has a minimum size of 1 core point.

minPts is not a minimum cluster size. It's a minimum density for core points.

Because border points may be "border" in multiple clusters, one cluster may "steal" them from another (it's in the DBSCAN article).

For OPTICS, I recommend trying the ELKI version with that OPTICSXi method. There is little use in doing a horizontal cut IMHO.

$\endgroup$
1
  • $\begingroup$ Thank you! I've also found this on wikipedia: While minPts intuitively is the minimum cluster size, in some cases DBSCAN can produce smaller clusters. A DBSCAN cluster consists of at least one core point. As other points may be border points to more than one cluster, there is no guarantee that at least minPts points are included in every cluster. $\endgroup$
    – Guy s
    Apr 21, 2016 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.