ZZHHJ/bank_churners
收藏资源简介:
--- license: cc-by-4.0 --- # Bank Churners Analysis # Part 1 - Dataset Overview ## Dataset Description The dataset is titled “Credit Card Customers” (Bank Churners), obtained from Kaggle. It contains detailed demographic, financial, and behavioral information about 10,127 credit card users of a retail banking institution, recorded across 23 features (columns), along with an indicator of whether each customer has churned. Each record represents a single customer account, describing: ### Demographic Attributes Age, Gender, Marital Status, Education Level, Income Category, Number of Dependents ### Account & Credit Characteristics Card Category, Credit Limit, Revolving Balance, Average Open To Buy (available credit) ### Behavioral Indicators Months on Book (tenure), Total Relationship Count (products held), Months Inactive, Contacts Count (last 12 months), Total Transaction Amount & Count (yearly), Change in Spending (Q4 → Q1), Change in Transaction Frequency, Credit Utilization Ratio ## Objective of the Analysis The main goal of this analysis is to investigate customer behavior within a retail banking environment and identify the factors that drive customer retention versus attrition. We aim to uncover the demographic, financial, and behavioral patterns that distinguish customers who remain active from those at risk of churning. By examining account usage, spending intensity, product engagement, and credit behavior, the analysis seeks to surface actionable insights that can help financial institutions improve customer loyalty, design targeted retention strategies, and optimize overall customer lifecycle management. Customer churn is a major concern for banks because losing clients directly affects revenue, stability, and long term growth. Understanding who is likely to leave and why is essential for preventing financial loss and strengthening customer relationships. This dataset provides realistic behavioral and financial signals that allow us to explore the underlying causes of attrition, making the analysis both meaningful and highly relevant to real world banking operations. ## Target Variable The target variable in this analysis is Attrition_Flag, which indicates whether a customer is an “Existing Customer” or an “Attrited Customer”. This variable represents customer churn, and the goal of the analysis is to explore which demographic, financial, and behavioral factors are associated with a higher likelihood of attrition. # Part 2 - Exploratory Data Analysis ## Data Cleaning The dataset was cleaned to ensure consistency and analytical readiness. `CLIENTNUM` was converted to an object identifier, and implicit missing values (“Unknown”, “N/A”) were standardized to `NaN` while keeping the affected rows to preserve potentially meaningful behavioral patterns. Zero values were reviewed and confirmed to represent valid customer behavior. Duplicate checks verified all records were unique, and categorical fields showed no formatting inconsistencies. Numerical sanity checks found no unrealistic values. The `Attrition_Flag` column was encoded into a binary variable for easier analysis, and two model-generated columns were removed to avoid leaking predictive information. Finally, income ranges were converted into approximate numeric values to support statistical exploration. The resulting dataset is clean, consistent, and ready for analysis. ## Outlier Detection & Handling <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/4MsZNWhqnFrpJd61hSCAd.png" width="650"> <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/V1DEpDvv_7gEtzVZ7NwOY.png" width="650"> Outlier analysis was conducted on key numerical features (transaction count and transaction amount). While several high-value observations appeared, they represent genuine high-spending customers rather than data errors. Because these values naturally occur in real banking environments, where a small segment of customers often shows significantly higher activity, we chose to retain them. Although these customers were not analyzed as a dedicated subgroup later in the project, keeping them in the dataset preserves the full behavioral spectrum of the customer base and prevents introducing bias by artificially removing legitimate activity levels. ## Statistics - Attrition Flag (Target Variable) The customer base shows an average age of 46, with most customers having 2-3 dependents and holding 3-4 banking products. Activity levels indicate moderate engagement: a median of 67 yearly transactions and around $3,900 in annual spending, with men spending slightly more than women. Churners represent 16% of the population and typically leave after about 36 months, mirroring the average tenure. These statistics provide a clear baseline overview of the customer population before deeper behavioral analysis. ## Vizualizations ### Average Transaction Amount by Gender and Age Group <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/_jczENczf1bCa3UHjIpXj.png" width="700"> The chart shows that average transaction amount declines steadily with age. Spending peaks in the early 30s and gradually decreases across older age groups, with a sharper drop after age 60. Both genders follow the same trend, with men consistently spending slightly more than women across all age segments. ### Product Holding Distribution Across Customer Tenure <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/yjxFAhWIQjFqt8kyxwuIj.png" width="700"> Most customers hold exactly 3 products regardless of tenure, and while longer tenured customers tend to have slightly more products, the change is gradual rather than dramatic. This indicates stable customer behavior over time with limited upsell expansion. ## Research ### How a change in spending between Q4 and Q1 predict customer attrition? <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/JxVzwwJmKhNAotfzsn7Ok.png" width="700"> Although the spending change chart shows only a small difference in attrition rates (about 2%), the consistent direction suggests that some customer subgroups may react more strongly to financial changes than others. This leads to the next question: whether demographic factors such as the number of dependents are associated with different churn patterns. In other words, do customers with more dependents tend to stay longer or churn more often? ### How does the number of dependents affect customer attrition? <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/XS4cXk1Y4Mz51AhOpgwbx.png" width="700"> Although attrition rates vary slightly by number of dependents, with a mild peak among customers with 3-4 dependents. The pattern is not stable enough to claim a meaningful relationship between family size and churn. This suggests that dependents may influence financial pressure for some customers, but they do not consistently explain attrition behavior. Given the weak signal, it prompts a deeper question: maybe churn is less about family structure and more about customer frustration or reduced engagement. ### Do customers who contact the bank more frequently show higher churn? <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/6S_dT2LdBzZ1ORqwInaIH.png" width="700"> The bubble chart shows a clear pattern: the more often customers contact the bank, the higher their likelihood of churn. Attrition rises from almost zero among customers with no contacts to full churn among those with six contacts, suggesting persistent issues or dissatisfaction. Given this strong link, we expanded the analysis to examine whether broader engagement factors such as product ownership also help explain churn across the full customer base. ## Does the depth of the customer's relationship with the bank reduce the likelihood of attrition? <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/p0Wrua7WfmAMuji5x1IaV.png" width="700"> The chart shows a strong inverse link between product ownership and churn: customers with only 1-2 products have the highest attrition rates, while those with 5-6 products churn far less. This indicates that deeper relationships help protect against churn. This insight naturally leads to the next question: does a decline in day to day activity, rather than product count, also signal an increased risk of leaving? ## How does customer inactivity influence attrition? <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/jqqoI1GUZ0ln2tSHeavHj.png" width="700"> The analysis identifies a clear risk pattern: churn likelihood rises sharply from 1-4 months of inactivity, peaking at month 4. This means month 1 is the critical point for early intervention, before risk accelerates. After month 4, attrition decreases, suggesting that long term inactive customers are less likely to leave. Therefore, the bank should focus its retention efforts during months 1-4, where timely outreach and targeted support can significantly reduce churn. # # Conclusions <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/4m3LVtMzaBfn4HbKnGqCt.png" width="700"> The summary profile clearly highlights the behavioral divide between customers who stay and those who churn. Existing customers consistently exhibit higher spending, more frequent transactions, and broader product ownership, indicating strong engagement and stable relationships with the bank. In contrast, attrited customers show more inactive months and significantly higher contact frequency, signaling dissatisfaction or unresolved issues that accumulate over time. When combined with earlier findings such as the effects of declining spending, rising frustration driven contacts, limited product engagement, and prolonged inactivity, it becomes evident that churn is not a sudden event but the end result of a gradual breakdown in the customer-bank relationship. Overall, the patterns from our analysis show that churn is strongly connected to early signs of customer frustration, a weakening relationship with the bank, and a gradual loss of trust, long before the customer decides to leave. # Strategic Recommendations for Reducing Customer Churn ### Early Intervention After 1 Month of Inactivity Automate outreach when a customer becomes inactive for one month and offer small incentives to re-engage before churn risk peaks in months 3-4. ### Fast Track Support for High-Contact Customers Flag customers with 4+ yearly contacts and route them to priority support to resolve recurring issues quickly and prevent frustration driven churn. ### Strengthen Engagement for Customers With 1-2 Products Target this high risk segment with simple cross-sell offers (card, savings, digital tools) to increase product ownership and stabilize retention. ### Build a Proactive Churn Risk Monitoring System Create a churn risk score that tracks key signals (inactivity, spending drops, high contact frequency) and triggers early retention actions automatically. # Presentation The video is longer than the recommended length because I wanted to present the analysis clearly and avoid skipping important steps. I felt this was the best way to show the full process in a coherent and understandable way. **https://drive.google.com/file/d/1yGLYvIfas9NsG_5ufhmTFEw-JB8PWUdK/view?usp=sharing**
许可证:CC BY 4.0 # 银行客户流失分析 # 第一部分 - 数据集概览 ## 数据集说明 本数据集命名为“信用卡客户”(Bank Churners),源自Kaggle平台。其包含某零售银行机构10127名信用卡用户的详细人口统计、财务及行为信息,共涵盖23项特征(列),同时包含每位客户是否流失的标识。 每条记录代表单个客户账户,涵盖以下信息: ### 人口统计属性 年龄、性别、婚姻状况、教育程度、收入类别、受抚养人数 ### 账户与信用特征 卡类别、信用额度、循环信用余额、平均可用信用额度(Average Open To Buy) ### 行为指标 在行时长(Months on Book)、持有产品总数(Total Relationship Count)、不活跃月份数、过去12个月内的联系次数、年度总交易金额与交易次数、第四季度至第一季度的消费变化率、交易频率变化率、信用利用率 ## 分析目标 本分析的核心目标为探究零售银行场景下的客户行为,识别驱动客户留存与流失的关键因素。我们旨在挖掘区分活跃客户与流失风险客户的人口统计、财务及行为模式。通过分析账户使用情况、消费强度、产品参与度与信用行为,本分析旨在提炼可落地的洞察,助力金融机构提升客户忠诚度、设计针对性留存策略并优化全客户生命周期管理。 客户流失是银行面临的重大痛点,客户流失将直接影响营收、运营稳定性与长期增长。识别潜在流失客户并明晰其流失原因,是防范财务损失、强化客户关系的核心要务。本数据集提供了贴合实际的行为与财务信号,可用于探究客户流失的深层动因,使得本分析兼具学术意义与现实银行业务的应用价值。 ## 目标变量 本分析的目标变量为`Attrition_Flag`(流失标识),其取值为“现有客户”(Existing Customer)或“已流失客户”(Attrited Customer)。该变量直接表征客户流失状态,本分析的目标为探索哪些人口统计、财务及行为因素与更高的流失风险相关。 # 第二部分 - 探索性数据分析 ## 数据清洗 本数据集已完成清洗,以确保数据一致性与分析可用性。将`CLIENTNUM`转换为对象类型标识符,将隐式缺失值("Unknown", "N/A")标准化为`NaN`,同时保留受影响的行以保留潜在有价值的行为模式。对零值进行核查,确认其代表合法的客户行为。重复值检查确认所有记录均唯一,分类字段无格式不一致问题,数值字段合理性检查未发现不合理取值。将`Attrition_Flag`编码为二元变量以简化分析,移除两个模型生成的列以避免预测信息泄露。最后,将收入区间转换为近似数值以支持统计探索。清洗后的数据集干净、一致,可直接用于分析。 ## 异常值检测与处理 <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/4MsZNWhqnFrpJd61hSCAd.png" width="650"> <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/V1DEpDvv_7gEtzVZ7NwOY.png" width="650"> 针对交易次数与交易金额等关键数值特征开展了异常值分析。尽管存在若干高数值观测样本,但这些样本均代表真实的高消费客户,而非数据错误。由于这类高活跃度客户在真实银行业务场景中普遍存在——小部分客户往往展现出显著更高的业务活跃度,因此我们选择保留这些样本。尽管后续分析未将该类客户作为专门子群进行研究,但保留完整样本可覆盖客户群体的全部行为光谱,避免人为移除合法活动水平而引入分析偏差。 ## 目标变量(流失标识)的统计特征 客户群体的平均年龄为46岁,大多数客户拥有2-3名受抚养人,持有3-4款银行产品。客户活跃度处于中等水平:年度交易次数的中位数为67次,年度总消费约为3900美元,男性客户的平均消费略高于女性。流失客户占总群体的16%,通常在在行时长约36个月后离开,与平均在行时长相符。上述统计数据为后续深入的行为分析提供了清晰的基线概览。 ## 可视化分析 ### 按性别与年龄分组的平均交易金额 <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/_jczENczf1bCa3UHjIpXj.png" width="700"> 该图表显示平均交易金额随年龄增长持续下降。消费峰值出现在30岁出头,随后随年龄增长逐步降低,60岁以上群体的消费降幅更为显著。男女客户均遵循这一趋势,且在所有年龄区间内男性的平均消费均略高于女性。 ### 按在行时长划分的产品持有量分布 <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/yjxFAhWIQjFqt8kyxwuIj.png" width="700"> 无论在行时长如何,大多数客户均持有恰好3款产品;尽管在行时长更长的客户往往持有略多的产品,但这种变化较为平缓,无剧烈波动。这表明客户行为随时间保持稳定,交叉销售的拓展空间有限。 ## 研究分析 ### 第四季度至第一季度的消费变化能否预测客户流失? <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/JxVzwwJmKhNAotfzsn7Ok.png" width="700"> 尽管该消费变化图表显示流失率仅存在约2%的小幅差异,但趋势的一致性表明部分客户子群对财务变化的反应更为强烈。这引出了下一个问题:诸如受抚养人数等人口统计因素是否与不同的流失模式相关?换言之,受抚养人更多的客户是否会停留更久,或是流失率更高? ### 受抚养人数如何影响客户流失? <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/XS4cXk1Y4Mz51AhOpgwbx.png" width="700"> 尽管流失率随受抚养人数变化存在小幅波动,在拥有3-4名受抚养人的客户群体中流失率呈现温和峰值。但该模式并不稳定,不足以证明家庭规模与流失之间存在显著关联。这表明受抚养人可能对部分客户的财务压力存在影响,但无法一致地解释流失行为。鉴于该信号较弱,这引出了更深层的问题:或许客户流失与其家庭结构关联度较低,而更多与客户的不满或参与度下降相关。 ### 联系银行更频繁的客户是否具有更高的流失率? <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/6S_dT2LdBzZ1ORqwInaIH.png" width="700"> 该气泡图表展现出清晰的模式:客户联系银行的频率越高,其流失可能性也越高。流失率从无联系客户的几乎为0,升至拥有6次联系客户的完全流失,这表明客户存在持续的问题或不满情绪。鉴于该关联较强,我们进一步拓展分析,探究诸如产品持有量等更广泛的参与度因素是否也能解释全客户群体的流失情况。 ## 客户与银行的关系深度是否会降低流失风险? <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/p0Wrua7WfmAMuji5x1IaV.png" width="700"> 该图表展现出产品持有量与流失率之间强烈的负相关关系:仅持有1-2款产品的客户流失率最高,而持有5-6款产品的客户流失率则显著更低。这表明更深的客户关系有助于抵御流失。该洞察自然引出了下一个问题:相较于产品数量,日常活动的减少是否也预示着更高的流失风险? ## 客户不活跃时长如何影响流失率? <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/jqqoI1GUZ0ln2tSHeavHj.png" width="700"> 分析识别出清晰的风险模式:流失可能性在不活跃时长为1-4个月时急剧上升,并在第4个月达到峰值。这表明第1个月是开展早期干预的关键节点,此时采取措施可避免风险在3-4个月时加速上升。在第4个月之后,流失率有所下降,这表明长期不活跃的客户流失可能性更低。因此,银行应将留存工作的重点放在1-4个月的不活跃客户群体上,通过及时的触达与针对性支持,可显著降低流失率。 # 结论 <img src="https://cdn-uploads.huggingface.co/production/uploads/6904aebe18a1ba17d9435d1e/4m3LVtMzaBfn4HbKnGqCt.png" width="700"> 该总结画像清晰地凸显了留存客户与流失客户之间的行为差异。现有客户始终展现出更高的消费金额、更频繁的交易次数与更广泛的产品持有量,表明其与银行的参与度更高、关系更稳定。与之形成对比的是,流失客户的不活跃月份更多,且联系银行的频率显著更高,这预示着客户存在不满情绪或长期未解决的问题。结合此前的发现——诸如消费下降、因不满导致的高频联系、有限的产品参与度以及长期不活跃等因素,不难看出客户流失并非突发事件,而是客户与银行关系逐步恶化的最终结果。总体而言,我们的分析结果表明,客户流失与客户早期的不满情绪、与银行关系的弱化以及信任的逐步丧失紧密相关,这些都发生在客户最终决定离开之前。 # 降低客户流失的战略建议 ### 针对1个月不活跃客户开展早期干预 当客户出现1个月的不活跃状态时,自动触发触达动作,并提供小额激励以重新激活客户,在流失风险在3-4个月达到峰值前采取行动。 ### 为高频联系客户提供快速支持渠道 标记年度联系次数≥4次的客户,并将其分配至优先支持队列,以快速解决反复出现的问题,防范因不满导致的流失。 ### 强化持有1-2款产品客户的参与度 针对该高风险群体推出简单的交叉销售优惠(信用卡、储蓄账户、数字化工具等),以提升其产品持有量并稳定留存率。 ### 构建主动式流失风险监控系统 开发流失风险评分模型,追踪关键风险信号(不活跃时长、消费下降、高频联系等),并自动触发早期留存行动。 # 演示文稿 由于希望清晰完整地呈现分析过程且避免跳过重要步骤,本视频时长超出了推荐长度。我们认为这是连贯且易懂地展示完整分析流程的最佳方式。 **https://drive.google.com/file/d/1yGLYvIfas9NsG_5ufhmTFEw-JB8PWUdK/view?usp=sharing**



