Description Usage Arguments Value Author(s) Examples
Confusion matrix - a special kind of contingency table - is a specific table layout that allows the visualization of performance of a classification model (or classifier). It composes of four different combinations of predicted and actual values.
confusion_list
computes and returns those combinations as a
named list
while mtr_confusion_matrix
returns a named
matrix
.
Here's elements of confusion matrix:
True Positive (TP)
False Positive (FP)
True Negative (TN)
False Negative (FN)
1 2 3 | confusion_list(actual, predicted, cutoff = 0.5)
mtr_confusion_matrix(actual, predicted, cutoff = 0.5)
|
actual |
|
predicted |
|
cutoff |
|
A named list or a named two dimensions matrix
An Chu
1 2 3 4 5 6 7 8 9 10 | act <- c(1, 0, 0, 1, 1)
pred <- c(0.9, 0.3, 0.6, 0.5, 0.2)
## output as a R's list
## metrics:::confusion_list(act, pred) # default value of cutoff = 0.5
## metrics:::confusion_list(act, pred, cutoff = 0.7)
## output as a R's matrix
mtr_confusion_matrix(act, pred)
mtr_confusion_matrix(act, pred, cutoff = 0.7)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.