Predict customer attrition using the CreditCardData using the classification algorithm from the rpart package.
attrition by classifying
observations with existing customers as 0, and with attrited customers
as 1.##
##
## 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
##
##