ÎncepețiÎncepe gratuit

step_poly()

Now that you have a baseline, you can compare your model's performance if you add a polynomial transformation to all numerical values.

The attrition_numdata, the logistic regression lr_model, the user-defined class-evaluate() function, and the trainand test splits have already been loaded for you.

Acest exercițiu face parte din cursul

Feature Engineering in R

Vezi cursul

Instrucțiuni pentru exercițiu

  • Add a polynomial transformation to all numeric predictors.
  • Fit workflow to the train data.

Exercițiu interactiv practic

Încearcă acest exercițiu completând acest cod de exemplu.

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

# Add a polynomial transformation to all numeric predictors
  ___

lr_workflow_poly <- workflow() %>%
  add_model(lr_model) %>%
  add_recipe(lr_recipe_poly)

# Fit workflow to the train data
lr_fit_poly <- ___ %>% fit(train)
lr_aug_poly <- lr_fit_poly %>% augment(test)
lr_aug_poly %>% class_evaluate(truth = Attrition, estimate = .pred_class,.pred_No)
Editează și rulează codul