R/auc.R
get_auc.Rd
Get AUC value
get_auc(y_pred, y, type = c("pr", "roc"), curve = FALSE)
y prediction vector.
y true label vector.
AUC type, either 'pr' or 'roc'.
if TRUE, generate plot data, the result can be plotted by plot().
TRUE
plot()
A object.
if (require("PRROC")) { set.seed(2021) auc <- get_auc(sample(1:10, 10), c(rep(0, 5), rep(1, 5))) auc }