## S3 method for class 'formula':
specc(x, data = NULL, na.action = na.omit, ...)## S3 method for class 'matrix':
specc(x, centers, kernel = "rbfdot", kpar = "automatic",
nystrom.red = FALSE, nystrom.sample = dim(x)[1]/6, iterations = 200,
mod.sample = 0.75, na.action = na.omit, ...)
## S3 method for class 'kernelMatrix':
specc(x, centers, nystrom.red = FALSE, iterations = 200, ...)
## S3 method for class 'list':
specc(x, centers, kernel = "stringdot", kpar = list(length=4, lambda=0.5),
nystrom.red = FALSE, nystrom.sample = length(x)/6, iterations = 200,
mod.sample = 0.75, na.action = na.omit, ...)
kernelMatrix, or a list of character vectors."automatic" uses a heuristic to determine a
suitable value for the width parameter of the RBF kernel.
The second option "loTRUE a sample of the dataset is used to calculate the
eigenvalues, thus only a $n x m$ matrix where $n$ the sample size
is stored in memory (default: FALSEspecc wich extends the class vector
containing integers indicating the cluster to which
each point is allocated. The following slots contain useful informationkmeans on the embedded points usually
leads to good performance. It can be shown that spectral clustering methods boil down to
graph partitioning.
The data can be passed to the specc function in a matrix or a
data.frame, in addition specc also supports input in the form of a
kernel matrix of class kernelMatrix or as a list of character
vectors where a string kernel has to be used.kkmeans, kpca, kcca## Cluster the spirals data set.
data(spirals)
sc <- specc(spirals, centers=2)
sc
centers(sc)
size(sc)
withinss(sc)
plot(spirals, col=sc)Run the code above in your browser using DataLab