accuracy | R Documentation |
Given the observed and predicted values of categorical data (of any number of classes) computes the accuracy (also known as proportion of correctly classified cases).
accuracy(observed, predicted, remove_na = TRUE)
observed |
( |
predicted |
( |
remove_na |
( |
Accuracy can be computed as:
that is, the sum of the diagonal in the confusion matrix (correct classifications) over the total number of values in the matrix (N). An equivalent but more efficient method is used.
A single numeric value with the accuracy.
Other categorical_metrics:
brier_score()
,
categorical_summary()
,
confusion_matrix()
,
f1_score()
,
kappa_coeff()
,
math_mode()
,
matthews_coeff()
,
pccc()
,
pcic()
,
pr_auc()
,
precision()
,
recall()
,
roc_auc()
,
sensitivity()
,
specificity()
## Not run:
accuracy(c("a", "b"), c("a", "b"))
accuracy(c("a", "b"), c("b", "a"))
accuracy(c("a", "b"), c("b", "b"))
accuracy(c("a", "b", "a"), c("b", "a", "c"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.