step_*() 函式的執行順序
在一個 recipe 中的 step_*() 函式會依序執行。記住這一點很重要,才能避免在特徵工程流程中出現意外結果!
在這個練習中,你會把不同的 step_*() 函式組合進單一的 recipe,並觀察 step_*() 函式的先後順序對最終結果的影響。
這個工作階段已經載入 telecom_training 和 telecom_test 資料集。
本練習屬於課程
在 R 中使用 tidymodels 建立模型
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
telecom_recipe_1 <-
recipe(canceled_service ~ avg_data_gb + contract, data = ___) %>%
# Normalize numeric predictors
___(___) %>%
# Create dummy variables for nominal predictors
___(___, ___)