建立交叉驗證模型
在這個練習中,你要為交叉驗證中的每個摺疊建立邏輯斯迴歸模型。
你會使用 glm() 函式,並將 family 參數設為 "binomial" 來完成這項工作。
本練習屬於課程
Tidyverse 的 Machine Learning
練習說明
使用每個交叉驗證摺疊中的 train 資料,建立以所有可用特徵預測 Attrition 的模型。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Build a model using the train data for each fold of the cross validation
cv_models_lr <- cv_data %>%
mutate(model = map(___, ~glm(formula = ___,
data = ___, family = ___)))