Computes the Adjusted Rand Index (ARI) between two cluster assignment vectors. The ARI measures the similarity between two partitions, corrected for chance. It equals 1 for identical partitions and has an expected value of 0 for independent (random) partitions.
See also
Other Utilities:
is.CS(),
preserve.cl(),
setup.model()
Examples
# Perfect agreement
cl1 <- c(1, 1, 2, 2, 3, 3)
cl2 <- c(2, 2, 1, 1, 3, 3) # same partition, different labels
ARI(cl1, cl2) # should be 1
#> [1] 1
# Random agreement
set.seed(1)
cl1 <- sample(1:3, 100, replace = TRUE)
cl2 <- sample(1:3, 100, replace = TRUE)
ARI(cl1, cl2) # close to 0
#> [1] -0.01201092