Rand index


The Rand index or Rand measure in statistics, and in particular in data clustering, is a measure of the similarity between two data clusterings. A form of the Rand index may be defined that is adjusted for the chance grouping of elements, this is the adjusted Rand index. From a mathematical standpoint, Rand index is related to the accuracy, but is applicable even when class labels are not used.

Rand index

Definition

Given a set of elements and two partitions of to compare,, a partition of S into r subsets, and, a partition of S into s subsets, define the following:
The Rand index,, is:
Intuitively, can be considered as the number of agreements between and and as the number of disagreements between and.
Since the denominator is the total number of pairs, the Rand index represents the frequency of occurrence
of agreements over the total pairs, or the probability that and
will agree on a randomly chosen pair.
is calculated as.
Similarly, one can also view the Rand index as a measure of the percentage of correct decisions made by the algorithm. It can be computed using the following formula:

Properties

The Rand index has a value between 0 and 1, with 0 indicating that the two data clusterings do not agree on any pair of points and 1 indicating that the data clusterings are exactly the same.
In mathematical terms, a, b, c, d are defined as follows:
for some

Relationship with classification accuracy

The Rand index can also be viewed through the prism of binary classification accuracy over the pairs of elements in. The two class labels are " and are in the same subset in and " and " and are in different subsets in and ".
In that setting, is the number of pairs correctly labeled as belonging to the same subset, and is the number of pairs correctly labeled as belonging to different subsets.

Adjusted Rand index

The adjusted Rand index is the corrected-for-chance version of the Rand index. Such a correction for chance establishes a baseline by using the expected similarity of all pair-wise comparisons between clusterings specified by a random model. Traditionally, the Rand Index was corrected using the Permutation Model for clusterings. However, the premises of the permutation model are frequently violated; in many clustering scenarios, either the number of clusters or the size distribution of those clusters vary drastically. For example, consider that in K-means the number of clusters is fixed by the practitioner, but the sizes of those clusters are inferred from the data. Variations of the adjusted Rand Index account for different models of random clusterings.
Though the Rand Index may only yield a value between 0 and +1, the adjusted Rand index can yield negative values if the index is less than the expected index.

The contingency table

Given a set of elements, and two groupings or partitions of these elements, namely and, the overlap between and can be summarized in a contingency table where each entry denotes the number of objects in common between and :.

Definition

The original Adjusted Rand Index using the Permutation Model is
where are values from the contingency table.