Perform the following steps to classify the telecom churn dataset with the boosting method:
- You can use the boosting function from the adabag package to train the classification model:
> set.seed(2) > churn.boost = boosting(churn ~.,data=trainset,mfinal=10,
coeflearn="Freund", boos=FALSE , control=rpart.control(maxdepth=3))
- You can then make a prediction based on the boosted model and testing dataset:
> churn.boost.pred = predict.boosting(churn.boost,newdata=testset)
- Next, you can retrieve the classification table from the predicted results:
> churn.boost.pred$confusion Output Observed Class Predicted Class yes no no 41 858 yes 100 19
- Finally, you can obtain the average errors from the predicted results:
> churn.boost.pred$error Output [1] 0.0589391