R/main.R
cluster_metric.Rd
Compute adjusted Rand index and normalized mutual information
cluster_metric(hy, y, type = c("ARI", "NMI"))
a vector, the predicted clusters
a vector, the true clusters
a string, the type of cluster metric, one of "ARI" and "NMI", default as "ARI".
y <- rep(1:4, each=100) hy <- rep(1:5, each=80) cluster_metric(y, hy) #> [1] 0.567714