A method and device for calculating the loss of margin trading customers
By conducting multi-dimensional analysis and feature extraction of historical data of two-financial transaction customers, combined with the through-regression and gradient improvement decision tree model, the problem of difficulty in identifying and preventing customer churn risks is solved, and accurate prediction and identification of customer churn risks is achieved.
Patent Information
- Application Number
- CN202411910467.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-24
AI Technical Summary
When financial institutions warn and manage transaction-type customers of both margin trading, it is difficult for financial institutions to effectively identify and prevent customer churn risks, resulting in a high customer churn rate.
By performing multi-dimensional analysis of customers' historical data, extracting and processing feature sets, combining logistic regression and gradient improvement decision tree model for training, a churn calculation model is built to identify customers with high churn risk.
It has improved the accurate prediction and identification of customer churn risks, helping financial institutions take timely measures to reduce customer churn rates and improve customer management efficiency.
Smart Images

Figure CN119338512B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and in particular to a method and device for calculating the loss of margin trading customers. Background Art
[0002] With the development of the financial market, margin trading has gradually become one of the important businesses of securities companies and financial institutions. Margin trading allows customers to borrow funds or securities for trading, thereby amplifying their investment returns. However, some customers may face the risk of asset loss due to various reasons, such as market fluctuations and insufficient risk tolerance. For financial institutions, how to warn these customers who may be lost and take corresponding measures in a timely manner has become a key issue in reducing the risk of customer loss and improving customer management efficiency. Summary of the invention
[0003] The present application provides a method and device for calculating the churn of margin trading customers, which can analyze the customer's churn risk based on the customer's historical information.
[0004] In a first aspect of the present application, a method for calculating the loss of margin trading customers is provided, the method comprising:
[0005] According to the preset first condition, determine the customer group to be analyzed;
[0006] Obtaining historical data of each customer included in the customer group to be analyzed;
[0007] Analyze the historical data to extract candidate feature sets;
[0008] Processing the extracted candidate feature set to construct a multi-level comprehensive feature set;
[0009] Pre-training the logistic regression model based on the comprehensive feature set, and then performing secondary training on the gradient boosting decision tree model based on the feature set, and obtaining a measurement model after the training is completed;
[0010] Based on the budget result of the estimation model, target customers whose churn rate meets the preset second condition are determined.
[0011] Optionally, analyzing the historical data to extract a candidate feature set specifically includes:
[0012] Analyze the basic data of each of the customers, calculate the customer account cancellation ratio under different basic characteristics, and select the basic characteristics associated with the account cancellation rate as the first candidate characteristics, wherein the basic data includes gender, age, region, business department level, and permission activation information, and the basic characteristics include the user's gender and age group;
[0013] Analyze the transaction behaviors of the ordinary accounts and credit accounts of each of the customers within a preset time window, determine the target transaction behavior related to the customer account cancellation among the multiple transaction behaviors through the distribution difference of the transaction characteristics between the customers who cancelled their accounts and the customers who did not cancel their accounts, and use the transaction data corresponding to the target transaction behavior as the second candidate feature;
[0014] Analyze the asset change data of the customer's customer account, and select asset features associated with the customer's account cancellation as the third candidate features according to the distribution of asset features, wherein the asset change data includes stock market value, fund holdings, and bond market value;
[0015] Selecting a first feature that meets a preset condition from the first candidate feature, selecting a second feature that meets the preset condition from the second candidate feature, and selecting a third feature that meets the preset condition from the third candidate feature, wherein the preset condition is to sort multiple candidate features in groups according to their respective ratios, and select a preset number of candidate features;
[0016] A candidate feature set is formed according to the first feature, the second feature and the third feature.
[0017] Optionally, the extracted candidate feature set is processed to construct a multi-level comprehensive feature set, specifically including:
[0018] Process the first features in the candidate feature set one by one, and determine the data value of the cancelled customer on the day of cancellation and the data value of the current time of the customer who has not cancelled his account as the first feature set;
[0019] Combining the primary feature values of the first feature set in pairs to obtain a second feature set;
[0020] Performing time series processing on the second feature and the third feature in the candidate feature set, respectively calculating the volatility and the change rate of the customer's daily feature data in different preset time periods, and obtaining a third feature set according to the calculation results;
[0021] The first feature set, the second feature set and the third feature set are combined to obtain the comprehensive feature set.
[0022] Optionally, the pre-training of the logistic regression model based on the comprehensive feature set specifically includes:
[0023] According to the feature data of the comprehensive feature set, the feature data is divided into positive samples and negative samples, wherein the positive samples are feature data of customers who have cancelled their accounts in the comprehensive feature set, and the negative samples are feature data of customers who have not cancelled their accounts in the comprehensive feature set;
[0024] The positive samples are sorted according to the training time points to obtain processed positive samples, and the negative samples are disrupted in their original order to obtain processed negative samples;
[0025] Dividing the processed positive samples into a training set, a validation set, and a test set according to a preset ratio, and dividing the processed negative samples into a training set, a validation set, and a test set according to a preset ratio;
[0026] Setting initial parameters of the logistic regression model, inputting the training set and the validation set into the logistic regression model, and obtaining a trained logistic regression model;
[0027] The maximum number of learning rounds, learning rate, L1 regularization coefficient and L2 coefficient are set according to preset rules respectively, the maximum number of learning rounds, learning rate, L1 regularization coefficient and L2 coefficient are respectively combined and brought into the trained logistic regression model for training, and the test set is input into the trained logistic regression model to obtain a trained logistic regression model.
[0028] Optionally, the gradient boosting decision tree model is trained again based on the feature set, and a measurement model is obtained after the training is completed, specifically including:
[0029] Randomly sampling the processed negative samples, and dividing them into a training set, a validation set, and a test set according to the preset ratio after sampling;
[0030] Inputting the training set, the validation set, and the test set into the completed logistic regression model to obtain prediction results;
[0031] Combining the prediction result with the feature data of the comprehensive feature set to obtain a training data set;
[0032] Setting the parameter range of the gradient boosting decision tree model, including the maximum number of training rounds, learning rate, L1 regularization coefficient, L2 coefficient, and maximum depth of a single tree;
[0033] After setting, the training data set is input into the gradient boosting decision tree model to obtain the trained gradient boosting decision tree model as the estimation model.
[0034] Optionally, the determining, based on the budget result of the calculation model, target customers whose churn rate meets a preset second condition specifically includes:
[0035] Extract basic features, behavioral features, and time series features of any customer;
[0036] assigning feature weights to the basic features, the behavioral features, and the temporal features;
[0037] Obtaining the churn rate of any one of the customers according to the result of calculation based on the model based on the basic features, the behavioral features, the time series features, and the feature weights;
[0038] If it is determined that the churn rate is greater than or equal to a preset threshold, then any one of the customers is determined to be the target customer.
[0039] Optionally, the churn rate of any one of the customers is obtained based on the result of calculation of the model based on the basic features, the behavioral features, the time series features, and the feature weights, and is specifically calculated by the following formula:
[0040]
[0041] Where P is the churn rate, σ is the activation function, M is the total number of decision trees, and α m For each decision tree T m The learning rate, T m (x) is the output of the mth tree, λ1 is the coefficient of L1 regularization, x i is the i-th feature among the basic features, behavioral features and time series features of any customer, ω i is the feature weight, λ2 is the coefficient of L2 regularization, ω ij is feature x i and x j The interaction weight of .
[0042] In a second aspect of the present application, a device for calculating the loss of margin trading customers is provided, the device comprising a judgment module, an acquisition module, an analysis module, a construction module and a processing module, wherein:
[0043] The judgment module is used to determine the customer group to be analyzed according to the preset first condition;
[0044] The acquisition module is used to acquire the historical data of each customer included in the customer group to be analyzed;
[0045] The analysis module is used to analyze the historical data and extract a candidate feature set;
[0046] The construction module is used to process the extracted candidate feature set to construct a multi-level comprehensive feature set;
[0047] The processing module is used to pre-train the logistic regression model based on the comprehensive feature set, and then perform secondary training on the gradient boosting decision tree model based on the feature set, and obtain the measurement model after the training is completed;
[0048] The judgment module is used to determine the target customers whose churn rate meets the preset second condition based on the budget result of the calculation model.
[0049] Optionally, the analysis module is used to analyze the basic data of each of the customers, calculate the customer account cancellation ratio under different basic characteristics, and select the basic characteristics associated with the account cancellation rate as the first candidate characteristics, wherein the basic data includes gender, age, region, business department level, and permission activation information, and the basic characteristics include the user's gender and age group;
[0050] The analysis module is used to analyze the transaction behaviors of the ordinary accounts and credit accounts of each of the customers within a preset time window, determine the target transaction behavior related to the customer account cancellation among the multiple transaction behaviors through the distribution difference in transaction characteristics between the customers who cancelled their accounts and the customers who did not cancel their accounts, and use the transaction data corresponding to the target transaction behavior as the second candidate feature;
[0051] The analysis module is used to analyze the asset change data of the customer's customer account, and select the asset features associated with the customer's account cancellation as the third candidate features according to the distribution of asset features, wherein the asset change data includes stock market value, fund holdings, and bond market value;
[0052] The judgment module is used to select a first feature that meets a preset condition from the first candidate feature, select a second feature that meets the preset condition from the second candidate feature, and select a third feature that meets the preset condition from the third candidate feature, wherein the preset condition is to sort multiple candidate features in groups according to their respective ratios and select a preset number of candidate features;
[0053] The processing module is used to form a candidate feature set according to the first feature, the second feature and the third feature.
[0054] Optionally, the processing module is used to process the first features in the candidate feature set one by one, and determine the data value of the account-cancelling customer on the day of account cancellation and the data value of the current time of the account-uncancelling customer as the first feature set;
[0055] The processing module is used to combine the primary feature values of the first feature set in pairs to obtain a second feature set;
[0056] The processing module is used to perform time series processing on the second feature and the third feature in the candidate feature set, respectively calculate the volatility and the change rate of the customer's daily feature data in different preset time periods, and obtain the third feature set according to the calculation results;
[0057] The processing module is used to merge the first feature set, the second feature set and the third feature set to obtain the comprehensive feature set.
[0058] Optionally, the processing module is used to divide the feature data into positive samples and negative samples according to the feature data of the comprehensive feature set, wherein the positive samples are the feature data of the customers who have cancelled their accounts in the comprehensive feature set, and the negative samples are the feature data of the customers who have not cancelled their accounts in the comprehensive feature set;
[0059] The processing module is used to sort the positive samples according to the training time points to obtain processed positive samples, and disrupt the original order of the negative samples to obtain processed negative samples;
[0060] The processing module is used to divide the processed positive samples into a training set, a validation set, and a test set according to a preset ratio, and divide the processed negative samples into a training set, a validation set, and a test set according to a preset ratio;
[0061] The processing module is used to set the initial parameters of the logistic regression model, input the training set and the validation set into the logistic regression model, and obtain a trained logistic regression model;
[0062] The processing module is used to set the maximum number of learning rounds, the learning rate, the L1 regularization coefficient and the L2 coefficient according to preset rules, respectively, combine the maximum number of learning rounds, the learning rate, the L1 regularization coefficient and the L2 coefficient and bring them into the trained logistic regression model for training, input the test set into the trained logistic regression model, and obtain a trained logistic regression model.
[0063] Optionally, the acquisition module is used to randomly sample the negative samples, and divide them into a training set, a validation set, and a test set according to the preset ratio after sampling;
[0064] The processing module is used to input the training set, the validation set and the test set into the completed logistic regression model to obtain a prediction result;
[0065] The processing module is used to merge the prediction result with the feature data of the comprehensive feature set to obtain a training data set;
[0066] The processing module is used to set the parameter range of the gradient boosting decision tree model, including the maximum number of training rounds, learning rate, L1 regularization coefficient, L2 coefficient and the maximum depth of a single tree;
[0067] The processing module is used to input the training data set into the gradient boosting decision tree model after setting, and obtain the trained gradient boosting decision tree model as the measurement model.
[0068] Optionally, the acquisition module is used to extract basic features, behavioral features and time series features of any customer;
[0069] The construction module is used to assign feature weights to the basic features, the behavior features, and the time series features;
[0070] The construction module is used to obtain the churn rate of any one of the customers according to the result calculated by the model based on the basic features, the behavioral features, the time series features, and the feature weights;
[0071] The judgment module is used to determine that any one of the customers is the target customer if it is determined that the churn rate is greater than or equal to a preset threshold.
[0072] Optionally, the processing module is used to obtain the churn rate of any one of the customers according to the result calculated by the model based on the basic features, the behavioral features, the time series features, and the feature weights, specifically by the following formula:
[0073]
[0074] Where P is the churn rate, σ is the activation function, M is the total number of decision trees, and α m For each decision tree T m The learning rate, T m (x) is the output of the mth tree, λ1 is the coefficient of L1 regularization, x i is the i-th feature among the basic features, behavioral features and time series features of any customer, ω i is the feature weight, λ2 is the coefficient of L2 regularization, ω ij is feature x i and x j The interaction weight of .
[0075] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any one of the methods described above.
[0076] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, any of the methods described above is executed.
[0077] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0078] 1. This application analyzes the customer's churn risk through the customer's historical data, combined with feature extraction and machine learning model training. Customers' historical behavior, asset changes, trading activity and other data can reflect their behavior patterns and risk tolerance in the market. By performing multi-level analysis and processing on these features, and using logistic regression and gradient boosting decision tree models, potential churn signals can be identified. Based on the rules learned from historical data, the model can predict future customer churn trends, thereby accurately identifying customers with high churn risks. This application utilizes the relationship between customer historical behavior and market dynamics to achieve data-driven churn analysis.
[0079] 2. This application constructs a comprehensive, multi-level integrated feature set through multi-dimensional analysis and feature extraction of customers' historical data, which can effectively capture the relationship between customer behavior and churn rate. By analyzing features such as basic data, transaction behavior, and asset changes, the model can screen out key features that are closely related to customer account closures, and improve sensitivity to changes in customer behavior through time series analysis and feature combination. Ultimately, model training based on these comprehensive features can significantly improve the accuracy and precision of customer churn risk prediction, enabling financial institutions to more effectively identify high-churn risk customers and take targeted retention measures.
[0080] 3. By first using the logistic regression model for pre-training and then combining it with the gradient boosting decision tree for secondary training, the accuracy of customer churn prediction is effectively improved. By classifying and sorting samples of cancelled and non-cancelled customers, the logistic regression model can preliminarily identify churn risks and optimize feature data. Subsequently, the gradient boosting decision tree model further mines complex nonlinear relationships to improve the model's ability to capture customer behavior patterns. This application combines the high efficiency of logistic regression with the powerful predictive ability of the gradient boosting decision tree, ensuring that the model can accurately identify customers with high churn risk and ultimately generate an optimized prediction model.
[0081] 4. Combine the basic characteristics, behavioral characteristics and time series characteristics of customers, and use the factors such as feature weights, regularization terms and feature interactions to generate customer churn rate predictions. By outputting the results through the decision tree model and combining L1 and L2 regularization, it can effectively capture the nonlinear relationship of customer behavior and suppress overfitting. Ultimately, it accurately identifies target customers whose churn rate is higher than the preset threshold, helping companies to accurately predict customer churn risks and formulate effective retention strategies. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 It is a flow chart of a method for calculating the loss of margin trading customers disclosed in an embodiment of the present application;
[0083] Figure 2It is a module schematic diagram of a device for calculating the loss of margin trading customers disclosed in an embodiment of the present application;
[0084] Figure 3 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0085] Explanation of the accompanying drawings: 201, judgment module; 202, acquisition module; 203, analysis module; 204, construction module; 205, processing module; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION
[0086] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0087] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0088] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0089] With the development of the financial market, margin trading has gradually become one of the important businesses of securities companies and financial institutions. Margin trading allows customers to borrow funds or securities for trading, thereby amplifying their investment returns. However, some customers may face the risk of asset loss due to various reasons, such as market fluctuations and insufficient risk tolerance. For financial institutions, how to warn these customers who may be lost and take corresponding measures in a timely manner has become a key issue in reducing the risk of customer loss and improving customer management efficiency.
[0090] Most of the current technical means rely on basic statistical models and customer behavior analysis, ignoring expert experience, lacking effective prediction mechanisms and corresponding feedback systems, lacking an explainable recommendation mechanism, and it is difficult to accurately predict the risk of customer loss. In particular, the particularity of trading customers in the field of margin trading makes it difficult for existing technologies to adapt. The specific defects are as follows: 1. Lack of integration of expert experience: Traditional systems rely more on algorithms and historical data analysis, and fail to fully combine the practical experience of senior marketing personnel and experts, resulting in the lack of rationality and accuracy of customer behavior prediction in actual business scenarios. Expert experience can provide an important supplement to complex market dynamics and individual differences of customers. 2. Lack of feedback mechanism: Traditional customer management systems are mostly one-way operations. After the implementation of customer risk warnings or retention measures, there is a lack of real-time collection and systematic adjustment of feedback data. This means that once the customer's status changes, the system cannot respond quickly and optimize subsequent strategies, thus missing the best opportunity for retention. 3. Lack of explainable recommendation mechanism: In existing customer retention systems, a common problem is that it is difficult to explain the basis behind the recommended retention measures, which makes it difficult for marketers to trust the judgment given by the system. In actual business, marketers prefer to understand the reasons behind each recommendation so that they can flexibly adjust the communication strategy according to the specific situation of the customer. Therefore, when the system recommends customers, it will significantly improve the explainability and credibility of the recommendation strategy by giving clear recommendation basis (such as customer behavior, risk assessment, etc.).
[0091] In order to solve these problems, it is urgent to develop an intelligent customer churn warning system, which should combine expert experience and data models to conduct a comprehensive analysis of customer churn risks. Through the feedback mechanism, the system can respond to the latest customer behavior and market changes in real time and dynamically optimize retention strategies. At the same time, the system should also have a highly explainable recommendation function, clearly showing marketers the reasons and basis behind each recommendation, so as to facilitate the adoption of more targeted retention measures, thereby improving customer maintenance effects and reducing churn rates.
[0092] This embodiment discloses a method for calculating the loss of margin trading customers. Figure 1 , including the following steps S110-S160:
[0093] A churn estimation method for margin trading customers disclosed in an embodiment of the present application is applied to a churn estimation system, aiming to provide a more intelligent and accurate customer churn warning and retention solution by combining algorithm models, expert experience, real-time feedback mechanism and explainable recommendation reasons.
[0094] The system first conducts a comprehensive assessment of the customer's potential churn risk through credit scenario analysis and customer group circles, combined with algorithms and expert experience. On this basis, the system predicts the customer's marketing intentions and determines whether the customer has a tendency to churn through dual judgments by internal and marketing experts. When a customer is identified as having a churn risk, the system will intelligently push retention measures for the customer, such as initiating marketing communications through multiple channels such as corporate WeChat. At the same time, the system will combine measures such as lowering interest rates and giving away investment advisors to implement one-to-one exclusive customer service to increase the success rate of retention.
[0095] S110, determining the customer group to be analyzed according to the preset first condition.
[0096] The system is limited and the risk of customer loss needs to be measured. The first step is to find all customer account cancellation records and calculate the account cancellation ratio of the entire customer group. At the same time, analyze the customer's credit account attributes (such as collateral assets, financing quotas, securities lending quotas, and margin liabilities) and calculate the reduction amount and ratio of these attributes compared to the highest and average values in the year when the customer cancels the account.
[0097] Then, an account closure ratio analysis is conducted for different types of customers, including the account closure ratio and number of dormant customers (no credit transactions and no credit assets) and normal customers; the account closure ratio and number within each asset range are calculated according to the size of the credit account assets, for example, the account closure ratio and number of customers with credit account assets of 0, 10,000 to 100,000, 100,000 to 500,000, and above 500,000 are calculated respectively; the account closure ratio is calculated according to different ranges of margin trading (margin trading and securities lending) interest rates, for example, the account closure ratio and number of customers with interest rates above the benchmark value ~ benchmark value, benchmark value ~ benchmark value reduced by 20bp, benchmark value reduced by 20bp ~ benchmark value reduced by 40bp, and benchmark value reduced by 40bp or below; the account closure ratio is calculated according to whether the customer has conducted credit transactions in different time periods recently, for example, the account closure ratio and number of customers who have had credit transactions in the past year (the past two years, the past six months) and those who have not had credit transactions in the past year (the past two years, the past six months) are calculated respectively.
[0098] By combining the customer division methods of the above different dimensions in pairs or groups of three, the number of customers and the account cancellation ratio of each combination are calculated. The account cancellation ratio of different combinations is optimized and calculated using the following formula:
[0099]
[0100] Among them, d is the customer group calculation score, Q is the account cancellation ratio, N is the number of customers, and X is the average customer group asset. Finally, the customer group combination with the largest customer group calculation score is selected as the target customer group for key monitoring and analysis, thus obtaining the customer group to be analyzed.
[0101] S120, obtaining historical data of each customer included in the customer group to be analyzed.
[0102] According to the key customer groups obtained in S110, the historical data corresponding to individual customers in the customer groups are obtained, including customer basic data, customer transaction data, customer behavior data and customer asset data. The customer basic data includes gender, age, transaction time, province, business department level, customer authority activation status (GEM, STAR Market, private equity, options, asset management, Shanghai-Hong Kong Stock Connect, Shenzhen-Hong Kong Stock Connect, etc.). The customer transaction data includes transaction data in the recent period, such as the number of A-share transactions of ordinary accounts / credit accounts / all accounts in the past 30 / 60 / 90 / 180 days, the number of A-share trading days of ordinary accounts / credit accounts / all accounts in the past 30 / 60 / 90 / 180 days, the A-share transaction amount of ordinary accounts / credit accounts / all accounts in the past 30 / 60 / 90 / 180 days, the number of A-share margin trading transactions of ordinary accounts / credit accounts / all accounts in the past 3 Number of A-share margin trading days of ordinary accounts / credit accounts / all accounts in the past 0 / 60 / 90 / 180 days, amount of A-share margin trading of ordinary accounts / credit accounts / all accounts in the past 30 / 60 / 90 / 180 days, number of transfers in and out of ordinary accounts / credit accounts in the past 30 / 60 / 90 / 180 days, amount of transfers in and out of ordinary accounts / credit accounts in the past 30 / 60 / 90 / 180 days, number of transfers in and out of ordinary accounts / credit accounts in the past 30 / 60 / 90 / 180 days, etc. Customer behavior data includes behavior data on the use of transaction apps in a recent period, such as the number of mobile app login days in the past 30 / 90 / 180 / 360 days, the total mobile app login time in the past 30 / 90 / 180 / 360 days, the number of clicks on the credit business module functions in the past 30 / 90 / 180 / 360 days, the number of days for credit business module function clicks in the past 30 / 90 / 180 / 360 days, the number of clicks on the general function module in the past 30 / 90 / 180 / 360 days, and the number of days for general function module clicks in the past 30 / 90 / 180 / 360 days. The customer asset data includes customer asset data in a recent period, such as the average assets of ordinary / credit accounts in the past 30 / 90 / 180 / 360 days, the average market value of stocks / A shares in ordinary / credit accounts in the past 30 / 90 / 180 / 360 days, the average fund holdings in ordinary / credit accounts in the past 30 / 90 / 180 / 360 days, the average market value of bonds in ordinary / credit accounts in the past 30 / 90 / 180 / 360 days, the average of collateral assets / collateral securities assets / collateral cash assets in credit accounts in the past 30 / 90 / 180 / 360 days, and all liabilities / margin liabilities / short selling liabilities in credit accounts in the past 30 / 90 / 180 / 360 days.
[0103] S130, analyzing historical data to extract candidate feature sets.
[0104] Analyze historical data and extract candidate feature sets, including: analyze basic data of each customer, including gender, age, region, sales department level, and permission activation information; basic features include gender and age group of users. Calculate the account cancellation ratio of customers with different basic features, and count the account cancellation performance of various types of customers with different features. For example, analyze the differences in account cancellation rates for male, female, and institutional customers, or analyze the account cancellation tendencies of customers of different age groups. By comparing the correlation between these basic features and the account cancellation rate, filter out features that are closely related to account cancellation, such as customers of a certain age group are more likely to cancel their accounts, and the gender with the highest account cancellation ratio can be made the first candidate feature.
[0105] Analyze the transaction behavior of each customer's ordinary account and credit account within a preset time window, and analyze the transaction behavior data of the customer's ordinary account and credit account. The data covers the number of transactions, transaction amount, transaction days, etc. within a certain time window. The analysis window can be 30 days, 60 days, 90 days, etc. Through the distribution difference in transaction characteristics between customers who have closed their accounts and customers who have not closed their accounts, determine the target transaction behavior related to customer account closure among multiple transaction behaviors, and calculate the distribution difference in these transaction characteristics between customers who have closed their accounts and customers who have not closed their accounts. For example, analyze the difference in the account closure ratio between customers who frequently traded and customers who almost never traded in the past 90 days, or observe the relationship between certain specific transaction behaviors (such as margin trading of credit accounts) and account closure. For example, if the ratio of account closure data to account closure data is at or above the preset ratio, then this transaction data is used as the second candidate feature.
[0106] Analyze the asset change data of the customer's customer account. The asset change data of the customer account mainly includes stock market value, fund holdings and bond market value, etc. The data usually covers different time windows such as 30 days, 90 days, and 180 days. Calculate the changes in customers' assets in different time periods, and observe the differences in asset changes between customers who have closed their accounts and those who have not. For example, some customers may have a sharp drop in the market value of their stocks or a significant adjustment in their fund holdings in the period before closing their accounts. Based on the distribution of asset characteristics, select the asset change characteristics that are significantly related to customer account closing and use them as the third candidate characteristics.
[0107] The first feature that meets the preset condition is selected from the first candidate feature, the second feature that meets the preset condition is selected from the second candidate feature, and the third feature that meets the preset condition is selected from the third candidate feature, wherein the preset condition is to sort the multiple candidate features in groups according to their respective ratios, and select the candidate features of the preset number; and form a candidate feature set according to the first feature, the second feature and the third feature. Specifically, the first, second and third candidate features are selected according to the preset conditions. The features in each feature set are sorted according to importance, and the top N most representative features are selected as the final features. For example, the features such as gender, transaction behavior, and asset fluctuation that have the greatest impact on the account cancellation rate are selected. The various features (first feature, second feature and third feature) selected above are integrated to form the final candidate feature set. The feature set contains features of various aspects such as customer basic data, transaction behavior data, and asset data, and is an important input for subsequent model training. For example, the candidate features obtained in each group are sorted in groups according to their respective ratios, and a maximum of 20 are selected for each group. The selected candidate features are integrated as the final candidate feature set.
[0108] S140, processing the extracted candidate feature set to construct a multi-level comprehensive feature set.
[0109] First, for the first feature in the candidate feature set (such as basic data, transaction behavior data, etc.), the data value at a specific time point is determined for the account-cancelling customers and the accounts that have not been cancelled. For the account-cancelling customers, the data on the day of the account cancellation is extracted as the feature value, and for the accounts that have not been cancelled, the data at the current time is used as the feature value. Through the process of forming the first feature set, a first feature set based on a time point is generated for each customer, that is, the basic features and transaction behavior data of each customer at a specific time point.
[0110] The features extracted from the first feature set are combined in pairs. The combination method can be through feature multiplication, addition or other mathematical operations to construct a new combined feature. For example, the customer's "gender" feature is multiplied by the "account transaction frequency" feature to generate a new feature to capture the potential correlation between gender and transaction behavior. All these combined features constitute the second feature set, and the complex relationship between customer behavior and attributes is mined through combined features to further enrich the feature set.
[0111] For the second and third features in the candidate feature set (such as transaction behavior and asset data), perform time series analysis on the customer's daily feature data to calculate the volatility and change rate of these features in different time periods. Refers to the range of numerical fluctuations of a specific feature over a period of time. By analyzing the fluctuations of the feature values of customers in different time periods (such as 30 days, 60 days, and 90 days), the changing trends of customer behavior and asset changes are captured. It represents the speed or proportion of the change of the feature value over time, reflecting the direction and magnitude of the change of customer characteristics in a specific time period. For example, calculating the rate of change of the market value of customers' assets in the past 30 days can identify which customers' assets are rising or falling rapidly. Based on the calculation results of volatility and change rate, a time series feature set is formed as part of the second and third feature sets.
[0112] The first feature set generated previously, the second feature set generated by pairwise combination, and the time series feature set (i.e., the second and third feature sets) obtained by time series processing are integrated. During the merging process, different types and dimensions of features can be considered to ensure that the final feature set has multi-level and comprehensive feature information. The final result obtained after integration is a comprehensive feature set that contains multiple dimensions, time series information, and feature combinations. This comprehensive feature set provides complete and rich input data for model training, improving the model's ability to capture the complexity of customer behavior.
[0113] S150, pre-training the logistic regression model based on the comprehensive feature set, and then performing secondary training on the gradient boosting decision tree model based on the feature set, and obtaining the measurement model after the training is completed.
[0114] First, it refers to the feature data of customers who have cancelled their accounts in the comprehensive feature set. Positive samples reflect the behavior, assets and other characteristics of customers who have cancelled their accounts, and are used to train the model to identify customers with high churn risk. It refers to the feature data of customers who have not cancelled their accounts in the comprehensive feature set. These customers have not yet cancelled their accounts and are used as control samples in the model. Sort the positive samples according to the time points when the customers cancelled their accounts to ensure that the model can learn the feature distribution of customers who cancelled their accounts at different time points. Prevent time dependence between negative samples, disrupt the data order of customers who have not cancelled their accounts, and ensure that the model does not rely on the original order of samples during training.
[0115] According to the preset ratio (e.g. 8:1:1), positive samples and negative samples are divided into training set, validation set and test set respectively. This ratio is often used in machine learning models to ensure that most samples are used for training and a small part is used for validation and testing. Training set: used for initial training of the model to help the model learn the customer's account cancellation pattern. Validation set: used to evaluate the effect of the model during training, adjust model parameters and avoid overfitting. Test set: used to finally evaluate the prediction performance of the model and ensure the generalization ability of the model.
[0116] Then, the initial parameters of the logistic regression model are set, wherein the maximum number of training rounds is preferably set to 20, the learning rate is preferably set to 0.1, the L1 regularization coefficient is preferably set to 0.01, the L2 regularization coefficient is preferably set to 0.01, and the training is terminated early. The processed training set and validation set are input into the logistic regression model, and training is started according to the initial parameters. When learning the relationship between customer characteristics and account cancellation, the logistic regression model uses a loss function (such as cross entropy) to evaluate the prediction effect of the model. After each round of training, the validation set is used to evaluate the performance of the model, and indicators such as loss value or accuracy are calculated to detect whether the training effect of the model is constantly improving. The validation set can help the model adjust during training to avoid overfitting.
[0117] Set the maximum number of learning rounds to 20, 25, and 30, set the learning rate to 0.01, 0.02, 0.05, and 0.2, set the L1 regularization coefficient to 0.02, 0.05, 0.1, and 0.2, and set the L2 regularization coefficient to 0.02, 0.05, 0.1, and 0.2. Combine the above parameters and input them into the model for training. Then input the test set into the trained logistic regression model to obtain coverage data. Each parameter combination represents a different training configuration. Through these combined training models, find the parameter combination that performs best on the validation set. Select the logistic regression model corresponding to the parameter with the highest coverage of the top 0.5% positive samples on the test set as the final logistic regression model for pre-training.
[0118] Select the model with the best parameter combination for final training, input the test set into the trained logistic regression model, and evaluate the performance of the model on the test set. Through this process, the generalization ability and prediction accuracy of the model are confirmed. You can use a variety of evaluation indicators such as accuracy, recall, F1 score, AUC curve, etc. to judge the performance of the model, especially the coverage performance on positive samples (customers who have cancelled their accounts). The goal is to be able to identify customers with high risk of churn through the model.
[0119] Furthermore, after the logistic regression model is trained, random sampling is performed on customers who have not cancelled their accounts (i.e., processing negative samples) in order to balance the ratio of positive and negative samples so that the model will not be biased due to too many negative samples. The sampling strategy is usually set so that the number of negative samples is several times (e.g., 5 times) the number of positive samples. The randomly sampled negative samples are divided into training sets, validation sets, and test sets according to a preset ratio (e.g., 8:1:1). Similarly, the positive samples are divided according to the same ratio. These data sets will be used for subsequent model training and evaluation.
[0120] Input the training set, validation set, and test set divided in the previous step into the previously trained logistic regression model to obtain the prediction results of each sample (i.e., the probability of account closure). The logistic regression model will output the prediction results for each customer, which represent the probability of each customer churn, usually expressed in the form of a score or probability value. Merge the prediction results of the logistic regression model with the previously generated comprehensive feature set. This means that on the basis of the original customer features, a column of prediction scores of the logistic regression model is added as a new feature. In this way, the new training data set contains not only the historical features of the customer, but also the churn risk information predicted by the logistic regression model. Through this feature merging, a richer training data set is obtained, which contains basic features, transaction behavior features, asset features, etc., and also adds the output results of the logistic regression model, providing a higher-dimensional input for the subsequent training of the gradient boosting decision tree (GBDT).
[0121] Before training the GBDT model, you need to set the parameter range of the model so that the model can be tuned within these ranges. The main parameters include setting the upper limit of the number of training rounds. The maximum number of training rounds is usually 20~50 times, indicating how many rounds of iterations the model will stop training. Control the weight update step of the model. The learning rate is usually set between 0.01~0.3. A lower learning rate allows the model to converge gradually and improve the accuracy of the prediction. It is used to prevent the model from overfitting. By introducing sparsity constraints to reduce unnecessary features, the L1 regularization coefficient is set between 0.001~0.2. Prevent the model parameters from being too large and ensure the stability and generalization ability of the model. The L2 regularization coefficient is set between 0.001~0.2. Limit the depth of each decision tree. The maximum depth of a single tree is usually set to 8~15 to prevent overfitting and ensure the balance between the decision-making ability of each tree and the complexity of the model.
[0122] Input the merged training data set into the gradient boosting decision tree (GBDT) model with the set parameter range to start model training. GBDT gradually improves the performance of the model by constructing multiple weak learners (decision trees). Each decision tree will learn based on the residual of the previous model to gradually reduce the error. After the GBDT model training is completed, the test set is input into the trained model for the final model performance evaluation. The evaluation criteria can include accuracy, recall, F1 score, AUC, etc., with particular attention paid to the model's recognition ability on positive samples (i.e., customers who have cancelled their accounts). After the test, the final trained GBDT model is obtained. This model combines the prediction results of the logistic regression model with customer characteristics, and can more accurately predict the risk of customer churn.
[0123] S160, based on the budget result of the estimation model, determine the target customers whose churn rate meets the preset second condition.
[0124] After the model training is completed, the customer churn rate is calculated based on the measurement model and eligible target customers are determined. First, the characteristic data of the customer to be predicted is obtained, and the following three key features are extracted from the customer's historical data and behavior records: Basic features: such as the customer's personal information (gender, age, region, customer level, account opening time, etc.). Behavioral features: customer's transaction behavior, account usage (such as transaction frequency, number of fund transfers in and out, number of logins, access frequency, etc.). Time series features: feature data based on a certain time window (such as changes in transaction volume, asset changes, fluctuations in transaction activity, etc. in the past 30 days, 90 days, and 180 days). Time series features are used to capture the dynamic changes of customer behavior over time.
[0125] Each feature has a different impact on customer churn rate, so it is necessary to assign a corresponding weight to each feature based on the results of model training. The feature weight reflects the importance of the feature to the prediction of churn rate. During the model training process (such as using models such as logistic regression and GBDT), the model automatically learns the contribution of each feature to customer churn rate and assigns a weight to each feature. For example, in the GBDT model, the weight of each feature can be determined by the feature importance score. Behavioral features may have a greater influence than basic features, so the weight of behavioral features will be higher in the final weight assignment. For each feature, the size of the assigned weight depends on the importance of the feature. The total feature weight can be regularized to ensure that the sum of the weights is 1, which is easy to calculate.
[0126] The extracted features and their corresponding weights are used as input into the trained customer churn estimation model. For the logistic regression model, the calculation principle of customer churn rate is usually:
[0127]
[0128] Among them, P is the churn rate, σ is the activation function, ω i is feature x i The weight of , b is the bias term.
[0129] Among them, the activation function maps the output of the model to the churn probability interval [0,1], that is:
[0130]
[0131] Here z represents the weighted output of the estimation model.
[0132] For the gradient boosting decision tree model, the calculation principle of customer churn rate is usually:
[0133]
[0134] Among them, P is the churn rate, M is the number of decision trees, and αm is the weight of the mth tree, T m (x) is the decision tree output based on customer feature x.
[0135] Based on the above principles, the formula for calculating the churn rate of the measurement model is as follows:
[0136]
[0137] Among them, P is the churn rate, σ is the activation function, M is the total number of decision trees, and α m For each decision tree T m The learning rate, T m (x) is the output of the mth tree, which makes decisions based on the input features (i.e., the customer's feature set). Each tree gradually calculates a prediction value for the customer by splitting the feature nodes. λ1 is the coefficient of L1 regularization, which is used to adjust the strength of regularization. i is the i-th feature among the basic features, behavioral features, and time series features of any customer, ω i is the feature weight, λ2 is the coefficient of L2 regularization, which is used to adjust the strength of regularization, ω ij is feature x i and x j The interaction weight of .
[0138] The first part is the core of the gradient boosting decision tree model, which combines the outputs of multiple weak decision trees to obtain a basic prediction of customer churn rate. The second and third parts are L1 and L2 regularization terms, which are used to prevent model overfitting and control the size and sparsity of feature weights. The fourth part is the interaction term between features, which reflects the joint impact of two features on the churn probability and can capture complex nonlinear relationships.
[0139] Set a churn rate threshold T, such as 70% (i.e. 0.7), to screen out customers with high churn risk. If a customer's churn rate P (customer churn) ≥ T, then the customer is determined to be a target customer, that is, there is a high churn risk. Traverse the churn rate calculation results of all customers and screen out target customers whose churn rate is greater than or equal to the threshold.
[0140] Based on the customer's churn intention and risk level, the system adjusts the existing marketing strategy and generates a personalized retention strategy. The system allows sales staff or margin trading specialists to fill out a feedback report after communicating with the customer, indicating the customer's current status and whether there is a risk of further churn. Through the feedback mechanism, the system can dynamically adjust the customer's risk level and re-evaluate the customer based on the latest data.
[0141] This embodiment also discloses a device for calculating the loss of margin trading customers. Figure 2The device includes a determination module 201, an acquisition module 202, an analysis module 203, a construction module 204 and a processing module 205, wherein:
[0142] The judgment module 201 is used to determine the customer group to be analyzed according to a preset first condition.
[0143] The acquisition module 202 is used to acquire the historical data of each customer included in the customer group to be analyzed.
[0144] The analysis module 203 is used to analyze the historical data and extract candidate feature sets.
[0145] The construction module 204 is used to process the extracted candidate feature set to construct a multi-level comprehensive feature set.
[0146] The processing module 205 is used to pre-train the logistic regression model based on the comprehensive feature set, and then perform secondary training on the gradient boosting decision tree model based on the feature set, and obtain the measurement model after the training is completed.
[0147] The judgment module 201 is used to determine the target customers whose churn rate meets the preset second condition based on the budget result of the estimation model.
[0148] In one possible implementation, the analysis module 203 is used to analyze the basic data of each customer, calculate the customer account cancellation ratio under different basic characteristics, and screen out the basic characteristics associated with the account cancellation rate as the first alternative characteristics, wherein the basic data includes gender, age, region, business department level, and permission activation information, and the basic characteristics include the user's gender and age group.
[0149] The analysis module 203 is used to analyze the transaction behaviors of the ordinary accounts and credit accounts of each customer within a preset time window, determine the target transaction behavior related to the customer's account cancellation among multiple transaction behaviors through the distribution differences in transaction characteristics between the customers who have cancelled their accounts and the customers who have not cancelled their accounts, and use the transaction data corresponding to the target transaction behavior as the second alternative feature.
[0150] The analysis module 203 is used to analyze the asset change data of the customer's customer account, and screen out the asset characteristics associated with the customer's account closure as the third alternative characteristics based on the distribution of asset characteristics, wherein the asset change data includes stock market value, fund holdings, and bond market value.
[0151] The judgment module 201 is used to select the first feature that meets the preset condition from the first candidate feature, select the second feature that meets the preset condition from the second candidate feature, and select the third feature that meets the preset condition from the third candidate feature, wherein the preset condition is to sort multiple candidate features within the group according to their respective ratios and select a preset number of candidate features.
[0152] The processing module 205 is used to form a candidate feature set according to the first feature, the second feature and the third feature.
[0153] In a possible implementation, the processing module 205 is used to process the first features in the candidate feature set one by one, and determine the data value of the de-accounted customer on the de-accounting day and the data value of the current time of the non-de-accounted customer as the first feature set.
[0154] The processing module 205 is used to combine the primary feature values of the first feature set in pairs to obtain a second feature set.
[0155] The processing module 205 is used to perform time series processing on the second feature and the third feature in the candidate feature set, respectively calculate the volatility and change rate of the customer's daily feature data in different preset time periods, and obtain the third feature set according to the calculation results.
[0156] The processing module 205 is used to merge the first feature set, the second feature set and the third feature set to obtain a comprehensive feature set.
[0157] In a possible implementation, the processing module 205 is used to divide the feature data into positive samples and negative samples according to the feature data of the comprehensive feature set, wherein the positive samples are the feature data of the customers who have cancelled their accounts in the comprehensive feature set, and the negative samples are the feature data of the customers who have not cancelled their accounts in the comprehensive feature set.
[0158] The processing module 205 is used to sort the positive samples according to the training time points to obtain processed positive samples, and disrupt the original order of the negative samples to obtain processed negative samples.
[0159] The processing module 205 is used to divide the processed positive samples into a training set, a validation set, and a test set according to a preset ratio, and to divide the processed negative samples into a training set, a validation set, and a test set according to a preset ratio.
[0160] The processing module 205 is used to set the initial parameters of the logistic regression model, input the training set and the validation set into the logistic regression model, and obtain the trained logistic regression model.
[0161] The processing module 205 is used to set the maximum number of learning rounds, learning rate, L1 regularization coefficient and L2 coefficient according to preset rules, respectively, and bring the maximum number of learning rounds, learning rate, L1 regularization coefficient and L2 coefficient into the trained logistic regression model for training, and input the test set into the trained logistic regression model to obtain a trained logistic regression model.
[0162] In a possible implementation, the acquisition module 202 is used to randomly sample the processed negative samples, and divide them into a training set, a validation set, and a test set according to a preset ratio after sampling.
[0163] The processing module 205 is used to input the training set, the validation set and the test set into the completed logistic regression model to obtain the prediction result.
[0164] The processing module 205 is used to merge the prediction result with the feature data of the comprehensive feature set to obtain a training data set.
[0165] Processing module 205 is used to set the parameter range of the gradient boosting decision tree model, including the maximum number of training rounds, learning rate, L1 regularization coefficient, L2 coefficient and the maximum depth of a single tree.
[0166] The processing module 205 is used to input the training data set into the gradient boosting decision tree model after setting, and obtain the trained gradient boosting decision tree model as the measurement model.
[0167] In a possible implementation, the acquisition module 202 is used to extract basic features, behavioral features, and time series features of any customer.
[0168] The construction module 204 is used to assign feature weights to the basic features, behavior features, and time series features.
[0169] The construction module 204 is used to obtain the churn rate of any customer according to the result calculated by the model based on the basic features, behavioral features, and time series features, as well as the feature weights.
[0170] The judgment module 201 is used to determine any customer as a target customer if it is determined that the churn rate is greater than or equal to a preset threshold.
[0171] In a possible implementation, the processing module 205 is used to obtain the churn rate of any customer according to the result calculated by the model based on the basic features, the behavioral features, the time series features, and the feature weights, and is specifically calculated by the following formula:
[0172]
[0173] Among them, P is the churn rate, σ is the activation function, M is the total number of decision trees, and α m For each decision tree T m The learning rate, T m (x) is the output of the mth tree, λ1 is the coefficient of L1 regularization, x i is the i-th feature among the basic features, behavioral features, and time series features of any customer, ω i is the feature weight, λ2 is the coefficient of L2 regularization, ω ij is feature x i and x j The interaction weight of .
[0174] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0175] This embodiment also discloses an electronic device, referring to Figure 3 The electronic device may include: at least one processor 301 , at least one communication bus 302 , a user interface 303 , a network interface 304 , and at least one memory 305 .
[0176] The communication bus 302 is used to realize the connection and communication between these components.
[0177] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0178] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0179] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.
[0180] Among them, the memory 305 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may also be at least one storage device located away from the aforementioned processor 301. The memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface 303 module, and an application for a method for calculating the loss of margin trading customers.
[0181] exist Figure 3 In the electronic device shown, the user interface 303 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 301 can be used to call an application program stored in the memory 305 for a method for calculating the churn of margin trading customers. When executed by one or more processors 301, the electronic device executes one or more methods in the above-mentioned embodiments.
[0182] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0183] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0184] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0185] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0186] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0187] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory 305 and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory 305 includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.
[0188] The present application also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores instructions. When executed by one or more processors 301, the electronic device executes one or more of the methods described in the above embodiments.
[0189] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, it will be easy for those skilled in the art to think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field that are not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A method for calculating the loss of margin trading customers, characterized in that: The method comprises: According to the preset first condition, determine the customer group to be analyzed; Obtaining historical data of each customer included in the customer group to be analyzed; Analyze the historical data to extract candidate feature sets; Processing the extracted candidate feature set to construct a multi-level comprehensive feature set; Pre-training the logistic regression model based on the comprehensive feature set, and then re-training the gradient boosting decision tree model based on the comprehensive feature set and the result of the pre-training, and obtaining a measurement model after the training is completed; Based on the budget result of the estimation model, determine the target customers whose churn rate meets the preset second condition; The determining of the target customers whose churn rate meets the preset second condition based on the budget result of the calculation model specifically includes: Extract basic features, behavioral features, and time series features of any customer; assigning feature weights to the basic features, the behavioral features, and the temporal features; Obtaining the churn rate of any one of the customers according to the result of calculation based on the model based on the basic features, the behavioral features, the time series features, and the feature weights; If it is determined that the churn rate is greater than or equal to a preset threshold, determining any one of the customers as the target customer; The model is based on the basic features, the behavioral features, the time series features, and the feature weight calculation result to obtain the churn rate of any one of the customers, which is specifically calculated by the following formula: ; Where P is the churn rate, σ is the activation function, M is the total number of decision trees, and α m For each decision tree T m The learning rate, T m (x) is the output of the mth tree, λ1 is the coefficient of L1 regularization, x i is the i-th feature among the basic features, behavioral features and time series features of any customer, ω i is the feature weight, λ2 is the coefficient of L2 regularization, ω ij is feature x i and x j The interaction weight of .
2. A method for calculating the loss of margin trading customers according to claim 1, characterized in that: The analyzing the historical data to extract the candidate feature set specifically includes: Analyze the basic data of each of the customers, calculate the customer account cancellation ratio under different basic characteristics, and select the basic characteristics associated with the account cancellation rate as the first candidate characteristics, wherein the basic data includes gender, age, region, business department level, and permission activation information, and the basic characteristics include the user's gender and age group; Analyze the transaction behaviors of the ordinary accounts and credit accounts of each of the customers within a preset time window, determine the target transaction behavior related to the customer account cancellation among the multiple transaction behaviors through the distribution difference of the transaction characteristics between the customers who cancelled their accounts and the customers who did not cancel their accounts, and use the transaction data corresponding to the target transaction behavior as the second candidate feature; Analyze the asset change data of the customer's customer account, and select asset features associated with the customer's account cancellation as the third candidate features according to the distribution of asset features, wherein the asset change data includes stock market value, fund holdings, and bond market value; Selecting a first feature that meets a preset condition from the first candidate feature, selecting a second feature that meets the preset condition from the second candidate feature, and selecting a third feature that meets the preset condition from the third candidate feature, wherein the preset condition is to sort multiple candidate features in groups according to their respective ratios, and select a preset number of candidate features; A candidate feature set is formed according to the first feature, the second feature and the third feature.
3. A method for calculating the loss of margin trading customers according to claim 2, characterized in that: The step of processing the extracted candidate feature set to construct a multi-level comprehensive feature set specifically includes: Process the first features in the candidate feature set one by one, and determine the data value of the cancelled customer on the day of cancellation and the data value of the current time of the customer who has not cancelled his account as the first feature set; Combining the primary feature values of the first feature set in pairs to obtain a second feature set; Performing time series processing on the second feature and the third feature in the candidate feature set, respectively calculating the volatility and the change rate of the customer's daily feature data in different preset time periods, and obtaining a third feature set according to the calculation results; The first feature set, the second feature set and the third feature set are combined to obtain the comprehensive feature set.
4. A method for calculating the loss of margin trading customers according to claim 1, characterized in that: The pre-training of the logistic regression model based on the comprehensive feature set specifically includes: According to the feature data of the comprehensive feature set, the feature data is divided into positive samples and negative samples, wherein the positive samples are feature data of customers who have cancelled their accounts in the comprehensive feature set, and the negative samples are feature data of customers who have not cancelled their accounts in the comprehensive feature set; The positive samples are sorted according to the training time points to obtain processed positive samples, and the negative samples are disrupted in their original order to obtain processed negative samples; Dividing the processed positive samples into a training set, a validation set, and a test set according to a preset ratio, and dividing the processed negative samples into a training set, a validation set, and a test set according to a preset ratio; Setting initial parameters of the logistic regression model, inputting the training set and the validation set into the logistic regression model, and obtaining a trained logistic regression model; The maximum number of learning rounds, learning rate, L1 regularization coefficient and L2 coefficient are set according to preset rules respectively, the maximum number of learning rounds, learning rate, L1 regularization coefficient and L2 coefficient are respectively combined and brought into the trained logistic regression model for training, and the test set is input into the trained logistic regression model to obtain a trained logistic regression model.
5. A method for calculating the loss of margin trading customers according to claim 4, characterized in that: The gradient boosting decision tree model is trained again based on the comprehensive feature set and the pre-training result, and a measurement model is obtained after the training is completed, specifically including: Randomly sampling the processed negative samples, and dividing them into a training set, a validation set, and a test set according to the preset ratio after sampling; Inputting the training set, the validation set, and the test set into the completed logistic regression model to obtain prediction results; Combining the prediction result with the feature data of the comprehensive feature set to obtain a training data set; Setting the parameter range of the gradient boosting decision tree model, including the maximum number of training rounds, learning rate, L1 regularization coefficient, L2 coefficient, and maximum depth of a single tree; After setting, the training data set is input into the gradient boosting decision tree model to obtain the trained gradient boosting decision tree model as the estimation model.
6. A device for calculating the loss of margin trading customers, characterized in that: The device comprises a judgment module (201), an acquisition module (202), an analysis module (203), a construction module (204) and a processing module (205), wherein: The judgment module (201) is used to determine the customer group to be analyzed according to a preset first condition; The acquisition module (202) is used to acquire the historical data of each customer included in the customer group to be analyzed; The analysis module (203) is used to analyze the historical data and extract a candidate feature set; The construction module (204) is used to process the extracted candidate feature set to construct a multi-level comprehensive feature set; The processing module (205) is used to pre-train the logistic regression model based on the comprehensive feature set, and then perform secondary training on the gradient boosting decision tree model based on the comprehensive feature set and the result of the pre-training, and obtain the measurement model after the training is completed; The judgment module (201) is used to determine the target customers whose churn rate meets the preset second condition based on the budget result of the calculation model; The processing module (205) is used to extract basic features, behavioral features and time series features of any customer; The processing module (205) is used to assign feature weights to the basic features, the behavioral features and the temporal features; The processing module (205) is used to obtain the churn rate of any one of the customers according to the result calculated by the model based on the basic features, the behavioral features, the time series features, and the feature weights; The processing module (205) is used to determine that any one of the customers is the target customer if it is determined that the churn rate is greater than or equal to a preset threshold; The processing module (205) is used to obtain the churn rate of any one of the customers according to the result calculated by the model based on the basic features, the behavioral features, the time series features, and the feature weights, and is specifically calculated by the following formula: ; Where P is the churn rate, σ is the activation function, M is the total number of decision trees, and α m For each decision tree T m The learning rate, T m (x) is the output of the mth tree, λ1 is the coefficient of L1 regularization, x i is the i-th feature among the basic features, behavioral features and time series features of any customer, ω i is the feature weight, λ2 is the coefficient of L2 regularization, ω ij is feature x i and x j The interaction weight of .
7. An electronic device, characterized in that: The electronic device comprises a processor (301), a communication bus (302), a user interface (303), a network interface (304) and a memory (305), wherein the memory (305) is used to store instructions, the user interface (303) and the network interface (304) are both used to communicate with other devices, and the processor (301) is used to execute the instructions stored in the memory (305) so that the electronic device executes the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 5 is performed.
Citation Information
Patent Citations
Customer portrait-based customer loss prediction and retrieval method and system
CN112561598A
Information prediction method and device, equipment and storage medium
CN118134047A