knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) knitr::opts_chunk$set(warning = FALSE, message = FALSE)
The goal of runway is to generate statistics and plots to calculate discrimination, calibration, and decision curves for prediction models.
Because you can use it to visually compare models.
Sometimes your models look quite different.
Other times your models look the same...
You can install runway
from GitHub with:
remotes::install_github('ML4LHS/runway')
First, load the package.
library(runway)
Runway comes with two sample datasets.
data(single_model_dataset) head(single_model_dataset) data(multi_model_dataset) head(multi_model_dataset)
threshperf_plot(single_model_dataset, outcome = 'outcomes', positive = '1', prediction = 'predictions')
Note: 10 bins is the default.
cal_plot(single_model_dataset, outcome = 'outcomes', positive = '1', prediction = 'predictions')
cal_plot(single_model_dataset, outcome = 'outcomes', positive = '1', prediction = 'predictions', n_bins = 5)
cal_plot(single_model_dataset, outcome = 'outcomes', positive = '1', prediction = 'predictions', n_bins = 0, show_loess = TRUE)
threshperf_plot_multi(multi_model_dataset, outcome = 'outcomes', positive = '1', prediction = 'predictions', model = 'model_name')
Note: 10 bins is the default.
cal_plot_multi(multi_model_dataset, outcome = 'outcomes', positive = '1', prediction = 'predictions', model = 'model_name')
cal_plot_multi(multi_model_dataset, outcome = 'outcomes', positive = '1', prediction = 'predictions', model = 'model_name', n_bins = 5)
Unlike single calibration plots, the choice of binned calibration and loess calibration are mutually exclusive. To show less curves, you must set show_loess
to TRUE
and n_bins
to 0
.
cal_plot_multi(multi_model_dataset, outcome = 'outcomes', positive = '1', prediction = 'predictions', model = 'model_name', n_bins = 0, show_loess = TRUE)
roc_plot(single_model_dataset, outcome = 'outcomes', positive = '1', prediction = 'predictions', ci = TRUE, plot_title = 'Single ROC curve w/CI ribbon')
roc_plot_multi(multi_model_dataset, outcome = 'outcomes', positive = '1', prediction = 'predictions', model = 'model_name', ci = TRUE, plot_title = 'Multiple model ROC curves w/CI ribbons')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.