View source: R/external_cluster_validity.R
NMI | R Documentation |
Computes the Normalized Mutual Information betwen two partitions
NMI(clusters, classes)
clusters |
A vector of cluster assignments |
classes |
A vector giving the true classes of the objects |
This code comes directly from the package 'clue': https://github.com/cran/clue/blob/098da43010f3803294b4e8403328ee5c0216abf7/R/agreement.R#L161
Hornik K (2017). _clue: Cluster ensembles_. R package version 0.3-53, <URL: https://CRAN.R-project.org/package=clue>.
Hornik K (2005). “A CLUE for CLUster Ensembles.” _Journal of Statistical Software_, *14*(12). doi: 10.18637/jss.v014.i12 (URL: http://doi.org/10.18637/jss.v014.i12).
Numeric
clusters <- c(0, 0, 2, 1, 1, 0, 1)
classes <- c("A", "A", "A", "B", "B", "A", "B")
NMI(clusters, classes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.