dplot3_conf: Plot confusion matrix

View source: R/dplot3_conf.R

dplot3_confR Documentation

Plot confusion matrix

Description

Plot confusion matrix

Usage

dplot3_conf(
  x,
  true.col = "#72CDF4",
  false.col = "#FEB2E0",
  pos.class = rtenv$binclasspos,
  font.size = 18,
  main = NULL,
  main.y = 1,
  main.yanchor = "bottom",
  theme = rtTheme,
  margin = list(l = 20, r = 5, b = 5, t = 20),
  filename = NULL,
  file.width = 500,
  file.height = 500,
  file.scale = 1,
  ...
)

Arguments

x

Confusion matrix where rows are the reference and columns are the estimated classes or rtemis class_error object produced by mod_error

true.col

Color for true positives & true negatives

false.col

Color for false positives & false negatives

pos.class

Integer: Index of factor level to treat as the positive class

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

List or Character: Either the output of a ⁠theme_*()⁠ function or the name of a theme. Use themes() to get available theme names. Theme functions are of the form ⁠theme_<name>⁠.

margin

List: Plot margins

filename

Character: Path to file to save static plot.

file.width

Integer: File width in pixels for when filename is set.

file.height

Integer: File height in pixels for when filename is set.

file.scale

Numeric: If saving to file, scale plot by this number

...

Additional arguments passed to theme function.

Value

A plotly object

Author(s)

EDG

Examples

## Not run: 
true <- factor(c("a", "a", "a", "a", "b", "b", "b", "b", "b", "b", "b", "b"))
predicted <- factor(c("a", "a", "b", "a", "b", "b", "a", "a", "b", "b", "a", "a"))
predicted.prob <- c(0.7, 0.55, 0.45, 0.62, 0.41, 0.32, 0.59, .63, .32, .21, .52, .58)
error <- mod_error(true, predicted, predicted.prob)
dplot3_conf(error)

## End(Not run)

egenn/rtemis documentation built on Oct. 28, 2024, 6:30 a.m.