比较 AUC
比较不同模型是模型选择的核心。在最后两个练习中,您将对本课程涉及的所有模型类型进行比较:决策树、袋装树、随机森林和梯度提升。
这些模型都已充分调参,并在相同的训练集 customers_train 上训练,并对 customers_test 数据集进行了预测。结果是数值型概率,已在您的会话中作为 preds_combined 提供:
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", ...
本练习是课程的一部分
R 中的树模型机器学习
交互式实操练习
通过完成这段示例代码来试试这个练习。
# 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