R: Area Under the Curve

auc {ModelMetrics} | R Documentation

## Area Under the Curve

### Description

Calculates the area under the curve for a binary classifcation model

### Usage

    auc(actual, predicted)

### Arguments

`actual` | A vector of the labels. Can be `numeric, character, or factor`
`predicted` | A vector of predicted values

### Examples

    data(testDF)
    glmModel <- glm(y ~ ., data = testDF, family="binomial")
    Preds <- predict(glmModel, type = 'response')

    auc(testDF$y, Preds)

[Package ModelMetrics version 1.1.0 Index]