Reintroducing random forest

Machine Learning with caret in R

Zach Mayer

Data Scientist at DataRobot and co-author of caret

Random forest review

  • Slower to fit than glmnet
  • Less interpretable
  • Often (but not always) more accurate than glmnet
  • Easier to tune
  • Require little preprocessing
  • Capture threshold effects and variable interactions
Machine Learning with caret in R

Random forest on churn data

set.seed(42)
churnTrain$churn <- factor(
  churnTrain$churn, levels = c("no", "yes")
)
model_rf <- train(
  churn ~ ., 
  churnTrain,
  metric = "ROC",
  method = "ranger", 
  trControl = myControl
)
Machine Learning with caret in R

Random forest on churn data

plot(model_rf)

pasted-image-1261.png

Machine Learning with caret in R

Let’s practice!

Machine Learning with caret in R

Preparing Video For Download...