Supervised Learning in R: Classification
Brett Lantz
Instructor
# 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