LoslegenKostenlos loslegen

Fitting and assessing the model

Now that you have addressed missing values and created dummy variables, it is time to assess your model's performance!

The attritiondataset, along with the testand train splits, the lr_recipe and your declared logistic_model() are all loaded for you.

Diese Übung ist Teil des Kurses

Feature Engineering in R

Kurs anzeigen

Anleitung zur Übung

  • Bundle model and recipe in workflow.
  • Fit workflow to the train data.
  • Generate an augmented data frame for performance assessment.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Bundle model and recipe in workflow
lr_workflow <- ___() %>%
  add_model(lr_model) %>%
  add_recipe(lr_recipe)

# Fit workflow to the train data
lr_fit <- ___(lr_workflow, data = train)

# Generate an augmented data frame for performance assessment
lr_aug <- lr_fit %>% ___(test)

lr_aug %>% roc_curve(truth = Attrition, .pred_No) %>% autoplot()
bind_rows(lr_aug %>% roc_auc(truth = Attrition, .pred_No),          
          lr_aug %>% accuracy(truth = Attrition, .pred_class))
Code bearbeiten und ausführen