Learn R Programming

EMMIXmfa (version 2.0.14)

minmis: Minimum Number of Misallocations

Description

Given two vectors each corresponding to a set of categories, this function finds the minimum number of misallocations by rotating the categories.

Usage

minmis(cls, hat_cls)

Value

Integer specifying the minimum number of misallocations.

Arguments

cls

A numeric or character vector of labels.

hat_cls

A numeric or character vector of labels same length as cls.

Details

Rotates the categories for all possible permutations, and returns the minimum number of misallocations. The number of categories in each set of labels does not need to be the same. It may take several minutes to compute when the number of categories is large.

See Also

ari

Examples

Run this code
set.seed(1984)
Y <- scale(iris[, -5])
model <- mcfa(Y, g = 3, q = 3, nkmeans = 1, nrandom = 0, itmax = 200)
ari(model$clust, iris[, 5])
minmis(model$clust, iris[, 5])

Run the code above in your browser using DataLab