ARI: Evalute the adjusted Rand index

Description Usage Arguments Details Value Examples

View source: R/ARI.R

Description

Compute the adjusted Rand index to compare two partitions

Usage

1
ARI(x, y)

Arguments

x

vector (of length n) or matrix (with n columns) providing a partition

y

vector or matrix providing a partition

Details

the partitions may be provided as n-vectors containing the cluster memeberships of n entities, or by Qxn - matrices whose entries are all 0 and 1 where 1 indicates the cluster membership

Value

the value of the adjusted Rand index

Examples

1
2
3
4
5
6
7
clust1 <- c(1,2,1,2)
clust2 <- c(2,1,2,1)
ARI(clust1, clust2)

clust3 <- matrix(c(1,1,0,0, 0,0,1,1), nrow=2, byrow=TRUE)
clust4 <- matrix(c(1,0,0,0, 0,1,0,0, 0,0,1,1), nrow=3, byrow=TRUE)
ARI(clust3, clust4)

noisySBM documentation built on Dec. 16, 2020, 5:09 p.m.