plot_confusion: Plot confusion matrix for a classification predx object.

View source: R/utils_plotting.R

plot_confusionR Documentation

Plot confusion matrix for a classification predx object.

Description

Generates a heat map representation of the confusion matrix. Outcome is presented in the X axis, fitted is presented in the Y axis.

Usage

plot_confusion(
  predx_object,
  scale = c("none", "fraction", "percent"),
  show_labels = TRUE,
  label_size = 2.75,
  label_color = "black",
  signif_digits = 2,
  plot_title = NULL,
  plot_subtitle = NULL,
  plot_tag = NULL,
  x_lab = ".outcome",
  y_lab = ".fitted",
  cust_theme = ggplot2::theme_classic()
)

Arguments

predx_object

a predx object.

scale

indicates, how the table is to be scaled. 'none' returns the counts (default), 'fraction' returns the fraction of all observations, 'percent' returns the percent of all observations.

show_labels

logical, indicates if counts/fractions/percents are shown in the plot.

label_size

size of the label text.

label_color

color of the label text.

signif_digits

significant digits for rounding of the label values.

plot_title

plot title.

plot_subtitle

plot subtitle.

plot_tag

plot tag, contains a reference to scale and the observation number if not specified.

x_lab

X axis label.

y_lab

Y axis label.

cust_theme

customized plot theme provided by the user.

Value

returns a ggplot object.


PiotrTymoszuk/caretExtra documentation built on Oct. 15, 2023, 10:03 p.m.