View source: R/ClusterSilhouette.R
| ClusterSilhouette | R Documentation |
Mean Silhouette Width [Rousseeuw, 1987] evaluates a hard partition without a reference classification. Mean silhouette width; larger values are better.
ClusterSilhouette(Cls, DataOrDistances, DistanceMethod = "euclidean",
Silent = TRUE, ...)
Cls |
Vector of length n containing arbitrary numeric, character, or factor cluster labels. Missing labels and non-finite numeric labels are not allowed. Rows and labels are matched by position. Zero is an ordinary cluster label; remove noise observations explicitly if they should not be evaluated. |
DataOrDistances |
Finite numeric data matrix or data frame with n rows,
a symmetric n by n dissimilarity matrix with non-negative entries and a zero
diagonal, or a |
DistanceMethod |
Distance method for feature data, passed to
|
Silent |
Logical scalar. Suppresses the progress message for distance
calculation when |
... |
Further arguments for |
ClusterSilhouette wraps silhouette and returns
the observation-weighted mean silhouette width. A singleton has width zero.
At least two and at most n-1 clusters are required.
Malformed inputs cause an error. Undefined partitions produce a warning and return NaN. A missing optional cluster package gives NaN, a message, and an explanatory string in Object.
Pairwise distance storage is quadratic in the number of observations. No observations are subsampled.
This function is also called by ClusterNoEstimation.
The standalone function evaluates one given partition without selecting a
number of clusters.
List of
Silhouette |
Mean silhouette width; larger values are better. |
Object |
The |
Michael Thrun
[Rousseeuw, 1987] Rousseeuw, P. J.: Silhouettes: A graphical aid to the interpretation and validation of cluster analysis, Journal of Computational and Applied Mathematics, Vol. 20, pp. 53-65, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/0377-0427(87)90125-7")}, 1987.
ClusterNoEstimation,
ClusterDunnIndex,
ClusterDaviesBouldinIndex
Data = matrix(c(0, 1, 2, 10, 11, 12), ncol = 1)
Cls = rep(c(10, 20), each = 3)
if (requireNamespace("cluster", quietly = TRUE)) {
V = ClusterSilhouette(Cls, Data)
V$Silhouette
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.