MCError: Misclassification Error

Description Usage Arguments Value Author(s) References Examples

Description

Given the true cluster classification of the samples based on some pre-determined criterion and an estimated cluster membership determined using a clustering algorithm, this function calculates the misclassification error of the algorithm. This measure of dissimilarity between two clustering methods is equivalent to one minus the Rand Index.

Usage

1
MCError(True, Est)

Arguments

True

A N \times 1 vector consisting integer values ranging between 1 and M, where N is the number of samples and M is the number of clusters in the true cluster membership .

Est

A vector whose length is the same as True, whose values range between 1 and K, where K is the estimated number of clusters.

Value

A numeric between 0 and 1. If the vectors are of unequal lengths, the function returns NA.

Author(s)

Deepak Nag Ayyala <deepaknagayyala@gmail.com>

References

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

Examples

1
2
3
4
5
6
7
8
True <- rep(seq(1,6), rep(5,6))
Est <- rep( seq(1,6), 5);
MCError(True, Est);

## Following is an example of complete mismatch, where the misclassification error is equal to 1.
True <- rep(1,10);
Est <- seq(1,10);
MCError(True, Est)

GrammR documentation built on May 1, 2019, 8:46 p.m.