BaşlayınÜcretsiz Başlayın

Finalizing the model

It is time to implement the results of your tuning work and impress the Human Resources team. You can finalize your model with the optimal penalty identified and see if it meets your expectations. Your results have been loaded, and the user-defined function class_evaluate() is available in your environment.

Bu egzersiz

Feature Engineering in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Select the optimal penalty for the Lasso.
  • Fit a final model using the optimal penalty.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Select the optimal penalty for the Lasso
best_penalty <- ___(tune_output, metric = 'roc_auc', desc(penalty)) 
best_penalty

# Fit a final model using the optimal penalty
final_fit <- ___(workflow_lasso_tuned, best_penalty) %>%
  fit(data = train)

final_fit %>% tidy()

final_fit %>% augment(test) %>% class_evaluate(truth = Attrition, 
                                   estimate = .pred_class,
                                   .pred_Yes)
Kodu Düzenle ve Çalıştır