misclassification: Computes misclassification rate

Description Usage Arguments Details Value References Examples

View source: R/misclassification.R

Description

Missclasification is a commonly used performance measure in subspace clustering. It allows to compare two partitions with the same number of clusters.

Usage

1
misclassification(group, true_group, M, K)

Arguments

group

a vector, first partition

true_group

a vector, second (reference) partition

M

an integer, maximal number of elements in one class

K

an integer, number of classes

Details

As getting exact value of misclassification requires checking all permutations and is therefore intrackable even for modest number of clusters, a heuristic approach is proposed. It is assumed that there are K classes of maximum M elements. Additional requirement is that classes labels are from range [1, K].

Value

misclassification rate

References

R. Vidal. Subspace clustering. Signal Processing Magazine, IEEE, 28(2):52-68,2011

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sim.data <- data.simulation(n = 100, SNR = 1, K = 5, numb.vars = 30, max.dim = 2)
mlcc.fit <- mlcc.reps(sim.data$X, numb.clusters = 5, numb.runs = 20, max.dim = 2)
misclassification(mlcc.fit$segmentation,sim.data$s, 30, 5)


#one can use this function not only for clusters
partition1 <- sample(10, 300, replace = TRUE)
partition2 <- sample(10, 300, replace = TRUE)
misclassification(partition1, partition1, max(table(partition1)), 10)
misclassification(partition1, partition2, max(table(partition2)), 10)

psobczyk/public_varclust documentation built on May 24, 2017, 12:20 p.m.