Learn R Programming

funModeling (version 1.1)

model_performance: Get model perfomance metrics (KS, AUC and ROC)

Description

Get model performance for tree models (rpart library), or glm. It returns quality metrics: AUC (Area Under ROC Curve) and KS (Kolmogorov-Smirnov), and plots the ROC curve.

Usage

model_performance(fit, data, target_var)

Arguments

fit
model, it could be any of the following: decision tree from rpart package, glm model or randomForest.
data
data frame used to build the model. Also it supports data for testing, (it has to contain same columns as training data.
target_var
It's the name of the column used as target/outcome. It's an string value, write it between apostrohpe.

Value

None.

Examples

Run this code
fit_glm=glm(has_heart_disease ~ age + oldpeak, data=heart_disease, family = binomial)
model_performance(fit=fit_glm, data = heart_disease, target_var = "has_heart_disease")

Run the code above in your browser using DataLab