adj.rand.index: Adjusted Rand index

Description Usage Arguments Details Value References See Also Examples

Description

Computes the adjusted Rand index to compare two altenative partitions of the same set.

Usage

1
adj.rand.index(cl1, cl2)

Arguments

cl1

the vector containining the class labels of the first partition.

cl2

the vector containining the class labels of the second partition.

Details

The adjusted Rand index is a correction of the Rand index that measures the similarity between two classifications of the same objects by the proportions of agreements between the two partitions. The correction is obtained by subtracting from the Rand index its expected value.

Value

A numeric vector of length 1.

References

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

See Also

table

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# load data
data(wine)
#actual groups
gr <- wine[, 1]

# select a subset of variables
x <- wine[, c(2, 5, 8)]

#clustering
cl <- pdfCluster(x)

#comparison with original groups
table(groups(cl), gr)
adj.rand.index(groups(cl), gr)

Example output

pdfCluster 1.0-3
   gr
    Barolo Grignolino Barbera
  1     58          4       0
  2      1         62       0
  3      0          5      48
[1] 0.8332447

pdfCluster documentation built on May 2, 2019, 9:41 a.m.