mrand | R Documentation |
Performs the Adjusted Rand Index on a confusion matrix (row-by-column product of two partition-matrices). ARI is a measure of the similarity between two data clusterings.
mrand(N)
N |
Confusion matrix. |
mri |
Adjusted Rand Index of a confusion matrix (scalar). |
Ionel Prunila, Maurizio Vichi
Rand W. M. (1971) "Objective criteria for the evaluation of clustering methods" <doi:10.2307/2284239>
# Iris data
# Loading the numeric variables of iris data
iris <- as.matrix(iris[,-5])
# standardizing the data
iris <- scale(iris)
# double k-means with 3 unit-clusters and 2 components for the variables
p1 <- redkm(iris, K = 3, Q = 2, Rndstart = 10)
p2 <- doublekm(iris, K=3, Q=2, Rndstart = 10)
mri <- mrand(t(p1$U)%*%p2$U)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.