View source: R/utils_clustering.R
optimal_score | R Documentation |
This function is meant to be used with compute_metric. For Gap statistic,
use cluster::maxSE()
.
optimal_score(x, method = c("firstmax", "globalmax", "firstmin", "globalmin"))
x |
a numeric vector |
method |
one of "firstmax", "globalmax", "firstmin" or "globalmin" |
the index (not k) of the identified maximum or minimum score
data_to_cluster <- iris[c("Petal.Length", "Sepal.Length")]
dmat <- compute_dmat(data_to_cluster, "euclidean", TRUE)
clusters <- compute_clusters(dmat, "complete")
res <- compute_metric(dmat, clusters, "dunn")
optimal_score(res$score, method = "firstmax")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.