|
a |
|
b/man/plot_cm.Rd |
|
|
1 |
% Generated by roxygen2: do not edit by hand |
|
|
2 |
% Please edit documentation in R/help_functions.R |
|
|
3 |
\name{plot_cm} |
|
|
4 |
\alias{plot_cm} |
|
|
5 |
\title{Plot confusion matrix} |
|
|
6 |
\usage{ |
|
|
7 |
plot_cm( |
|
|
8 |
cm, |
|
|
9 |
perc = FALSE, |
|
|
10 |
cm_labels, |
|
|
11 |
round_dig = 2, |
|
|
12 |
text_size = 1, |
|
|
13 |
highlight_diag = TRUE |
|
|
14 |
) |
|
|
15 |
} |
|
|
16 |
\arguments{ |
|
|
17 |
\item{cm}{A confusion matrix} |
|
|
18 |
|
|
|
19 |
\item{perc}{Whether to use absolute numbers or percentages.} |
|
|
20 |
|
|
|
21 |
\item{cm_labels}{Labels corresponding to confusion matrix entries.} |
|
|
22 |
|
|
|
23 |
\item{round_dig}{How to round numbers.} |
|
|
24 |
|
|
|
25 |
\item{text_size}{Size of text annotations.} |
|
|
26 |
|
|
|
27 |
\item{highlight_diag}{Whether to highlight entries in diagonal.} |
|
|
28 |
} |
|
|
29 |
\value{ |
|
|
30 |
A ggplot of a confusion matrix. |
|
|
31 |
} |
|
|
32 |
\description{ |
|
|
33 |
Plot confusion matrix, either with absolute numbers or percentages per column (true labels). |
|
|
34 |
} |
|
|
35 |
\examples{ |
|
|
36 |
\dontshow{if (reticulate::py_module_available("tensorflow")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} |
|
|
37 |
cm <- matrix(c(90, 1, 0, 2, 7, 1, 8, 3, 1), nrow = 3, byrow = TRUE) |
|
|
38 |
plot_cm(cm, perc = TRUE, cm_labels = paste0('label_', 1:3), text_size = 8) |
|
|
39 |
\dontshow{\}) # examplesIf} |
|
|
40 |
} |