confusion_matrix | R Documentation |
Given the observed and predicted values of categorical data (of any number of classes) computes the confusion matrix.
confusion_matrix(observed, predicted, remove_na = TRUE)
observed |
( |
predicted |
( |
remove_na |
( |
An object of class table
with the confusion matrix.
Other categorical_metrics:
accuracy()
,
brier_score()
,
categorical_summary()
,
f1_score()
,
kappa_coeff()
,
math_mode()
,
matthews_coeff()
,
pccc()
,
pcic()
,
pr_auc()
,
precision()
,
recall()
,
roc_auc()
,
sensitivity()
,
specificity()
## Not run:
confusion_matrix(factor("a"), factor("a"))
confusion_matrix(factor("a"), factor("b"))
confusion_matrix(factor(c("a", "b")), factor(c("c", "d")))
confusion_matrix(factor(c("a", "a")), factor(c("a", "a")))
confusion_matrix(iris$Species, iris$Species)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.