arandi | R Documentation |
Computes the adjusted or unadjusted Rand index between two clusterings/partitions of the same objects.
arandi(cl1, cl2, adjust = TRUE)
cl1,cl2 |
vectors of cluster memberships (need to have the same lengths). |
adjust |
logical. Should index be adjusted? Defaults to TRUE. |
The Rand index is based on how often the two clusterings agree in the treatment of pairs of observations,
where agreement means that two observations are in/not in the same cluster in both clusterings.
The adjusted Rand index adjusts for the expected number of chance agreements.
Formulas of Hubert and Arabie (1985) are used for the computation.
Arno Fritsch, arno.fritsch@tu-dortmund.de
Hubert, L. and Arabie, P. (1985): Comparing partitions. Journal of Classification, 2, 193–218.
vi.dist
cl1 <- sample(1:3,10,replace=TRUE) cl2 <- c(cl1[1:5], sample(1:3,5,replace=TRUE)) arandi(cl1,cl2) arandi(cl1,cl2,adjust=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.