compute_metric: Compute an internal evaluation metric for clustered data

View source: R/utils_clustering.R

compute_metricR Documentation

Compute an internal evaluation metric for clustered data

Description

Metric will be computed from 2 to max_k clusters. Note that the row number in results will be different from k.

Usage

compute_metric(dmat, clusters, metric_name, max_k = 14)

Arguments

dmat

distance matrix output of compute_dmat() or stats::dist()

clusters

output of compute_clusters() or fastcluster::hclust()

metric_name

"silhouette" or "dunn"

max_k

maximum number of clusters to cut using dendextend::cutree(). Default is 14.

Value

a data frame with columns k and score

Examples

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")

visxhclust documentation built on March 31, 2023, 7:30 p.m.