Aan de slagGa gratis aan de slag

Baseline

Continuing with the attrition_num dataset, you will create a baseline with a plain recipe to assess the effects of additional feature engineering steps. 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.

Deze oefening maakt deel uit van de cursus

Feature Engineering in R

Cursus bekijken

Oefeninstructies

  • Bundle the model and recipe into a workflow.
  • Augment the fitted workflow to get it ready for assessment.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

lr_recipe_plain <- recipe(Attrition ~., data = train)

# Bundle the model and recipe
lr_workflow_plain <- workflow() %>%
  ___(lr_model) %>%
  ___(lr_recipe_plain)
lr_fit_plain <- lr_workflow_plain %>%
  fit(train)

# Augment the fit workflow
lr_aug_plain <- lr_fit_plain %>%
  ___(___)
lr_aug_plain %>%
  class_evaluate(truth = Attrition,estimate = .pred_class,
                 .pred_No)
Code bewerken en uitvoeren