arandi: (Adjusted) Rand Index for Clusterings

arandiR Documentation

(Adjusted) Rand Index for Clusterings

Description

Computes the adjusted or unadjusted Rand index between two clusterings/partitions of the same objects.

Usage

arandi(cl1, cl2, adjust = TRUE)

Arguments

cl1,cl2

vectors of cluster memberships (need to have the same lengths).

adjust

logical. Should index be adjusted? Defaults to TRUE.

Details

The Rand index is based on how often the two clusterings agree in the treatment of pairs of observations, where agreement means that two observations are in/not in the same cluster in both clusterings.

The adjusted Rand index adjusts for the expected number of chance agreements.

Formulas of Hubert and Arabie (1985) are used for the computation.

Author(s)

Arno Fritsch, arno.fritsch@tu-dortmund.de

References

Hubert, L. and Arabie, P. (1985): Comparing partitions. Journal of Classification, 2, 193–218.

See Also

vi.dist

Examples

 cl1 <- sample(1:3,10,replace=TRUE)
 cl2 <- c(cl1[1:5], sample(1:3,5,replace=TRUE))
 arandi(cl1,cl2)
 arandi(cl1,cl2,adjust=FALSE)

mcclust documentation built on May 2, 2022, 5:05 p.m.