1. Learn
  2. /
  3. Courses
  4. /
  5. Machine Learning with Tree-Based Models in R

Connected

Exercise

Plot ROC curves

You saw again that the boosted tree yields the highest AUC. Numbers are fine, but pictures are better! Why not visualize these results?

You are going to illustrate model performance by plotting all ROC curves on one common plot. As the AUC is literally the area under these ROC curves, the boosted model should have the largest area under its ROC curve and be the one in the upper left corner of the plot.

The predictions tibble, preds_combined, is still loaded.

Instructions

100 XP
  • Reshape the preds_combined tibble so that all columns that start with "preds_" are rows instead of columns. Convert the names to a "model" column and the values to a column called "predictions".
  • Group the results by model.
  • Calculate the ROC values for all cutoffs.
  • Produce a graphical plot of the curves.