BaşlayınÜcretsiz Başlayın

Setting up your workflow

You want to investigate if JobRole alone can be a predictor for Attrition. Given that JobRole is a factor, you plan to use a Bayes encoder to represent it numerically in your model.

The embed package and the corresponding test and train splits from the attrition dataset are loaded in your workspace.

Bu egzersiz

Feature Engineering in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Create recipe using the Bayes encoder.
  • Bundle the model and recipe with a workflow.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

lr_model <- logistic_reg()
# Create recipe using the Bayes encoder
lr_recipe_glm <- 
  recipe(Attrition ~ JobRole, data = train) %>%
  ___(JobRole, outcome = ___(Attrition))

# Bundle with workflow
lr_workflow_glm <-
  workflow() %>%
  add_model(lr_model) %>%
  add_recipe(___)

lr_workflow_glm
Kodu Düzenle ve Çalıştır