draw_confusion | R Documentation |
Plot confusion matrix
draw_confusion(
x,
xlab = "Predicted",
ylab = "Reference",
true_col = "#72CDF4",
false_col = "#FEB2E0",
font_size = 18,
main = NULL,
main_y = 1,
main_yanchor = "bottom",
theme = choose_theme(),
margin = list(l = 20, r = 5, b = 5, t = 20),
filename = NULL,
file_width = 500,
file_height = 500,
file_scale = 1
)
x |
|
xlab |
Character: x-axis label. Default is "Predicted". |
ylab |
Character: y-axis label. Default is "Reference". |
true_col |
Color for true positives & true negatives. |
false_col |
Color for false positives & false negatives. |
font_size |
Integer: font size. |
main |
Character: plot title. |
main_y |
Numeric: y position of the title. |
main_yanchor |
Character: y anchor of the title. |
theme |
Theme object. |
margin |
List: Plot margins. |
filename |
Character: file name to save the plot. Default is NULL. |
file_width |
Numeric: width of the file. Default is 500. |
file_height |
Numeric: height of the file. Default is 500. |
file_scale |
Numeric: scale of the file. Default is 1. |
plotly
object.
EDG
## Not run:
# Assume positive class is "b"
true_labels <- factor(c("a", "a", "a", "b", "b", "b", "b", "b", "b", "b"))
predicted_labels <- factor(c("a", "b", "a", "b", "b", "a", "b", "b", "b", "a"))
predicted_prob <- c(0.3, 0.55, 0.45, 0.75, 0.57, 0.3, 0.8, 0.63, 0.62, 0.39)
metrics <- classification_metrics(true_labels, predicted_labels, predicted_prob)
draw_confusion(metrics)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.