Objective

Predict Customer Attrition using the Credit Card data set , using the classification algorithm from the rpart package.

Data Prep

Split the data (10127 observations), into training and validation datasets (70%/30% , 7137/2990)

The Tree

Two Interpretations from the Tree

  1. The mosgt likely to ### Variable Importance Interesting how months on the 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:

Predict correctly 27% of the cheaters Misclassify faithful people as cheaters 8.6% of the time

## 
##  
##    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_predicted | Attrited Customer | Existing Customer |         Row Total | 
## -----------------------------------------|-------------------|-------------------|-------------------|
##                        Attrited Customer |               364 |                90 |               454 | 
##                                          |          1155.572 |           222.084 |                   | 
##                                          |             0.802 |             0.198 |             0.152 | 
##                                          |             0.755 |             0.036 |                   | 
##                                          |             0.122 |             0.030 |                   | 
## -----------------------------------------|-------------------|-------------------|-------------------|
##                        Existing Customer |               118 |              2418 |              2536 | 
##                                          |           206.873 |            39.758 |                   | 
##                                          |             0.047 |             0.953 |             0.848 | 
##                                          |             0.245 |             0.964 |                   | 
##                                          |             0.039 |             0.809 |                   | 
## -----------------------------------------|-------------------|-------------------|-------------------|
##                             Column Total |               482 |              2508 |              2990 | 
##                                          |             0.161 |             0.839 |                   | 
## -----------------------------------------|-------------------|-------------------|-------------------|
## 
##  
## 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 
## 
##