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 |
(numeric | character) |
labels |
(numeric | character) |
partition |
(logical) |
names |
(character | NULL) |
Value
(list | matrix)
list of matrices (one for each unique value of labels
) with
values 1 (correct prediction) and 0 (false prediction).
If partition=TRUE
, the matrices are combined in a single matrix with rbind
.
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.2.0 Index]