Predicted against actual class, with the count in each cell. Percentages are given per actual class, which is the direction that shows sensitivity and specificity; overall percentages would hide a class the model misses.
Usage
plot_confusion(
predicted = NULL,
actual = NULL,
predicted_labels = NULL,
actual_labels = NULL,
positive = NULL,
show = c("count", "percent", "both"),
digits = 1,
title = NULL,
font = "Arial"
)Arguments
- predicted, predicted_labels
Predicted class labels.
- actual, actual_labels
Actual class labels.
actualmay also be a table or matrix of counts, in which case the labels are taken from its dimnames.- positive
Value of the outcome that counts as the positive class, used to order and label the axes. With
positivesupplied, the two classes are shown as"Negative"and"Positive"; passpredicted_labelsandactual_labelsto name them differently.- show
Which numbers to print:
"count","percent"(by actual class), or"both".- digits
Significant digits for percentages.
- title
Plot title.
- font
Font family used in the plot.