代写MGRC20007: Machine Learning for Data-driven Business帮做R程序

MGRC20007: Machine Learning for Data-driven Business

Decision-making

Group 1

Bank Churn Modelling and Report

1. Introduction

In this report, we will analyse the churn modelling dataset for a financial institution, such as a bank. This report examines the customer churn of a financial institution and identifies the key factors that influence customer retention. Within a financial institution, this report is intended for several key users: bank executives, data analysts, marketing and retention teams, and customer relationship managers.

1.1 Business Users

1. Bank Executives/Data Analysts

• Monitor churn trends

• Inform. decisions regarding customer experience

• Inform. decisions regarding loyalty programmes

2.   Marketing & Retention Teams

• Develop offers and tailored incentives for customers predicted to churn

• Focus marketing efforts on customers predicted to churn

3.   Customer Relationship Managers

• Prioritise outreach to high-risk customers

• Focus resources on customers predicted to churn

1.2 Purpose

• Reduction in churn rate: The objective following the implementation of model- driven interventions

• Target efficiency: Aims to ensure that fewer customers are wrongly targeted as “risky”

2. Data Processing

Data processing includes data exploration, data cleaning and feature engineering.

2.1 Exploratory Data Analysis (EDA)

1) The dataset contains 10,000 records with demographic, financial, and behavioral variables, etc.

Figure 2.1.1 Data Shape and Data Information.

The target variable Exited indicates whether a customer churned (1) or stayed (0).

Figure 2.1.2. Churn Distribution. The histogram shows that approximately 20.4% of customers have exited, while 79.6% have stayed, suggesting a moderately imbalanced dataset that will require careful model evaluation later.

2) Further demographic segmentation reveals slight differences across gender and geography.

Figure 2.1.3. Churn Rate by Gender. Female customers show a slightly higher churn rate than male customers, though the difference is not substantial.

Figure 2.1.4. Churn Rate by Geography. Customers in Germany demonstrate the highest churn rate (~27%), compared to France and Spain, suggesting potential market-specific factors affecting loyalty.

2.2. Correlation Analysis and Data Cleaning

•Correlation analysis was conducted to identify relationships between numerical variables.

Figure 2.2.1 Feature Correlation Heatmap. The heatmap reveals that Age and Balance are positively correlated with churn, while IsActiveMember shows a negative correlation, indicating that older and inactive customers are more likely to churn.

•No missing values or duplicates were found. Non-predictive identifiers (RowNumber, CustomerId, Surname) were removed. All numeric variables remain within reasonable operational ranges.

Figure 2.2.2 Data Information after Drop Fields (RowNumber, CustermoerID, Surname)

2.3 Feature Engineering

Two ratio-based features were engineered to capture underlying financial and behavioral insights:

BalanceSalaryRatio = Balance / (EstimatedSalary + 1)

TenureByAge = Tenure / (Age + 1)

All continuous features were standardized using z-score normalization via StandardScaler(), ensuring that variables are comparable and suitable for downstream model training.

If you visualize the new engineered features’ distributions or correlations, you can include an extra plot here:

Figure 2.3.1(a) Visualization of Engineered Features : Distribution of BalanceSalaryRatio

Figure 2.3.1(b) Visualization of Engineered Features : TenureByAge

Figure 2.3.1(c): Visualization of Engineered Features Relationship between Engineered Features and Customer Churn

The figure illustrates how the newly engineered features relate to customer churn behavior. Customers with higher Balance Salary Ratio and lower Tenure By Age values tend to show higher churn probability, indicating that financial imbalance and limited loyalty duration may increase attrition risk.

3. Model Development and Training

We used the cleaned dataset to build predictive models for customer churn. This  section introduces the modeling process, algorithmic rationale, and training setup.

3.1 Baseline model: Logistic Regression

Logistic Regression was implemented as the baseline model due to its simplicity and interpretability. However, as a linear model, it tends to produce high bias when facing complex nonlinear relationships.

Figure 3.1.1 Logistic Regression Model Score

The model’s performance on the test set was relatively weak (Figure 3.1.1), showing that it could not accurately capture the nonlinear feature interactions influencing customer churn. Therefore, more advanced ensemble methods were explored to improve predictive accuracy.

3.2 Advanced Models: Random Forest and GBM

Random forests are introduced to capture nonlinear patterns and reduce model variance by averaging multiple decision trees. Random forests can capture nonlinear patterns but cannot correct them.

Unlike random forests, GBM builds trees in sequence. Each new tree focuses on correcting the residuals ofthe previous one. This progressive learning mechanism enables GBM to capture complex patterns more effectively while maintaining variance control.

By iteratively learning the residuals, GBM surmounts this weakness and attains a superior score of 0.8614, surpassing the 0.8556 achieved by Random Forest.

Figure 3.2.1 Random Forest Scores

Figure 3.2.2 GBM Model Scores

3.3 Model Selection

Further , the three models are compared to select the final validation model.

Figure 3.2.3 Select the Final Model and the Result

Based on the results obtained above, GBM was selected as the final validation model.

4. Model validation and evaluation

The GBM model was validated on the hold-out test set, confirming its ability to generalize beyond the training data.

4.1 Evaluation Metrics

The performance of the model was evaluated using accuracy, precision, recall rate, F1-score, ROC-AUC, and confusion matrix.

4.2 Classification Metrics Analysis

Figure 4.2.1 Classification Report

• Precision (0.7826) reflects that there is a risk of churn, and marketing resources can be concentrated on key target groups.

• Recall (0.4865) implied some potential losses remain unnoticed, and further monitoring was needed.

• F1 (0.6000) The overall balance between accuracy and coverage is moderate. It suggests that the model provides a useful but improvable foundation for customer retention planning.

• AUC (0.8654) represents the area under this curve. A larger area indicates that the model maintains a high recall rate while keeping a low false positive rate at any threshold. This means it possesses stronger discrimination capabilities, pointing out that the model is able to effectively separate the two customer categories.

Figure 4.2.2 ROC Curve of the GBM Model

These results suggest that GBM model performs well in correctly predicting churned customers. It supports the theoretical foundation of boosting algorithms bias is gradually reduced through sequential learning, allowing the model to continuously refine its predictions and maintain stable performance on unseen samples.

However, from a business perspective, missing out on potential lost customers is more costly than wrongly marking loyal customers.

4.3 Confusion Matrix Interpretation

The confusion matrix (Figure 4.3.1) confirms that the model correctly classified 1,540 non-churned and 193 churned customers. However, 214 churned customers were incorrectly predicted as retained.

Figure 4.3.1 Confusion Matrix

This result indicates that although GBM performs well in identifying loyal customers, its sensitivity to lost customers still needs improvement. Thus, adjusting the probability threshold or applying cost-sensitive learning can help alleviate this imbalance.

4.4 Feature Importance Interpretation

The feature importance chart (Figure 4.4.1) shows that age is the most influential predictor of customer churn, followed by the number of products and active members. This indicates that older and less engaged customers are more likely to leave the bank.Other variables (balance and geography) reflect behavioral and regional differences. This result provides more actionable insights for customer retention.

Figure 4.4.1 Feature Importance

5.Fairness Check

5.1 Gender Group Fairness Analysis

1) Performance by Gender Group

Figure 5.1.1 Performance by Gender

2) Key Findings:

• Higher accuracy for male customers (0.8860 vs 0.8473)

• Better recall for female customers (0.5193 vs 0.4425)

• Significantly higher false negative rate for male customers (55.75% vs 48.07%)

3) Recommendations:

• Implement gender-specific classification thresholds

• Focus on reducing false negatives for male customers

• Establish monthly monitoring to ensure FNR gap remains below 5%

This analysis indicates that while overall model performance is strong, special attention is needed to improve churn detection for male customers to ensure equitable treatment across all customer segments.

5.2 Age Group Fairness Analysis

We extended our fairness evaluation to different age segments with the following findings:

1) Performance by Age Group:

Figure 5.1.2 Performance by Gender

2) Critical Insights:

Younger customers (31-40 years) show the poorest performance with lowest recall (0.1616) and highest false negative rate (0.5354)

Middle-aged customers (51-60 years) demonstrate optimal performance with balanced metrics

Extreme age groups show inconsistent patterns - young adults have high recall but low F1-score, suggesting precision issues

3) Action Plan:

• Prioritize model refinement for the 31-40 age segment where detection is weakest

• Investigate feature relevance across different age cohorts

• Implement age-stratified monitoring with quarterly performance reviews

This analysis reveals significant age-based performance disparities, particularly affecting younger and middle-aged customers, requiring targeted improvements to ensure equitable service across all demographic segments.

6. Conclusion and Recommendations

6.1 Summary of Key Findings

This project successfully developed a customer churn prediction model based on the Gradient Boosting Machine (GBM) algorithm. The model demonstrated excellent performance on the test set (Accuracy: 0.87, ROC AUC: 0.867) and effectively identified Age, Number of Products, and Activity Status as the most critical drivers of customer churn. The fairness audit confirmed no significant bias across gender and geographic groups, aligning with responsible AI principles.

6.2 Action Plan

Component

Details

Target segments

1. Elderly-Disengaged (Age > 50, Inactive)

2. Multi-Product High-Ratio (≥2 products, High Balance/Salary)

Interventions

1. Care calls & retirement planning

2. Financial health reports & product consolidation

KPIs

Reduce target segment churn by 15% in 6 months

A/B Testing

Intervention tests were conducted on 50% of the high-risk customers in Group A and the control group B (the ordinary 50% of customers). One month later, if the attrition rate of Group A drops significantly, the predictive ability and actual effect of the model will be verified.

Monitoring

Monthly model performance check + quarterly fairness audit

6.3 Sustainability & Responsibility

1) Data Ethics: Ensure all interventions respect privacy regulations

2) Resource Efficiency: Targeted approach reduces wasteful marketing

3) Financial Inclusion: Protect vulnerable groups (elderly) through proactive care

7. Reference

Friedman, J.H. (2001) ‘Greedy function approximation: A gradient boosting machine,, Annals of Statistics, 29(5), pp. 1189—1232.

Hastie, T., Tibshirani, R. and Friedman, J. (2009) The Elements of Statistical

Learning: Data Mining, Inference, and Prediction. 2nd edn. New York: Springer.

Breiman, L. (2001) ‘Random forests,, Machine Learning, 45(1), pp. 5—32.

University of Bristol (2025) Lecture 3 — Predictive Modelling and Machine Learning Algorithms. School of Management.

Verbeke, W., Dejaeger, K., Martens, D., Hur, J. and Baesens, B. (2012) ‘New insights into churn prediction in the telecommunication sector: A profit-driven data mining approach,, European Journal of Operational Research, 218(1), pp. 211—229.


热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图