gini {ModelMetrics} | R Documentation |
Calculates the GINI coefficient for a binary classifcation model
gini(...) ## Default S3 method: gini(actual, predicted, ...) ## S3 method for class 'glm' gini(modelObject, ...) ## S3 method for class 'randomForest' gini(modelObject, ...) ## S3 method for class 'glmerMod' gini(modelObject, ...) ## S3 method for class 'gbm' gini(modelObject, ...) ## S3 method for class 'rpart' gini(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') gini(testDF$y, Preds) # using s3 method for glm gini(glmModel)