Objective

Predict attrition using the CreditCardData data from the AERpackage, using the classification algorithm from the rpart package. ### Data Prep Classified observations by attrition and existing customer Split the data (10127 observations) into training and validation datasets (70%/30%)

The Tree

Two Interpretations from the Tree

  1. Staying with the card is most likely when total transation count > 55 and whentotal transaction count >= 5243.

  2. Attrition is least likely when: total transaction count < 55, total revolving balance < $614, total count change from Q4 -> Q1 < 0.65, and the relationship count < 3.

Variable Importance

It makes sense that the higher the higher the total transaction count, the more likely attrition is.

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_Flag 
## validation_tree$Attrition_Flag | Attrited Customer | Existing Customer |         Row Total | 
## -------------------------------|-------------------|-------------------|-------------------|
##              Attrited Customer |               482 |                 0 |               482 | 
##                                |          2103.700 |           404.300 |                   | 
##                                |             1.000 |             0.000 |             0.161 | 
##                                |             1.000 |             0.000 |                   | 
##                                |             0.161 |             0.000 |                   | 
## -------------------------------|-------------------|-------------------|-------------------|
##              Existing Customer |                 0 |              2508 |              2508 | 
##                                |           404.300 |            77.700 |                   | 
##                                |             0.000 |             1.000 |             0.839 | 
##                                |             0.000 |             1.000 |                   | 
##                                |             0.000 |             0.839 |                   | 
## -------------------------------|-------------------|-------------------|-------------------|
##                   Column Total |               482 |              2508 |              2990 | 
##                                |             0.161 |             0.839 |                   | 
## -------------------------------|-------------------|-------------------|-------------------|
## 
##  
## 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.609     d.f. =  1     p =  0 
## 
##