R/auc.R

Defines functions auc

Documented in auc

#[export]
auc <- function(group, preds) {
    ri <- Rfast::Rank(preds)
    n <- length(group)
    n1 <- sum(group)
    n0 <- n - n1
    s1 <- Rfast::group(ri, group)[2]
    (s1 - 0.5 * n1 * (n1 + 1))/n0/n1
}

Try the Rfast package in your browser

Any scripts or data that you put into this service are public.

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.