Fast and lightweight computation of AUC metric for the binary case (1positive and 0 negative) is offered bylightAUC package. Thealgorithm used is a fast implementation from algorithm of Fawcett (2006).
The official(CRAN) versionof the package can be installed using
install.packages("lightAUC")Alternatively, the development version of the package can beinstalled via
if (!require(remotes))install.packages("remotes")remotes::install_github("cadam00/lightAUC")To cite the official(CRAN)version of the package, please use
Adam, C. (2025). lightAUC: Fast AUC Computation. R package version0.1.3. doi:10.32614/CRAN.package.lightAUC
# Create some dataprobs<-c(1,0.4,0.8)actuals<-c(0,0,1)lightAUC(probs, actuals)## 0.5For parallel calculations use:
# E.g. 2 cores (you can use cores = parallel::detectCores() for your case)probs<-c(1,0.4,0.8)actuals<-c(0,0,1)lightAUC(probs, actuals,parallel =TRUE,cores =2)## 0.5 Fawcett, T. (2006). Anintroduction to ROC analysis.