minmis: Minimum Number of Misallocations

Description Usage Arguments Details Value See Also Examples

View source: R/misc.R

Description

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

Usage

1
minmis(cls, hat_cls)

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.

Value

Integer specifying the minimum number of misallocations.

See Also

ari

Examples

1
2
3
4
5
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])

EMMIXmfa documentation built on Dec. 18, 2019, 1:40 a.m.