qkspecc {qkerntool} | R Documentation |
qkernel spectral Clustering
Description
A qkernel spectral clustering algorithm. Clustering is performed by embedding the data into the subspace of the eigenvectors of a graph Laplacian matrix.
Usage
## S4 method for signature 'matrix'
qkspecc(x,kernel = "rbfbase", qpar = list(sigma = 2, q = 0.9),
Nocent=NA, normalize="symmetric", maxk=20, iterations=200,
na.action = na.omit, ...)
## S4 method for signature 'cndkernmatrix'
qkspecc(x, Nocent=NA, normalize="symmetric",
maxk=20,iterations=200, ...)
## S4 method for signature 'qkernmatrix'
qkspecc(x, Nocent=NA, normalize="symmetric",
maxk=20,iterations=200, ...)
Arguments
x |
the matrix of data to be clustered or a kernel Matrix of class
|
kernel |
the kernel function used in computing the affinity matrix. This parameter can be set to any function, of class kernel, which computes a kernel function value between two vector arguments. kernlab provides the most popular kernel functions which can be used by setting the kernel parameter to the following strings:
The kernel parameter can also be set to a user defined function of class kernel by passing the function name as an argument. |
qpar |
a character string or the list of hyper-parameters (kernel parameters).
The default character string
Hyper-parameters for user defined kernels can be passed through the qpar parameter as well. |
Nocent |
the number of clusters. |
normalize |
Normalisation of the Laplacian ("none", "symmetric" or "random-walk"). |
maxk |
If k is NA, an upper bound for the automatic estimation. Defaults to 20. |
iterations |
the maximum number of iterations allowed. |
na.action |
the action to perform on NA. |
... |
additional parameters. |
Details
The qkernel spectral clustering works by embedding the data points of the
partitioning problem into the subspace of the eigenvectors corresponding to the k
smallest eigenvalues of the graph Laplacian matrix. Using a simple clustering method like
kmeans
on the embedded points usually leads to good performance. It can be shown that
qkernel spectral clustering methods boil down to graph partitioning.
The data can be passed to the qkspecc
function in a matrix
,
in addition qkspecc
also supports input in the form of a
kernel matrix of class qkernmatrix
or cndkernmatrix
.
Value
An S4 object of class qkspecc
which extends the class vector
containing integers indicating the cluster to which
each point is allocated. The following slots contain useful information
clust |
The cluster assignments |
eVec |
The corresponding eigenvector |
eVal |
The corresponding eigenvalues |
ymatrix |
The eigenvectors corresponding to the |
Author(s)
Yusen Zhang
yusenzhang@126.com
References
Andrew Y. Ng, Michael I. Jordan, Yair Weiss
On Spectral Clustering: Analysis and an Algorithm
Neural Information Processing Symposium 2001
See Also
qkernmatrix
, cndkernmatrix
, qkpca
Examples
data("iris")
x=as.matrix(iris[,-5])
qspe <- qkspecc(x,kernel = "rbfbase", qpar = list(sigma = 10, q = 0.9),
Nocent=3, normalize="symmetric", maxk=15, iterations=1200)
plot(x, col = clust(qspe))
qkfunc <- nonlbase(alpha=1/15,q=0.8)
Ktrain <- qkernmatrix(qkfunc, x)
qspe <- qkspecc(Ktrain, Nocent=3, normalize="symmetric", maxk=20)
plot(x, col = clust(qspe))