The total error and the (g x g) confusion matrix for g-class classification problems
confusion(trueclass, predclass, labs)
trueclass | The true classes |
---|---|
predclass | The predicted classes |
labs | A vector of labels for the classes |
The total classification error
The (g x g) confusion matrix
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 #>