auc {ModelMetrics} | R Documentation |
Calculates the area under the curve for a binary classifcation model
auc(...) ## Default S3 method: auc(actual, predicted, ...) ## S3 method for class 'glm' auc(modelObject, ...) ## S3 method for class 'randomForest' auc(modelObject, ...) ## S3 method for class 'glmerMod' auc(modelObject, ...) ## S3 method for class 'gbm' auc(modelObject, ...) ## S3 method for class 'rpart' auc(modelObject, ...)
... |
additional parameters to be passed the the s3 methods |
actual |
A vector of the labels. Can be |
predicted |
A vector of predicted values |
modelObject |
the model object. Currently supported |
data(testDF) glmModel <- glm(y ~ ., data = testDF, family="binomial") Preds <- predict(glmModel, type = 'response') auc(testDF$y, Preds) # using s3 method for glm auc(glmModel)