View source: R/measures_clusterings.R
adj_rand_index | R Documentation |
Computes the adjusted Rand index (ARI) between two clusterings, such as a predicted and ground truth clustering.
adj_rand_index(true, pred)
true |
ground truth clustering represented as a membership vector. Each entry corresponds to an element and the value identifies the assigned cluster. The specific values of the cluster identifiers are arbitrary. |
pred |
predicted clustering represented as a membership vector. |
The adjusted Rand index (ARI) is a variant of the Rand index (RI) which is corrected for chance using the Permutation Model for clusterings. It is related to the RI as follows:
\frac{RI - E(RI)}{1 - E(RI)},
where E(RI)
is the expected value of the RI under the Permutation
Model.
Unlike the RI, the ARI takes values in the range -1 to 1. A value
of 1 indicates that the clusterings are identical, while a value of
0 indicates the clusterings are drawn randomly independent of one
another.
Hubert, L., Arabie, P. "Comparing partitions." Journal of Classification 2, 193–218 (1985). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/BF01908075")}
true <- c(1,1,1,2,2) # ground truth clustering
pred <- c(1,1,2,2,2) # predicted clustering
adj_rand_index(true, pred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.