fossil (version 0.3.7)

rand.index: Rand Index and Adjusted Rand Index

Description

Measures to compare the similarity of two clustering outcomes

Usage

rand.index(group1, group2)
adj.rand.index(group1, group2)

Arguments

group1

first cluster identity matrix

group2

second cluster identity matrix

Value

a single value between 0 and 1

Details

This function calculates the Rand Index for two different clustering outcomes. The Rand Index gives a value between 0 and 1, where 1 means the two clustering outcomes match identicaly.

The Adjusted Rand Index rescales the index, taking into account that random chance will cause some objects to occupy the same clusters, so the Rand Index will never actually be zero.

References

Rand, W.M. 1971. Objective criteria for the evaluation of clustering methods. Journal of the American Statistical Association 66: 846--850.

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

See Also

To cluster the data, use the function rclust

Examples

Run this code
# NOT RUN {
#create a hypothetical clustering outcome with 2 distinct clusters
g1 <- sample(1:2, size=10, replace=TRUE)
g2 <- sample(1:3, size=10, replace=TRUE)
rand.index(g1, g2)
# }

Run the code above in your browser using DataLab