mplot3_conf | R Documentation |
Plots confusion matrix and classification metrics
mplot3_conf(
object,
main = "auto",
xlab = "Reference",
ylab = "Predicted",
plot.metrics = TRUE,
mod.name = NULL,
oma = c(0, 0, 0, 0),
dim.main = NULL,
dim.lab = 1,
dim.in = 4,
dim.out = -1,
font.in = 2,
font.out = 1,
cex.main = 1.2,
cex.in = 1.2,
cex.lab = 1.2,
cex.lab2 = 1.2,
cex.lab3 = 1,
cex.out = 1,
col.main = "auto",
col.lab = "auto",
col.text.out = "auto",
col.bg = "auto",
col.bg.out1 = "auto",
col.bg.out2 = "auto",
col.text.hi = "auto",
col.text.lo = "auto",
show.ba = TRUE,
theme = getOption("rt.theme", "white"),
mid.col = "auto",
hi.color.pos = "#18A3AC",
hi.color.neg = "#C23A70",
autolabel = letters,
par.reset = TRUE,
pdf.width = 7,
pdf.height = 7,
filename = NULL,
...
)
object |
Either a classification |
main |
Character: Plot title. |
xlab |
Character: x-axis label. |
ylab |
Character: y-axis label. |
plot.metrics |
Logical: If TRUE, draw classification metrics next to confusion matrix. |
mod.name |
Character: Name of the algorithm used to make predictions. If NULL,
will look for |
oma |
Numeric, vector, length 4: Outer margins. |
dim.main |
Numeric: Height for title. |
dim.lab |
Numeric: Height for labels. |
dim.in |
Numeric: Height/Width for confusion matrix cells. |
dim.out |
Numeric: Height for metrics cells. Default = -1, which autoadjusts depending on number of output classes. |
font.in |
Integer: The |
font.out |
Integer: The |
cex.main |
Numeric: The |
cex.in |
Numeric: The |
cex.lab |
Numeric: The |
cex.lab2 |
Numeric: The |
cex.lab3 |
Numeric: The |
cex.out |
Numeric: The |
col.main |
Color for title. Default = "auto", determined by |
col.lab |
Color for labels. Default = "auto", determined by |
col.text.out |
Color for metrics cells' text. Default = "auto",
determined by |
col.bg |
Color for background. Default = "auto", determined by
|
col.bg.out1 |
Color for metrics cells' background (row1).
Default = "auto", determined by |
col.bg.out2 |
Color for metrics cells' background (row2).
Default = "auto", determined by |
col.text.hi |
Color for high confusion matrix values. Default = "auto",
determined by |
col.text.lo |
Color for low confusion matrix values. Default = "auto",
determined by |
show.ba |
Logical: If TRUE, show Balanced Accuracy at bottom right corner. |
theme |
Character: "light", or "dark". Set to
|
mid.col |
Color: The mid color for the confusion matrix.
Default = "auto", determined by |
hi.color.pos |
Color: The hi color for correct classification. |
hi.color.neg |
Color: The hi color for missclassification. |
autolabel |
Character vector to be used to generate autolabels when using
rtlayout with |
par.reset |
Logical: If TRUE, reset par before exit. |
pdf.width |
Numeric: PDF width, if |
pdf.height |
Numeric: PDF height, if |
filename |
Character: If specified, save plot to this path. |
... |
Additional arguments passed to |
This function uses its multiple cex args instead of the theme's cex
parameter
List of metrics, invisibly
E.D. Gennatas
## Not run:
true <- c("alpha", "alpha", "alpha", "alpha", "beta", "beta", "beta", "beta")
predicted <- c("alpha", "alpha", "alpha", "beta", "beta", "alpha", "alpha", "beta")
mplot3_conf(table(predicted, true))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.