dbscan (version 0.9-2)

optics: OPTICS

Description

Implementation of the OPTICS (Ordering points to identify the clustering structure) clustering algorithm using a kd-tree.

Usage

optics(x, eps, minPts = 5, eps_cl,
    search = "kdtree", bucketSize = 10,
    splitRule = "suggest", approx = 0)

Arguments

Value

An object of class 'optics' with components:epsvalue of eps parameter.minPtsvalue of minPts parameter.orderorder for points.reachdistreachability distance for each point.coredistcore distance for each point.If eps_cl was specified the following additional components are available:eps_clreachability distance for each point.clusterassigned cluster labels in the order of the rows in x.

Details

This implementation of OPTICS implements the original algorithm as described by Ankers et al (1999). OPTICS is similar to DBSCAN, however, for OPTICS eps is only an upper limit for the neighborhood size used to reduce computational complexity.

OPTICS linearly orders the data points such that points which are spatially closest become neighbors in the ordering. The closest analog to this ordering is dendrogram in single-link hierarchical clustering. The algorithm also calculates the reachability distance for each point. plot() produces a reachability-plot which shows each points reachability distance where the points are sorted by OPTICS. Valleys represent clusters (the deeper the valley, the more dense the cluster) and high points indicate points between clusters.

If epc_cl is specified, then an algorithm to extract clusters (see Ankers et al, 1999) is used.

See kNN for more information on the other parameters related to kNN search.

References

Mihael Ankerst, Markus M. Breunig, Hans-Peter Kriegel, Joerg Sander (1999). OPTICS: Ordering Points To Identify the Clustering Structure. ACM SIGMOD international conference on Management of data. ACM Press. pp. 49--60.

See Also

dbscan in fpc.

Examples

Run this code
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)
res

### get order
res$order

### plot produces a reachability plot
plot(res)

### run OPTICS with cluster identification (black is noise)
res <- optics(x, eps = 1,  minPts = 10, eps_cl = .07)
res

plot(res)
plot(x, col = res$cluster+1)

Run the code above in your browser using DataCamp Workspace