###Using the Credit Card Data which has 10,127 observations we will predict the attrition flag

The dataset contains a total of 10,127 observations. Our goal is to predict customer attrition, indicated by the “Attrition_Flag” variable.The dataset contains several predictor variables, including customer attributes like credit limit, transaction amount, and revolving balance.

We’re employing the random forest algorithm, known for its robustness in classification tasks. We’ll assess the importance of predictor variables using metrics such as Mean Decrease Gini. We’ll evaluate the model’s accuracy using the validation dataset. Based on provided assumptions, we’ll estimate the financial impact of our model, considering the costs and benefits of a customer retention program.

98.9% were predicted existing customers and existing customers. 16.4% were attrited customers when they were predicted existing customers. The financial impact of the model is that if there are a lot attrited customers, which in this model the percentage was only 16.4%, it would be bad for the company.

## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  3006 
## 
##  
##                    | val$Attrition_Flag_predicted 
## val$Attrition_Flag | Attrited Customer | Existing Customer |         Row Total | 
## -------------------|-------------------|-------------------|-------------------|
##  Attrited Customer |               412 |                77 |               489 | 
##                    |          1578.023 |           276.370 |                   | 
##                    |             0.843 |             0.157 |             0.163 | 
##                    |             0.920 |             0.030 |                   | 
##                    |             0.137 |             0.026 |                   | 
## -------------------|-------------------|-------------------|-------------------|
##  Existing Customer |                36 |              2481 |              2517 | 
##                    |           306.577 |            53.693 |                   | 
##                    |             0.014 |             0.986 |             0.837 | 
##                    |             0.080 |             0.970 |                   | 
##                    |             0.012 |             0.825 |                   | 
## -------------------|-------------------|-------------------|-------------------|
##       Column Total |               448 |              2558 |              3006 | 
##                    |             0.149 |             0.851 |                   | 
## -------------------|-------------------|-------------------|-------------------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  2214.663     d.f. =  1     p =  0 
## 
## Pearson's Chi-squared test with Yates' continuity correction 
## ------------------------------------------------------------
## Chi^2 =  2208.137     d.f. =  1     p =  0 
## 
##