Package 'lightAUC'

Title: Fast AUC Computation
Description: Fast calculation of Area Under Curve (AUC) metric of a Receiver Operating Characteristic (ROC) curve, using the algorithm of Fawcett (2006) <doi:10.1016/j.patrec.2005.10.010>. Therefore it is appropriate for large-scale AUC metric calculations.
Authors: Christos Adam [aut, cre]
Maintainer: Christos Adam <[email protected]>
License: GPL-3
Version: 0.1.2
Built: 2025-03-13 07:04:34 UTC
Source: CRAN

Help Index


Fast AUC computation

Description

Fast and memory efficient AUC computation.

Usage

lightAUC(probs, actuals, parallel = FALSE, cores = 2)

Arguments

probs

numeric vector containing probability from the model, where closer to 1 is for the positive class and closer to 0 is for the negative class.

actuals

integer, numeric or logical vector with the actual data, where is 1 for the positive class and 0 for the negative class.

parallel

logical indicating if multithreading should be used. The default is no multithreading (parallel = FALSE).

cores

integer indicating the number of threads to be used when parallel = TRUE. The default is cores=2, meaning that 2 cores are used.

Details

Binary AUC computation according to Fawcett (2006) doi:10.1016/j.patrec.2005.10.010.

Value

numeric value representing the AUC metric.

References

Fawcett, T. (2006). An introduction to ROC analysis. Pattern Recognition Letters, 27(8), 861–874. doi:10.1016/j.patrec.2005.10.010

Examples

probs   <- c(1, 0.4, 0.8)
actuals <- c(0, 0, 1)
lightAUC(probs, actuals)

probs   <- c(1, 0.4, 0.8)
actuals <- c(FALSE, FALSE, TRUE)
lightAUC(probs, actuals)

probs   <- c(1, 0.4, 0.8)
actuals <- c(0, 0, 1)
lightAUC(probs, actuals, parallel = TRUE, cores = 2L)