A numeric value indicating how much the two sets of clusters are similar.
Arguments
clus
The extracted clusters.
gt
The real clusters.
comp
How the two partitions are compared. "max" matches each extracted
cluster with the class it agrees with most and averages the per-cluster scores, weighted by
cluster size; "cluster" returns those scores instead of averaging them;
"pairwise" ignores the labels and looks at every pair of observations, asking whether
the two partitions agree on grouping it or separating it.
In "pairwise" mode this function is the Rand index: the proportion of pairs
the two partitions agree on, counting both those they group and those they keep apart. See
compare.jaccard and compare.kappa for the two other readings
of the same pair counts.
The pairwise index
Cohen's kappa on the fourfold table of pair
agreements, i.e. the Rand index of compare.accuracy corrected for the
agreement expected by chance. That quantity is also the Hubert-Arabie adjusted Rand
index -- a theorem of Warrens (2008), not a substitution.
References
Warrens, M.J. (2008). On the Equivalence of Cohen's Kappa and the Hubert-Arabie
Adjusted Rand Index. Journal of Classification, 25(2), 177-183.