adj_rand_index: Adjusted Rand Index Between Clusterings

View source: R/measures_clusterings.R

adj_rand_indexR Documentation

Adjusted Rand Index Between Clusterings

Description

Computes the adjusted Rand index (ARI) between two clusterings, such as a predicted and ground truth clustering.

Usage

adj_rand_index(true, pred)

Arguments

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.

Details

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.

References

Hubert, L., Arabie, P. "Comparing partitions." Journal of Classification 2, 193–218 (1985). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/BF01908075")}

Examples

true <- c(1,1,1,2,2)  # ground truth clustering
pred <- c(1,1,2,2,2)  # predicted clustering
adj_rand_index(true, pred)


clevr documentation built on Sept. 16, 2023, 5:06 p.m.