Area under the ROC curve
The area under the ROC curve boils down many other performance estimates to one single number and allows you to assess a model's performance very quickly. For this reason, it is a very common performance measure for classification models.
Using AUC, you can rate the performance of a model using a grading system, where A is the best grade:
| AUC | Grade |
|---|---|
| 0.9 - 1 | A |
| 0.8 - 0.9 | B |
| 0.7 - 0.8 | C |
| 0.6 - 0.7 | D |
| 0.5 - 0.6 | E |
You are going to calculate your model's AUC using the predictions tibble from the last exercise, which is still loaded.
Deze oefening maakt deel uit van de cursus
Machine Learning with Tree-Based Models in R
Oefeninstructies
- Calculate the area under the ROC curve using the
roc_auc()function and thepredictionstibble.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Calculate area under the curve
auc_result <- ___(___,
estimate = ___,
truth = ___)
print(paste("The area under the ROC curve is", round(auc_result$.estimate, 3)))