Learn R Programming

partitionComparison (version 0.2.6)

classificationErrorDistance: Classification Error Distance

Description

Compute the classification error distance $$1 - \frac{1}{n} \max_{\sigma}{\sum_{C \in \cal{P}}{|C \cap \sigma(C)|}}$$ with \(\sigma\) a weighted matching between the clusters of both partitions. The nodes are the classes of each partition, the weights are the overlap of objects.

Usage

classificationErrorDistance(p, q)

# S4 method for Partition,Partition classificationErrorDistance(p, q)

Arguments

p

The partition \(P\)

q

The partition \(Q\)

Methods (by class)

  • classificationErrorDistance(p = Partition, q = Partition): Compute given two partitions

Hint

This measure is implemented using lp.assign from the lpSolve package to compute the maxmimal matching of a weighted bipartite graph.

Author

Fabian Ball fabian.ball@kit.edu

References

Meila2001partitionComparison

Meila2005partitionComparison

Examples

Run this code
isTRUE(all.equal(classificationErrorDistance(new("Partition", c(0, 0, 0, 1, 1)), 
                                             new("Partition", c(0, 0, 1, 1, 1))), 0.2))

Run the code above in your browser using DataLab