Objective

Predict customer attrition using the CreditCardData using the classification algorithm from the rpart package.

Data Prep

The Tree

Two Interpretations from the Tree

  1. Most common among existing customers:
  1. Most common among attrited customers:

Variable Importance

Model Accuracy

## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  2990 
## 
##  
##                           | validation_tree$attrition_predicted 
## validation_tree$attrition |         0 |         1 | Row Total | 
## --------------------------|-----------|-----------|-----------|
##                         0 |      2418 |        90 |      2508 | 
##                           |    39.758 |   222.084 |           | 
##                           |     0.964 |     0.036 |     0.839 | 
##                           |     0.953 |     0.198 |           | 
##                           |     0.809 |     0.030 |           | 
## --------------------------|-----------|-----------|-----------|
##                         1 |       118 |       364 |       482 | 
##                           |   206.873 |  1155.572 |           | 
##                           |     0.245 |     0.755 |     0.161 | 
##                           |     0.047 |     0.802 |           | 
##                           |     0.039 |     0.122 |           | 
## --------------------------|-----------|-----------|-----------|
##              Column Total |      2536 |       454 |      2990 | 
##                           |     0.848 |     0.152 |           | 
## --------------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  1624.287     d.f. =  1     p =  0 
## 
## Pearson's Chi-squared test with Yates' continuity correction 
## ------------------------------------------------------------
## Chi^2 =  1618.706     d.f. =  1     p =  0 
## 
##