The total error and the (g x g) confusion matrix for g-class classification problems

confusion(trueclass, predclass, labs)

Arguments

trueclass

The true classes

predclass

The predicted classes

labs

A vector of labels for the classes

Value

total.error

The total classification error

conf.matrix

The (g x g) confusion matrix

Examples

data(BCdata) confusion(factor(BCdata$Y), sample(c(0, 1), 130, replace = TRUE), c("0", "1"))
#> $total.error #> [1] 0.4769231 #> #> $conf.matrix #> 0 1 #> 0 29 35 #> 1 27 39 #>