rand.index: Rand Index and Adjusted Rand Index

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Measures to compare the similarity of two clustering outcomes

Usage

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

Arguments

group1

first cluster identity matrix

group2

second cluster identity matrix

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.

Value

a single value between 0 and 1

Author(s)

Matthew Vavrek

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

1
2
3
4
#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)

Example output

Loading required package: sp
Loading required package: maps
Loading required package: shapefiles
Loading required package: foreign

Attaching package: 'shapefiles'

The following objects are masked from 'package:foreign':

    read.dbf, write.dbf

[1] 0.4666667

fossil documentation built on March 23, 2020, 5:06 p.m.