擬合並擴充
現在 lr_workflow 已經就緒,你可以把它擬合到 test 資料以進行預測。
為了便於評估模型,你可以使用 augment() 為已擬合物件加入預測與機率,來進行擴充。
本練習屬於課程
R 的特徵工程
練習說明
- 將 workflow 擬合到
train資料。 - 使用
test資料擴充lr_fit物件,讓它可以進行評估。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Fit the workflow to the train data
lr_fit <-
___(___, data = train)
# Augment the lr_fit object
lr_aug <-
___(lr_fit, new_data = ___)
lr_aug