Learn R Programming

sigr (version 1.1.5)

calcAUC: calculate AUC.

Description

Based on: https://blog.revolutionanalytics.com/2016/08/roc-curves-in-two-lines-of-code.html

Usage

calcAUC(modelPredictions, yValues, ..., na.rm = FALSE, yTarget = TRUE)

Value

area under curve

Arguments

modelPredictions

numeric predictions (not empty), ordered (either increasing or decreasing)

yValues

truth values (not empty, same length as model predictions)

...

force later arguments to bind by name.

na.rm

logical, if TRUE remove NA values.

yTarget

value considered to be positive.

Examples

Run this code

sigr::calcAUC(1:4, c(TRUE,FALSE,TRUE,TRUE)) # should be 2/3

Run the code above in your browser using DataLab