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

Who's staying?

It's time to practice combining several transformations to the attrition_num data. First, normalize or near-normalize numeric variables by applying a Yeo-Johnson transformation. Next, transform numeric predictors to percentiles, create dummy variables, and eliminate features with near zero variance.

Bu egzersiz

Feature Engineering in R

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

Egzersiz talimatları

  • Apply a Yeo-Johnson transformation to all numeric variables.
  • Transform all numeric predictors into percentiles.
  • Create dummy variables for all nominal predictors.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

lr_recipe <- recipe(Attrition ~., data = train) %>%

# Apply a Yeo-Johnson transformation to all numeric variables
  ___ %>%

# Transform all numeric predictors into percentiles
 ___ %>%

# Create dummy variables for all nominal predictors
  ___

lr_workflow <- workflow() %>% add_model(lr_model) %>% add_recipe(lr_recipe)
lr_fit <- lr_workflow %>% fit(train)
lr_aug <- lr_fit %>% augment(test)
lr_aug %>% class_evaluate(truth = Attrition, estimate = .pred_class,.pred_No)
Kodu Düzenle ve Çalıştır