extCriteria: Compute external clustering criteria

Description Usage Arguments Details Value Author References See Also Examples

View source: R/main.R

Description

extCriteria calculates various external clustering comparison indices.

Usage

1
  extCriteria(part1, part2, crit)

Arguments

part1

[vector] : the first partition vector.

part2

[vector] : the second partition vector.

crit

[vector] : a vector containing the names of the indices to compute.

Details

The function extCriteria calculates external clustering indices in order to compare two partitions. The list of all the supported criteria can be obtained with the getCriteriaNames function.

The currently available indices are :

All the names are case insensitive and can be abbreviated. The keyword "all" can also be used as a shortcut to calculate all the external indices.

The partition vectors should not have empty subsets. No attempt is made to verify this.

Value

A list containing the computed criteria, in the same order as in the crit argument.

Author

Bernard Desgraupes
bernard.desgraupes@u-paris10.fr
University of Paris Ouest - Nanterre
Lab Modal'X (EA 3454)

References

See the bibliography at the end of the vignette.

See Also

getCriteriaNames, intCriteria, bestCriterion, concordance.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Generate two artificial partitions
part1<-sample(1:3,150,replace=TRUE)
part2<-sample(1:5,150,replace=TRUE)

# Compute all the external indices
extCriteria(part1,part2,"all")
# Compute some of them
extCriteria(part1,part2,c("Rand","Folkes"))
# The names are case insensitive and can be abbreviated
extCriteria(part1,part2,c("ra","fo"))

Example output

$czekanowski_dice
[1] 0.2503392

$folkes_mallows
[1] 0.2587612

$hubert
[1] 0.004834222

$jaccard
[1] 0.1430787

$kulczynski
[1] 0.2674666

$mcnemar
[1] 52.64024

$phi
[1] 2.068811e-10

$precision
[1] 0.3351499

$rand
[1] 0.6044742

$recall
[1] 0.1997834

$rogers_tanimoto
[1] 0.4331517

$russel_rao
[1] 0.06604027

$sokal_sneath1
[1] 0.07705158

$sokal_sneath2
[1] 0.7534858

$rand
[1] 0.6044742

$folkes_mallows
[1] 0.2587612

$rand
[1] 0.6044742

$folkes_mallows
[1] 0.2587612

clusterCrit documentation built on May 2, 2019, 3:22 p.m.