Objective

Predict attrition using the CreditCard data from the AER package, using the classification algorithm from the rpart package.

Data Prep

The Tree

Two Interpretations from the Tree

  1. The most likely attritioned customers:
    • have a relationship count < 3
    • Smaller rolving balance (relovling balance < 614)
    • Less transactions (total transactions < 79)
  2. Unlikely attrition
    • Heavy User (total transactions >= 5423)

Variable Importance

Interesting how balance is perceived by many as a predictor for attrition. However, the data shows that it is not a good predictor

Model Accuracy

Using the validation data, it is observed that the model is able to:

## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  2990 
## 
##  
##                                     | validation_tree$atrittion_predicted 
## validation_tree$atrittion_predicted | Attrited Customer | Existing Customer |         Row Total | 
## ------------------------------------|-------------------|-------------------|-------------------|
##                   Attrited Customer |               454 |                 0 |               454 | 
##                                     |          2150.935 |           385.065 |                   | 
##                                     |             1.000 |             0.000 |             0.152 | 
##                                     |             1.000 |             0.000 |                   | 
##                                     |             0.152 |             0.000 |                   | 
## ------------------------------------|-------------------|-------------------|-------------------|
##                   Existing Customer |                 0 |              2536 |              2536 | 
##                                     |           385.065 |            68.935 |                   | 
##                                     |             0.000 |             1.000 |             0.848 | 
##                                     |             0.000 |             1.000 |                   | 
##                                     |             0.000 |             0.848 |                   | 
## ------------------------------------|-------------------|-------------------|-------------------|
##                        Column Total |               454 |              2536 |              2990 | 
##                                     |             0.152 |             0.848 |                   | 
## ------------------------------------|-------------------|-------------------|-------------------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  2990     d.f. =  1     p =  0 
## 
## Pearson's Chi-squared test with Yates' continuity correction 
## ------------------------------------------------------------
## Chi^2 =  2982.24     d.f. =  1     p =  0 
## 
##