Get startedGet started for free

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.

This exercise is part of the course

Feature Engineering in R

View Course

Exercise instructions

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

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

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)
Edit and Run Code