CommencerCommencer gratuitement

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

Cet exercice fait partie du cours

Credit Risk Modeling in R

Afficher le cours

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 (for ROC_undersample), and lines() for the other three models to the same plot. Use the col-argument to change the color of the curve of ROC_prior to blue, ROC_loss_matrix to red and ROC_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().

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de 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



Modifier et exécuter le code