Rand Index and Rand Index corrected/adjusted for chance for comparing partitions (Hubert & Arabie, 1985). The functions also support computing these indices on partitions on multiple sets (where a "combined" partition is a list of multiple partitions). The names of the clusters do not matter.
rand(clu1, clu2, tab)crand(
clu1,
clu2,
tab,
multiSets = c("weights", "unlist"),
weights = c("size", "equal"),
returnIndividual = "attr"
)
rand2(clu1, clu2)
crand2(clu1, clu2)
The value of Rand Index (corrected/adjusted for chance) unless multiSets="weight" and returnIndividual=FALSE. In this case, a list with two items is return. The "global" index is in global, while the the indices by sets are in bySets.
The first of the two partitions to be compared, given in the form of vectors, where for each unit a cluster membership is given. Alternatively, this can be a contingency table obtained as a table(clu1, clu2). If a partition, clu2 must also be provided. In case of multiple sets, this should be pa list of partitions.
If clu1 is partition or a list of partitions, this must be a comaptible the second partition or list of partitions.
A contingency table obtained as a table(clu1, clu2). This is included for back-compatibility reasons. If this is present, all other arguments are ignored.
How should we compute the index in case of multiple sets of unis (if clu1 and clu2 are lists of partitions)? Possible values are "unlist" and "weight" (the default).
Weights to be used if multiSets is "weight". It can be "equal", "size" (default) or a numeric (non-negative) vector of the same length as the number of sets (the number of partitions in the list of partitions).
If multiSets is "weight", should the indices for individual sets be also returned. If TRUE, the function returns a list instead of a single value. If the values is "attr" (the default), the indices by sets are given as an attribute "bySets"
Aleš Žiberna
Hubert, L., & Arabie, P. (1985). Comparing Partitions. Journal of Classification, 2(1), 193-218.