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

Ensembling models

That concludes the course! As a teaser for a future course on making ensembles of caret models, I'll show you how to fit a stacked ensemble of models using the caretEnsemble package.

caretEnsemble provides the caretList() function for creating multiple caret models at once on the same dataset, using the same resampling folds. You can also create your own lists of caret models.

In this exercise, I've made a caretList for you, containing the glmnet and ranger models you fit on the churn dataset. Use the caretStack() function to make a stack of caret models, with the two sub-models (glmnet and ranger) feeding into another (hopefully more accurate!) caret model.

Bu egzersiz

Machine Learning with caret in R

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

Egzersiz talimatları

  • Call the caretStack() function with two arguments, model_list and method = "glm", to ensemble the two models using a logistic regression. Store the result as stack.
  • Summarize the resulting model with the summary() function.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create ensemble model: stack
stack <- 

# Look at summary
Kodu Düzenle ve Çalıştır