confusion: Computes the confusion summary for a vector of...

Description Usage Arguments Details Value Examples

Description

For a vector of classifications and truth labels, we create a confusion matrix. We allow binary and multi-class classifications and compute the following four measures for each class:

Usage

1
confusion(truthClass, predictedClass)

Arguments

truthClass

vector of ground truth classification labels

predictedClass

vector of predicted classification labels

Details

For multi-class classification, we consider each class in a binary context. For example, suppose that we have the three food condiment classes: ketchup, mustard, and other. When calculating the TP, TN, FP, and FN values for ketchup, we consider each observation as either 'ketchup' or 'not ketchup.' Similarly, for mustard, we would consider 'mustard' and 'not mustard', and for other, we would consider 'other' and 'not other.'

With the above counts for each class, we can quickly calculate a variety of class-specific and aggregate classification accuracy measures.

Value

list with the results of confusion matrix results for each class.

Examples

1
2
3

PNNL-Comp-Mass-Spec/glmnetGLR documentation built on May 28, 2019, 2:23 p.m.