threshperf_plot_multi | R Documentation |
Generate a threshold-performance plot for multiple models with colored/shaded 95 percent confidence intervals
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
)
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). |
A ggplot containing the threshold-performance plot. The 95 percent
confidence intervals are estimated using Wilson's interval from the
Hmisc
binconf
function.
data(multi_model_dataset)
threshperf_plot_multi(multi_model_dataset, outcome = 'outcomes', prediction = 'predictions', model = 'model_name')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.