adjustedRand {clues} | R Documentation |
Calculate the five agreement indices: Rand index, Hubert and Arabie's adjusted Rand index, Morey and Agresti's adjusted Rand index, Fowlkes and Mallows's index, and Jaccard index, which measure the agreement between any two partitions for a data set.
adjustedRand(cl1, cl2, randMethod = c("Rand", "HA", "MA", "FM", "Jaccard"))
cl1 |
partition 1 of a data set. |
cl2 |
partition 2 of a data set. cl2 must have the same length as cl1 , but could have different number of clusters. |
randMethod |
specifies the prefered external index to meaure the agreement between the
two partitions cl1 and cl2 . Available indices are:
“Rand” (Rand index which is also the default value),
“HA” (Hubert and Arabie's adjusted Rand index),
“MA” (Morey and Agresti's adjusted Rand index),
“FM” (Fowlkes and Mallows's index),
“Jaccard” (Jaccard index).
|
Returns a vector of the index values.
Milligan, G.W. and Cooper, M.C. (1986) A study of the comparability of external criteria for hierarchical cluster analysis. Multivariate Behavioral Research 21, 441–458.
Wang, S., Qiu, W., and Zamar, R. H. (2007). CLUES: A non-parametric clustering method based on local shrinking. Computational Statistics & Data Analysis, Vol. 52, issue 1, pages 286-298.
cl1 <- c(1, 1, 1, 2, 2, 2, 2, 2) cl2 <- c(1, 2, 1, 2, 1, 2, 1, 3) adjustedRand(cl1, cl2) # perfect agreement cl1 <- c(1, 1, 2, 2) cl2 <- cl1 adjustedRand(cl1, cl2) # Ruspini data data(Ruspini) ruspini <- Ruspini$ruspini # cluster membership ruspini.mem <- Ruspini$ruspini.mem # partition by clues cl2 <- clues(ruspini, quiet = TRUE)$mem adjustedRand(ruspini.mem, cl2)