ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Feature Engineering in R

Ver curso

Instrucciones del ejercicio

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

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

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)
Editar y ejecutar código