Create a Classification Tree to predict customer attrition.
The data has 10127 observations. The data was split into training and validation datasets (70/30), ( 7149 / 2978 ).
Customers Likely to leave:
Customers not likely to leave
##
##
## Cell Contents
## |-------------------------|
## | N |
## | Chi-square contribution |
## | N / Row Total |
## | N / Col Total |
## | N / Table Total |
## |-------------------------|
##
##
## Total Observations in Table: 2978
##
##
## | validation_tree$Attrition_Flag_predicted
## validation_tree$Attrition_Flag | Attrited Customer | Existing Customer | Row Total |
## -------------------------------|-------------------|-------------------|-------------------|
## Attrited Customer | 363 | 102 | 465 |
## | 1308.092 | 220.154 | |
## | 0.781 | 0.219 | 0.156 |
## | 0.846 | 0.040 | |
## | 0.122 | 0.034 | |
## -------------------------------|-------------------|-------------------|-------------------|
## Existing Customer | 66 | 2447 | 2513 |
## | 242.046 | 40.737 | |
## | 0.026 | 0.974 | 0.844 |
## | 0.154 | 0.960 | |
## | 0.022 | 0.822 | |
## -------------------------------|-------------------|-------------------|-------------------|
## Column Total | 429 | 2549 | 2978 |
## | 0.144 | 0.856 | |
## -------------------------------|-------------------|-------------------|-------------------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 1811.029 d.f. = 1 p = 0
##
## Pearson's Chi-squared test with Yates' continuity correction
## ------------------------------------------------------------
## Chi^2 = 1804.916 d.f. = 1 p = 0
##
##