optimal_score {visxhclust} | R Documentation |
Find minimum or maximum score in a vector
Description
This function is meant to be used with compute_metric. For Gap statistic,
use cluster::maxSE()
.
Usage
optimal_score(x, method = c("firstmax", "globalmax", "firstmin", "globalmin"))
Arguments
x |
a numeric vector |
method |
one of "firstmax", "globalmax", "firstmin" or "globalmin" |
Value
the index (not k) of the identified maximum or minimum score
Examples
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")
[Package visxhclust version 1.1.0 Index]