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...