View source: R/utils_clustering.R
compute_metric | R Documentation |
Metric will be computed from 2 to max_k clusters. Note that the row number in results will be different from k.
compute_metric(dmat, clusters, metric_name, max_k = 14)
dmat |
distance matrix output of |
clusters |
output of |
metric_name |
"silhouette" or "dunn" |
max_k |
maximum number of clusters to cut using |
a data frame with columns k
and score
data_to_cluster <- iris[c("Petal.Length", "Sepal.Length")]
dmat <- compute_dmat(data_to_cluster, "euclidean", TRUE)
clusters <- compute_clusters(dmat, "complete")
compute_metric(dmat, clusters, "dunn")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.