Silhouette function | R Documentation |
Silhouette function.
silhouette(x, cl, type = "euclidean")
x |
A numerical matrix with the data. |
cl |
A numerical vector with the group clusterings. |
type |
The type of distance, by default it is the Euclidean. |
The silhouettes are computed.
A list including:
si |
A matrix with two columns, the clusters and the silhouette function, for each observation. |
stats |
A matrix with 4 columns. The number of observations in each cluster, the minimum, maximum and average silhouette for each cluster. |
Michail Tsagris and Nikolaos Kontemeniotis.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Nikolaos Kontemeniotis kontemeniotisn@gmail.com.
Rousseeuw P. J. (1987). Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. Journal of Computational and Applied Mathematics, 20, 53–65.
big.knn, eqdist.etest
x <- as.matrix( iris[1:100, 1:4] )
cl <- kmeans(x, 2)$cluster
silhouette(x, cl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.