threshperf_plot_multi: Generate a threshold-performance plot for multiple models...

threshperf_plot_multiR Documentation

Generate a threshold-performance plot for multiple models with colored/shaded 95 percent confidence intervals

Description

Generate a threshold-performance plot for multiple models with colored/shaded 95 percent confidence intervals

Usage

threshperf_plot_multi(
  df,
  outcome,
  prediction,
  model,
  plot_title = "",
  xmin = 0,
  xmax = 1,
  pre_tp_geoms = NULL,
  pre_dist_geoms = NULL,
  post_tp_geoms = NULL,
  post_dist_geoms = NULL,
  heights = c(10, 1),
  widths = c(1, 2, 1),
  thresholds = NULL
)

Arguments

df

The df as a data.frame.

outcome

A character string containing the name of the column containing the outcomes (expressed as 0/1s).

prediction

A character string containing the name of the column containing the predictions.

model

A character string containing the name of the column containing the model names

plot_title

A character string containing the title for the resulting plot.

xmin

The minimum possible prediction. Defaults to 0.

xmax

The maximum possible prediction. Defaults to 1.

pre_tp_geoms

A ggplot geom_* (or a list of geoms) that should be drawn on the threshold-performance plot prior to rendering it.

pre_dist_geoms

A ggplot geom_* (or a list of geoms) that should be drawn on the distribution plot prior to rendering it.

post_tp_geoms

A ggplot geom_* (or a list of geoms) that should be drawn on the threshold-performance plot after rendering it.

post_dist_geoms

A ggplot geom_* (or a list of geoms) that should be drawn on the distribution plot after rendering it.

heights

A numeric vector of length 2 with ratio of heights of plots. Defaults to c(10, 1).

widths

A numeric vector of length 3 with ratio of widths of plots. The first and third elements refer to padding. Defaults to c(1, 2, 1).

Value

A ggplot containing the threshold-performance plot. The 95 percent confidence intervals are estimated using Wilson's interval from the Hmisc binconf function.

Examples

data(multi_model_dataset)
threshperf_plot_multi(multi_model_dataset, outcome = 'outcomes', prediction = 'predictions', model = 'model_name')

ML4LHS/runway documentation built on Sept. 9, 2023, 8:27 p.m.