Description Usage Arguments Details Value Examples
Plot ROC curves for several different models (or just one) with confidence
intervals calculated by pROC::ci.se()
and pROC::ci.sp()
.
1 2 3 4 5 6 7 8 |
rocdf |
A data frame with columns |
conf_level |
A number in |
aes_opts |
A named list of aesthetic options for the plot.
|
quick |
A flag. With |
parallel |
A flag. Calculate the sensitivity and specificity confidence intervals simultaneously? This is a small speedup (<2x). |
Inside this function, pROC::roc()
is called with direction = "<"
. The
easiest thing is to have rocdf$response
be a vector of 0s and 1s and have
rocdf$predictor
be a vector of probabilities where each probability is the
probability of a response of 1. If rocdf$predictor
is logical, then these
rocdf$predictor
is the probability of a response of TRUE
.
A ggplot2::ggplot()
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | rocdf1 <- dplyr::tibble( # decent model
predictor = seq(0.01, 0.99, length.out = 1000),
response = purrr::rbernoulli(length(predictor), predictor)
)
rocdf2 <- dplyr::tibble( # bad model
predictor = seq(0.01, 0.99, length.out = 88),
response = purrr::rbernoulli(length(predictor), 0.5)
)
rocdf12 <- dplyr::bind_rows(
dplyr::bind_cols(rocdf1, model = "decent"),
dplyr::bind_cols(rocdf2, model = "bad")
)
plot_roc(rocdf1,
quick = TRUE, parallel = FALSE,
aes_opts = list(conf_alpha = 0.3)
)
plot_roc(rocdf2,
conf_level = NA, quick = TRUE,
aes_opts = list(roc_line_size = 2, roc_line_color = "red")
)
plot_roc(rocdf12,
conf_level = NA, quick = TRUE,
aes_opts = list(null_line_size = 2, null_line_alpha = 1)
)
plot_roc(rocdf12, conf_level = 0.99, quick = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.