October 2017
Beginner to intermediate
572 pages
26h 1m
English
Perform the following steps to classify data with random forest:
> install.packages("randomForest")
> library(randomForest)
> churn.rf = randomForest(churn ~ ., data = trainset, importance = T)
> churn.rf
Output
Call:
randomForest(formula = churn ~ ., data = trainset, importance = T)
Type of random forest: classification
Number of trees: 500
No. of variables tried at each split: 4
OOB estimate of error rate: 4.88%
Confusion matrix:
yes no class.error
yes 247 95 0.277777778
no 18 1955 0.009123163
> churn.prediction = predict(churn.rf, ...
Read now
Unlock full access