拟合、增广与评估
您已经可以将工作流拟合到训练数据,并使用测试划分评估其性能。
工作空间中已提供 embed 包、lr_workflow_glm 对象,以及对应的 test 和 train 划分。
本练习是课程的一部分
R 中的特征工程
练习说明
- 将工作流拟合到训练集。
- 使用测试划分对拟合结果进行增广。
- 评估模型。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Fit the workflow to the training set
lr_fit_glm <- lr_workflow_glm %>%
___(train)
# Augment the fit using the test split
lr_aug_glm <- lr_fit_glm %>%
___(test)
# Assess the model
glm_metrics <- lr_aug_glm %>%
class_evaluate(truth = ___,
estimate = .pred_class,
.pred_Yes)
glm_metrics