ROC-curves for comparison of tree-based models
It's time for you to repeat the previous exercises, now comparing the tree-based models. The pROC()
is now loaded in your workspace. The PD-predictions for tree-based methods are stored in the objects
predictions_undersample
predictions_prior
predictions_loss_matrix
predictions_weights
This exercise is part of the course
Credit Risk Modeling in R
Exercise instructions
- Construct the ROC-objects for the tree based methods using function
roc(response, predictor)
. - Use the previously created objects to construct ROC-curves. To draw them all on one plot, use
plot()
for the first ROC-curve drawn (forROC_undersample
), andlines()
for the other three models to the same plot. Use thecol
-argument to change the color of the curve ofROC_prior
to blue,ROC_loss_matrix
to red andROC_weights
to green. - To get a better idea of the performance of the ROC-curves, have a look at the AUC's using function
auc()
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Construct the objects containing ROC-information
ROC_undersample <-
ROC_prior <-
ROC_loss_matrix <-
ROC_weights <-
# Draw the ROC-curves in one plot
# Compute the AUCs