In the business world, a 5% increase in customer retention rate means a 30% increase in company profits, and the probability of selling products to existing customers is three times that of selling to new customers. Therefore, within the analytical framework of customer lifecycle management, using marketing strategies to win back high-value users during the churn phase is often a key indicator of an enterprise's and product's core competitiveness.
In banking and financial scenarios, the diversification of banking products and the greater variety of choices available to customers mean that user churn has always been one of the main topics of concern in the financial industry. Banks adhere to a customer-centric approach, focusing on marketing and conversion, enhancing the customer service experience, further increasing customer stickiness with the bank, strengthening customer operations and marketing management, reducing unnecessary customer churn, promptly identifying customers at risk of churn, and taking measures to retain customers and extend the customer lifecycle.
This case combines a bank customer churn data prediction example and focuses on the application of decision trees in real-world scenarios. This case mines information from customer transaction data that affects churn, thereby strengthening customer operations and marketing and reducing unnecessary customer churn.
There are already many mature methods in the industry for solving the customer churn problem through modeling. The two main methodologies currently used in the industry are the SEMMA methodology and the CRISP-DM methodology:
In practical application, CRISP-DM emphasizes the achievement of higher-level business objectives, while SEMMA focuses more on the implementation of specific data mining techniques. Only by closely integrating both methods can better results be achieved in data analysis and mining.
With the capability for multi-source data integration during data preparation, banking customer data can be conveniently imported into the system. Typical customer churn datasets include customers' personal information, account information, deposit information, consumption information, fund information, and wealth management information. The data dimensions include:
This case uses a classic example of credit card customer churn. The data fields are described as follows:
Field name | Field type | Field meaning | Field description |
|---|---|---|---|
CLIENTNUM | long | User ID | User ID, unique value |
Attrition_Flag | string | Attrition status | Existing Customer (retained user) Attrited Customer (churned user) |
Customer_Age | int | User age | Numerical age. Age is generally an important factor affecting attrition. |
Gender | string | Gender | M (male) F (female) |
Dependent_count | int | Household member statistics | Number of dependents |
Education_Level | string | Educational background | Account holder's educational qualifications (for example: high school, college graduate, and more) |
Marital_Status | string | Marital status | Married, single, divorced, unknown |
Income_Category | string | Income range | Account holder's annual income category (< $$$$40K, $$$$40K - 60K, $$$$60K - $$$$80K, $$$$80K-$$$$120K, >$120K) |
Card_Category | string | Credit card category | Card type (Blue, Silver, Gold, Platinum) |
Months_on_book | int | Account tenure | Account tenure with the bank |
Total_Relationship_Count | int | Number of products activated by the user | Number of products held by the customer |
Months_Inactive_12_mon | int | Number of inactive months in the past 12 months | Number of inactive months in the past 12 months |
Contacts_Count_12_mon | int | Number of months with contact in the past 12 months | Number of months with contact in the past 12 months |
Credit_Limit | int | Credit card limit | Credit card limit |
Total_Revolving_Bal | int | Total credit card limit | Total revolving balance on credit card |
Avg_Open_To_Buy | long | Open credit limit | Open credit limit in the past 12 months |
Total_Amt_Chng_Q4_Q1 | float | Change in transaction amount | Change in transaction amount (Q4 compared to Q1), ratio |
Total_Trans_Amt | long | Total transaction amount | Total transaction amount (past 12 months) |
Total_Trans_Ct | int | Total transaction count | Total transaction count (past 12 months) |
Total_Ct_Chng_Q4_Q1 | float | Change in transaction count | Change in transaction count (Q4 compared to Q1), ratio |
Avg_Utilization_Ratio | float | Average card utilization rate | Average card utilization rate |
The data in this case is ingested using Hive, which, due to its excellent capability for handling large volumes of data, supports daily tracking of user churn events. The data results are as follows. Combined with data exploration during preparation, this further clarifies the data distribution.
Exploring the data source reveals that 15% of education_level is classified as unknown, 7.4% of marital_status is unknown, and 10.98% of income_category is unknown. In practice, such data does not help determine actual churn, so the first step in exploration is to handle the distribution of the data and the presence of dirty data.
Based on the results of data exploration and understanding of the business data, a large amount of dirty data labeled as Unknown is present in the fields. Additionally, platinum credit cards are tracked by dedicated personnel and do not require churn determination. Therefore, a filter operator can be used to exclude data where education_level, income_category, or marital_status is Unknown, and where card_category is Platinum.
During the data preparation and modeling process, it is necessary to index character-type columns. Traditionally, this can be done using computed columns, for example, by proactively replacing Existing Customer with 0 and Attrited Customer with 0. Data preparation provides a string indexing operator that can convert all character columns into indexes in a single step.
The results are as follows:
Feature processing here uses PCA for dimensionality reduction, mainly because high-dimensional feature vectors often lead to the curse of dimensionality. As the dimensionality of the dataset increases, the number of samples required for the algorithm to learn increases exponentially. Therefore, using PCA can combine high-dimensional variables that may be correlated into linearly independent low-dimensional variables, called principal components. The low-dimensional dataset will retain as much information from the original data as possible, while also accelerating model convergence.
To construct the above training/prediction task, a decision tree is used for binary classification training on historical data. Decision trees offer the advantages of model interpretability and fast classification speed, making it easier to understand machine learning. The final model will be built into a tree structure, where each leaf node, based on if-then logic, goes through multiple layers of judgment to ultimately reach a uniquely determined classification. As shown in the figure below, sometimes, after just one layer of judgment, it is possible to determine whether a loan can be granted.
Data preparation integrates multiple evaluation metrics to assist AI algorithms in parameter tuning, such as the following binary classification evaluation report.
Recall and precision are common metrics for indicating accuracy:
The P-R curve visually displays the recall and precision of the learner on the overall sample. When making comparisons, if the P-R curve of one learner is completely enclosed by that of another learner, it can be concluded that the latter outperforms the former.
The Lift metric measures how much the predictive ability of the model improves compared to not using the model. Lift = PV / k, where PV is the hit rate for positive cases, that is, the proportion of true positives among the samples predicted as positive; k is the proportion of positive cases estimated using the prior probability when the model is not used. The larger the Lift, the better the model's performance.
The horizontal axis of the K-S curve is the threshold, and the vertical axes are the true positive rate (sensitivity) and the false positive rate (1 - specificity), with two line charts plotted. The point where the two curves are farthest apart is the KS value, which also corresponds to the point on the ROC curve with the maximum difference between the true positive rate and the false positive rate.
The ROC curve is plotted based on a series of different binary classification methods (cutoff values or decision thresholds), with the true positive rate (sensitivity) as the vertical axis and the false positive rate (1 - specificity) as the horizontal axis.
After obtaining an effective model, the final results can be output to a dataset (hive/clickhouse), and subsequent visual queries or dashboard creation can be performed on the DataWind platform. It can also be integrated with CDP products for tag insights, marketing applications, user segmentation, and more.