ROC 曲線下面積
ROC 曲線下面積(AUC)可以把許多其他的效能估計濃縮成單一數值,讓你能很快評估模型表現。也因此,它是分類模型中非常常見的效能指標。
使用 AUC,你可以用分級制度來評估模型效能,其中 A 為最佳等級:
| 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 |
你將使用先前練習中產生、且仍已載入的 predictions tibble 來計算模型的 AUC。
本練習屬於課程
R 的樹狀模型機器學習
練習說明
- 使用
roc_auc()函式與predictionstibble 計算 ROC 曲線下面積。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Calculate area under the curve
auc_result <- ___(___,
estimate = ___,
truth = ___)
print(paste("The area under the ROC curve is", round(auc_result$.estimate, 3)))