Bandingkan AUC
Membandingkan berbagai model adalah inti dari pemilihan model. Pada dua latihan terakhir, Anda akan melakukan perbandingan model untuk semua jenis model di kursus ini: decision tree, bagged tree, random forest, dan gradient boosting.
Semua model telah disetel dengan optimal dan dilatih pada himpunan latih yang sama, customers_train, dan prediksi dibuat untuk himpunan data customers_test. Hasilnya berupa probabilitas numerik dan tersedia sebagai preds_combined dalam sesi Anda:
tibble [1,011 × 5]
$ preds_tree : 0.144 0.441 ...
$ preds_bagging : 0.115 0.326 ...
$ preds_forest : 0 0 0 0.286 ...
$ preds_boosting: 0.136 0.149 ...
$ still_customer: "no","no", ...
Latihan ini adalah bagian dari kursus
Machine Learning dengan Model Berbasis Pohon di R
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
# Calculate the AUC for each model
auc_tree <- ___(preds_combined, truth = ___, estimate = ___)
auc_bagged <- ___(preds_combined, truth = ___, estimate = ___)
auc_forest <- ___(preds_combined, truth = ___, estimate = ___)
auc_boost <- ___(preds_combined, truth = ___, estimate = ___)
# Print the results
auc_tree
auc_bagged
auc_forest
auc_boost