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

Random forest with custom trainControl

Another one of my favorite models is the random forest, which combines an ensemble of non-linear decision trees into a highly flexible (and usually quite accurate) model.

Rather than using the classic randomForest package, you'll be using the ranger package, which is a re-implementation of randomForest that produces almost the exact same results, but is faster, more stable, and uses less memory. I highly recommend it as a starting point for random forest modeling in R.

Bu egzersiz

Machine Learning with caret in R

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

Egzersiz talimatları

churn_x and churn_y are loaded in your workspace.

  • Fit a random forest model to the churn dataset. Be sure to use myControl as the trainControl like you've done before and implement the "ranger" method.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Fit random forest: model_rf
model_rf <- train(
  x = ___, 
  y = ___,
  metric = "ROC",
  method = ___,
  trControl = ___
)
Kodu Düzenle ve Çalıştır