#########################################################
# Example 1
df <-
data.frame(
truth = c(1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0)
, pred = c(1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0)
)
cm <- confusion_matrix(df$truth, df$pred)
qroc(cm)
qprc(cm)
#########################################################
# Getting a ROC or PRC plot from a glm object:
mod <- glm(
formula = spam ~ word_freq_our + word_freq_over + capital_run_length_total
, data = spambase
, family = binomial()
)
qroc(mod)
qprc(mod)
#########################################################
# View the vignette for more examples
if (FALSE) {
vignette("qwraps2-graphics")
}
Run the code above in your browser using DataLab