compare {cases} | R Documentation |
Compare predictions and labels
Description
Compare predictions and labels
Usage
compare(
predictions,
labels,
partition = TRUE,
names = c(specificity = 0, sensitivity = 1)
)
Arguments
predictions |
integer, predicted class |
labels |
integer, true class state (reference standard) |
partition |
logical, should result be split into one matrix per class (TRUE; default) or not (FALSE) |
names |
integer (named), values give data values, names give class names |
Value
data matrix with values 1 (correct prediction) and 0 (false prediction)
Examples
pred <- matrix(c(1,1,0), 5, 3)
labels <- c(1, 1, 0, 0, 1)
compare(pred, labels, FALSE)
compare(pred, labels, TRUE)
[Package cases version 0.1.1 Index]