Predicting Customer Conversion with Random Forests
1. Predicting Customer Conversion
with Random Forests
A Decision Trees Case Study
Daniel Gerlanc, Principal
Enplus Advisors, Inc.
www.enplusadvisors.com
dgerlanc@enplusadvisors.com
2. Topics
Objectives Research Question
Bank Prospect
Data
Conversion
Decision Trees
Methods
Random Forests
Results
11. Decision Tree Code
tree.1 <- rpart(takes.loan ~ ., data=bank)
• See the „rpart‟ and „rpart.plot‟ R packages.
• Many parameters available to control the fit.
16. Building RF
• Sample from the data
• At each split, sample from the available
variables
• Repeat for each tree
17. Motivations for RF
• Create uncorrelated trees
• Variance reduction
• Subspace exploration
18. Random Forests
rffit.1 <- randomForest(takes.loan ~ ., data=bank)
Most important parameters are:
Variable Description Default
ntree Number of Trees 500
mtry Number of variables to randomly • square root of # predictors for
select at each node classification
• # predictors / 3 for regression
19. How‟d it do?
Naïve Accuracy: 11.7%
Random Forest
• Precision: 64.5% (2541 / 3937)
• Recall: 48% (2541 / 5289)
Actual
Predicted yes no
yes (1) 2,541 (3) 2748
no (2) 1,396 (4) 38,526
21. Benefits of RF
• Good accuracy with default settings
• Relatively easy to make parallel
• Many implementations
• R, Weka, RapidMiner, Mahout
22. References
• A. Liaw and M. Wiener (2002). Classification and Regression by randomForest. R News 2(3), 18--22.
• Breiman, Leo. Classification and Regression Trees. Belmont, Calif: Wadsworth International Group, 1984. Print.
• Brieman, Leo and Adele Cutler. Random forests. http://www.stat.berkeley.edu/~breiman/RandomForests/cc_contact.htm
• S. Moro, R. Laureano and P. Cortez. Using Data Mining for Bank Direct Marketing: An Application of the CRISP-DM
Methodology. In P. Novais et al. (Eds.), Proceedings of the European Simulation and Modelling Conference - ESM'2011,
pp. 117-121, Guimarães, Portugal, October, 2011. EUROSIS.
Notas del editor
Tools that help you decide how to spend those limited resources.