View source: R/help_functions.R
plot_cm | R Documentation |
Plot confusion matrix, either with absolute numbers or percentages per column (true labels).
plot_cm(
cm,
perc = FALSE,
cm_labels,
round_dig = 2,
text_size = 1,
highlight_diag = TRUE
)
cm |
A confusion matrix |
perc |
Whether to use absolute numbers or percentages. |
cm_labels |
Labels corresponding to confusion matrix entries. |
round_dig |
How to round numbers. |
text_size |
Size of text annotations. |
highlight_diag |
Whether to highlight entries in diagonal. |
A ggplot of a confusion matrix.
cm <- matrix(c(90, 1, 0, 2, 7, 1, 8, 3, 1), nrow = 3, byrow = TRUE)
plot_cm(cm, perc = TRUE, cm_labels = paste0('label_', 1:3), text_size = 8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.