Seeing the forest from the trees

Supervised Learning in R: Classification

Brett Lantz

Instructor

Understanding random forests

Trees in a Forest

Supervised Learning in R: Classification

Making decisions as an ensemble

Single Complex Tree vs. Three Simple Trees

Five Models Voting

Supervised Learning in R: Classification

Random forests in R

# building a simple random forest
library(randomForest)
m <- randomForest(repaid ~ credit_score + request_amt, data = loans,
             ntree = 500,    # number of trees in the forest
             mtry = sqrt(p)) # number of predictors (p) per tree
# making predictions from a random forest
p <- predict(m, test_data)
Supervised Learning in R: Classification

Let's practice!

Supervised Learning in R: Classification

Preparing Video For Download...