fastAUC: Fast AUC

Description Usage Arguments Value See Also Examples

View source: R/my_functions.r

Description

This function calculates the Area Under the Reciever-Operator Curve from the results of a classifcation model.

Usage

1
fastAUC(probs, class, method = "trqwe")

Arguments

probs

A numeric vector of probabilities or likelihoods for each data point.

class

A numeric vector where 1 is positive and 0 is negative.

Value

The AUC.

See Also

Reference https://stat.ethz.ch/pipermail/r-help/2005-September/079872.html

Examples

1
2
3
4
5
6
7
8
library(AppliedPredictiveModeling)
data(abalone)
library(glmnet)
class <- factor(as.numeric(abalone$Type == "M"))
data <- data.matrix(abalone[,-1])
fit <- cv.glmnet(data, class, family="binomial")
probs <- predict(fit, newx=data)[,1]
fastAUC(probs, class)

traversc/trqwe documentation built on Dec. 4, 2020, 4:21 a.m.