ComenzarEmpieza gratis

Assess

The time has come for a reckoning. Tune your model to find out the optimal penalty value and fit a final model to assess your work.

Your workflow, penalty grid, and user-defined class_evaluate() function are available in your environment.

Este ejercicio forma parte del curso

Feature Engineering in R

Ver curso

Instrucciones del ejercicio

  • Set up a tune_grid to explore your model performance against ROC_AUC.
  • Select the best penalty value.
  • Fit the final workflow with the best penalty.

Ejercicio interactivo práctico

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

# Set up a tune grid to explore your model performance against roc_auc
lr_tune_output <- ___(lr_workflow, resamples = vfold_cv(train, v = 5),
  metrics = metric_set(roc_auc), grid = lr_penalty_grid)

# Select the best penalty value
best_penalty <- ___(lr_tune_output, metric = 'roc_auc', desc(penalty)) 

# Fit the final workflow with the best penalty
lr_final_fit<- ___(lr_workflow, best_penalty) %>% fit(data = train)

lr_final_fit %>% augment(test) %>% 
class_evaluate(truth = Attrition, estimate = .pred_class, .pred_Yes)
Editar y ejecutar código