Compute adjusted Rand index and normalized mutual information

cluster_metric(hy, y, type = c("ARI", "NMI"))

Arguments

hy

a vector, the predicted clusters

y

a vector, the true clusters

type

a string, the type of cluster metric, one of "ARI" and "NMI", default as "ARI".

Examples

y <- rep(1:4, each=100)
hy <- rep(1:5, each=80)
cluster_metric(y, hy)
#> [1] 0.567714