plot_incidence_vs_coverage | R Documentation |
do PRROC analysis for a vector of true outputs and a vector of raw predictions
plot_incidence_vs_coverage( df, my_output, my_pred, my_title = "", weights = NULL, option = "nse", include_f1_score = F )
df |
a data frame |
my_output |
a vector of binary outputs from df (0, 1 or NA) |
my_pred |
a vector of numeric predictions between 0 and 1 from df (no NA's allowed) |
my_title |
a title for the plot |
weights |
a vector of weights from df |
option |
'nse' if passing vectors using non-standard evaluation, 'character' if passing the names of the vectors |
include_f1_score |
boolean indicating whether f1 score of incidence and coverage should be included in plot and table |
A list. Element one is a plot of cutoff versus incidence/coverage. Element two is a data frame summarizing performance for each cutoff
library(dplyr) mtcars %>% mutate(across(qsec, ~(.x - min(qsec)) / (max(qsec) - min(qsec)))) %>% plot_incidence_vs_coverage(vs, qsec) mtcars %>% mutate(across(qsec, ~(.x - min(qsec)) / (max(qsec) - min(qsec)))) %>% plot_incidence_vs_coverage('vs', 'qsec', option = 'character') mtcars %>% mutate(across(qsec, ~(.x - min(qsec)) / (max(qsec) - min(qsec))), weights = runif(nrow(.))) %>% plot_incidence_vs_coverage(vs, qsec, weights = weights) mtcars %>% mutate(across(qsec, ~(.x - min(qsec)) / (max(qsec) - min(qsec))), weights = runif(nrow(.))) %>% plot_incidence_vs_coverage('vs', 'qsec', weights = 'weights', option = 'character')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.