mplot3_roc: 'mplot3' ROC curves

View source: R/mplot3_roc.R

mplot3_rocR Documentation

mplot3 ROC curves

Description

Plot ROC curve for a binary classifier

Usage

mplot3_roc(
  prob,
  labels,
  method = c("pROC", "rt"),
  type = "TPR.FPR",
  balanced.accuracy = FALSE,
  main = "",
  col = NULL,
  alpha = 1,
  cex = 1.2,
  lwd = 2.5,
  diagonal = TRUE,
  diagonal.lwd = 1,
  diagonal.lty = 1,
  diagonal.col = "red",
  group.legend = FALSE,
  annotation = TRUE,
  annotation.col = col,
  annot.line = NULL,
  annot.adj = 1,
  annot.font = 1,
  pty = "s",
  mar = c(2.5, 3, 2, 1),
  theme = rtTheme,
  palette = rtPalette,
  verbose = TRUE,
  par.reset = TRUE,
  filename = NULL,
  pdf.width = 5,
  pdf.height = 5
)

Arguments

prob

Numeric vector or list of numeric vectors [0, 1]: Predicted probabilities (e.g. c(.1, .8, .2, .9))

labels

Integer vector or list of integer vectors 0, 1: True labels (e.g. c(0, 1, 0, 1))

method

Character: "rt" or "pROC" will use rtROC and pROC::roc respectively to get points of the ROC.

type

Character: "TPR.FPR" or "Sens.Spec". Only changes the x and y labels. True positive rate vs. False positive rate and Sensitivity vs. Specificity.

balanced.accuracy

Logical: If TRUE, annotate the point of maximal Balanced Accuracy.

main

Character: Plot title.

col

Color, vector: Colors to use for ROC curve(s)

alpha

Numeric: Alpha transparency for lines

cex

Float: Character expansion factor.

lwd

Float: Line width.

diagonal

Logical: If TRUE, draw diagonal.

diagonal.lwd

Float: Line width for diagonal.

diagonal.lty

Integer: Line type for diagonal.

diagonal.col

Color: Color for diagonal.

group.legend

Logical: If TRUE, print group legend

annotation

Character: Add annotation at the bottom right of the plot

annotation.col

Color: Color for annotation.

annot.line

Numeric: Line position for annotation.

annot.adj

Numeric: Text adjustment for annotation.

annot.font

Integer: Font for annotation.

pty

Character: "s" gives a square plot; "m" gives a plot that fills graphics device size. Default = "m" (See par("pty"))

mar

Float, vector, length 4: Margins; see par("mar")

theme

Character: Run themes() for available themes

palette

Vector of colors, or Character defining a builtin palette - get options with rtpalette()

verbose

Logical: If TRUE, print messages to console.

par.reset

Logical: If TRUE, reset par setting before exiting.

filename

Path to file: If supplied, plot will be printed to file

pdf.width

Float: Width in inches for pdf output (if filename is set).

pdf.height

Float: Height in inches for pdf output.

Author(s)

E.D. Gennatas


egenn/rtemis documentation built on April 24, 2024, 6:58 p.m.