Learn R Programming

Fast AUC computation in R

Fast and lightweight computation of AUC metric for the binary case (1 positive and 0 negative) is offered by lightAUC package. The algorithm used is a fast implementation from algorithm of Fawcett (2006).

Install

The official (CRAN) version of the package can be installed using

install.packages("lightAUC")

Alternatively, the development version of the package can be installed via

if (!require(remotes)) install.packages("remotes")
remotes::install_github("cadam00/lightAUC")

Citation

To cite the official (CRAN) version of the package, please use

Example

# Create some data
probs   <- c(1, 0.4, 0.8)
actuals <- c(0, 0, 1)
lightAUC(probs, actuals)
## 0.5

For 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

References

Copy Link

Version

Install

install.packages('lightAUC')

Monthly Downloads

183

Version

0.1.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Christos Adam

Last Published

May 1st, 2025

Functions in lightAUC (0.1.3)

lightAUC

Fast AUC computation