DATA
## Warning: package 'randomForest' was built under R version 4.3.3
## Warning: package 'gmodels' was built under R version 4.3.3
Training and Validation
Random Forest
## Attrited Customer Existing Customer
## Customer_Age 0.0048885284 5.290546e-03
## Gender 0.0059976298 1.050058e-03
## Dependent_count 0.0010273548 6.119678e-04
## Education_Level -0.0007544651 1.809427e-05
## Marital_Status 0.0003068270 1.487919e-03
## Income_Category 0.0009654477 5.031246e-04
## Card_Category 0.0001753997 2.821396e-04
## Months_on_book 0.0044344602 1.904384e-03
## Total_Relationship_Count 0.0260583620 2.860213e-02
## Months_Inactive_12_mon 0.0301317520 8.467021e-04
## Contacts_Count_12_mon 0.0094103123 4.379267e-03
## Credit_Limit 0.0178470301 1.711312e-02
## Total_Revolving_Bal 0.0571568148 4.940628e-02
## Avg_Open_To_Buy 0.0167224649 1.514316e-02
## Total_Amt_Chng_Q4_Q1 0.0357022716 8.065363e-03
## Total_Trans_Amt 0.1204450616 9.316191e-02
## Total_Trans_Ct 0.2413539136 1.034972e-01
## Total_Ct_Chng_Q4_Q1 0.0681685902 1.447942e-02
## Avg_Utilization_Ratio -0.0001970127 4.279358e-02
## MeanDecreaseAccuracy MeanDecreaseGini
## Customer_Age 0.0052264409 63.682741
## Gender 0.0018526039 17.232420
## Dependent_count 0.0006787484 23.541956
## Education_Level -0.0001081564 21.595431
## Marital_Status 0.0012955379 19.562949
## Income_Category 0.0005760481 21.897665
## Card_Category 0.0002642504 4.758797
## Months_on_book 0.0023133405 48.750948
## Total_Relationship_Count 0.0281910095 128.643527
## Months_Inactive_12_mon 0.0055849724 48.414445
## Contacts_Count_12_mon 0.0051920028 50.822254
## Credit_Limit 0.0172201199 66.756388
## Total_Revolving_Bal 0.0506832518 199.266082
## Avg_Open_To_Buy 0.0154019635 61.409084
## Total_Amt_Chng_Q4_Q1 0.0125315573 124.407907
## Total_Trans_Amt 0.0975791914 353.001163
## Total_Trans_Ct 0.1257940488 341.542248
## Total_Ct_Chng_Q4_Q1 0.0231448508 212.219826
## Avg_Utilization_Ratio 0.0358517386 126.751497

Cross Table
## Attrited Customer Existing Customer class.error
## Attrited Customer 954 200 0.17331023
## Existing Customer 74 5904 0.01237872
##
##
## Cell Contents
## |-------------------------|
## | N |
## | Chi-square contribution |
## | N / Row Total |
## | N / Col Total |
## | N / Table Total |
## |-------------------------|
##
##
## Total Observations in Table: 2995
##
##
## | val$predicted_Attrition_Flag
## val$Attrition_Flag | Attrited Customer | Existing Customer | Row Total |
## -------------------|-------------------|-------------------|-------------------|
## Attrited Customer | 390 | 83 | 473 |
## | 1579.392 | 257.609 | |
## | 0.825 | 0.175 | 0.158 |
## | 0.929 | 0.032 | |
## | 0.130 | 0.028 | |
## -------------------|-------------------|-------------------|-------------------|
## Existing Customer | 30 | 2492 | 2522 |
## | 296.214 | 48.315 | |
## | 0.012 | 0.988 | 0.842 |
## | 0.071 | 0.968 | |
## | 0.010 | 0.832 | |
## -------------------|-------------------|-------------------|-------------------|
## Column Total | 420 | 2575 | 2995 |
## | 0.140 | 0.860 | |
## -------------------|-------------------|-------------------|-------------------|
##
##