kmeansDist | R Documentation |
Perform k-means clustering on a distance matrix
kmeansDist(Distance, ClusterNo=2,Centers=NULL,
RandomNo=1,maxIt = 2000,
PlotIt=FALSE,verbose = F)
Distance |
Distance matrix. For n data points of the dimension n x n |
ClusterNo |
A number k which defines k different clusters to be built by the algorithm. |
Centers |
Default(NULL) a set of initial (distinct) cluster centres. |
RandomNo |
If>1: Number of random initializations with searching for minimal SSE is defined by this scalar |
maxIt |
Optional: Maximum number of iterations before the algorithm terminates. |
PlotIt |
Default: FALSE, If TRUE plots the first three dimensions of the dataset with colored three-dimensional data points defined by the clustering stored in |
verbose |
Optional: Algorithm always outputs current iteration. |
Cls[1:n] |
[1:n] numerical vector with n numbers defining the classification as the main output of the clustering algorithm. It has k unique numbers representing the arbitrary labels of the clustering. |
centerids[1:k] |
Indices of the centroids from which the cluster Cls was created |
Currently an experimental version
Felix Pape, Michael Thrun
data('Hepta')
#out=kmeansDist(as.matrix(dist(Hepta$Data)),ClusterNo=7,PlotIt=FALSE,RandomNo = 10)
## Not run:
data('Leukemia')
#as expected does not perform well
#for non-spherical cluster structures:
#out=kmeansDist(Leukemia$DistanceMatrix,ClusterNo=6,PlotIt=TRUE,RandomNo=10)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.