ari: Computes the adjusted Rand index and the confidence interval,...

View source: R/ari.R

ariR Documentation

Computes the adjusted Rand index and the confidence interval, comparing two classifications from a contingency table.

Description

Computes the adjusted Rand index and the confidence interval, comparing two classifications from a contingency table.

print method for ari class

Usage

ari(mat, alpha = 0.05, digits = 2)

## S3 method for class 'ari'
print(x, ...)

Arguments

mat

A matrix of integers representing the contingency table of reference

alpha

A single number strictly included between 0 and 1 representing the significance level of interest. (default is 0.05)

digits

An integer for the returned significant digits to return (default is 2)

x

an object used to select a method.

...

further arguments passed to or from other methods.

Details

The adjusted Rand Index (ARI) should be interpreted as follows:

ARI >= 0.90 excellent recovery; 0.80 =< ARI < 0.90 good recovery; 0.65 =< ARI < 0.80 moderate recovery; ARI < 0.65 poor recovery.

As the confidence interval is based on the approximation to the Normal distribution, it is recommended to trust in the confidence interval only in cases of total number of object clustered greater than 100.

Value

An object of class ari with the following elements:

AdjustedRandIndex

The adjusted Rand Index

CI

The confidence interval

Methods (by generic)

  • print(ari):

Author(s)

Paola Tellaroli, <paola dot tellaroli at unipd dot it>;

References

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

E.M. Qannari, P. Courcoux and Faye P. (2014) Significance test of the adjusted Rand index. Application to the free sorting task, Food Quality and Preference, (32)93-97

M.H. Samuh, F. Leisch, and L. Finos (2014), Tests for Random Agreement in Cluster Analysis, Statistica Applicata-Italian Journal of Applied Statistics, vol. 26, no. 3, pp. 219-234.

D. Steinley (2004) Properties of the Hubert-Arabie Adjusted Rand Index, Psychological Methods, 9(3), 386-396

D. Steinley, M.J. Brusco, L. Hubert (2016) The Variance of the Adjusted Rand Index, Psychological Methods, 21(2), 261-272

Examples


#### This example compares the adjusted Rand Index as computed on the
### partitions given by Ward's algorithm with the ground truth on the
### famous Iris data set by the adjustedRandIndex function
### {mclust package} and by the ari function.

library(CrossClustering)
library(mclust)

clusters <- iris[-5] |>
  dist() |>
  hclust(method = 'ward.D') |>
  cutree(k = 3)

ground_truth <- iris[[5]] |> as.numeric()

mc_ari <- adjustedRandIndex(clusters, ground_truth)
mc_ari

ari_cc <- table(ground_truth, clusters) |>
  ari(digits = 7)
ari_cc

all.equal(mc_ari, unclass(ari_cc)[["ari"]], check.attributes = FALSE)


CrossClustering documentation built on May 29, 2024, 9:22 a.m.