Learn R Programming

mclust (version 2.0-1)

compClass: Compare classifications having the same number of groups.

Description

Error rate and best correspondence between two classifications having the same number of groups.

Usage

compClass(a, b)

Arguments

a
A numeric or character vector of class labels.
b
A numeric or character vector of class labels. Must have the same length and the same number of class labels as a.

Value

  • A list consisting of the following components:
  • errorThe minimum error rate between the two classifications, taken over all possible permutations.
  • mapA matrix giving a correspondence between the unique elements of a and b that gives the minimum error rate. (Note: there may be more than one mapping that achieves the minimum error rate.)

References

C. Fraley and A. E. Raftery (2002b). MCLUST:Software for model-based clustering, density estimation and discriminant analysis. Technical Report, Department of Statistics, University of Washington. See http://www.stat.washington.edu/mclust.

Examples

Run this code
a <- rep(1:3, 3)
a
b <- rep(c("A", "B", "C"), 3)
b
compClass(a, b)

Run the code above in your browser using DataLab