Training method and device of customer loss prediction model, customer loss prediction method and device, electronic equipment and computer program product
By constructing training sample data based on customer historical transaction data, pre-training and joint fine-tuning of the random forest model and time series model, the problems of poor timing information destruction and interpretability in the existing technology are solved, and high-accurate customer churn prediction is achieved.
Patent Information
- Application Number
- CN202411816319.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art In customer churn prediction, traditional machine learning methods destroy the timing information of the original data, resulting in lower accuracy and poor interpretability of deep learning methods.
A training method of the customer churn prediction model is adopted. By constructing training sample data based on customer historical transaction data, the random forest model and time series model are pre-trained, and jointly fine-tuned to obtain the final customer churn prediction model.
While considering the timing information of customer transaction data, this method fully captures customer churn characteristic information, improves the accuracy of customer churn prediction, and improves the interpretability of the model.
Smart Images

Figure CN119903946A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a customer churn prediction model training method and device, a customer churn prediction method and device, electronic equipment, and a computer program product. Background Art
[0002] Customers are the foundation of commercial banks' interests. With the continuous advancement and acceleration of the process of informatization, the competition for customers among banks is becoming increasingly fierce. At the same time, Internet finance also diverts customers with its advantages such as low threshold and high returns. The competition among banks has turned into competition for customers. Stable customers are the key to gaining the initiative in market competition. Therefore, how to predict customers with potential loss risks in advance is a key issue that major commercial banks focus on.
[0003] In the prior art, the prediction methods for the potential risk of customer churn mainly include methods based on traditional machine learning and methods based on deep learning. Methods based on traditional machine learning mainly include methods based on random forests and methods based on XGBoost. This type of method usually extracts highly discriminative features from the original data through feature engineering to achieve better performance, but at the same time destroys the time series information in the original data. Therefore, this type of method does not fully consider the time series information in the original data, and the algorithm accuracy is low.
[0004] Methods based on deep learning mainly include methods based on RNN (Recurrent Neural Network) and LSTM (Long Short-Term Memory). Most of the input data of this type of method is the result of simple processing of the original data, without additional feature engineering. Therefore, although the time series information of the original data can be retained, the interpretability of the method is poor. Summary of the invention
[0005] The embodiments of the present disclosure provide a customer churn prediction model training method and device, a customer churn prediction method and device, an electronic device, and a computer program product to improve the accuracy of customer churn prediction.
[0006] The embodiments of the present disclosure adopt the following technical solutions:
[0007] In a first aspect, an embodiment of the present disclosure provides a method for training a customer churn prediction model, the method for training a customer churn prediction model comprising:
[0008] Constructing training sample data for a customer churn prediction model, wherein the training sample data is constructed based on the customer's historical transaction data and corresponding churn prediction labels;
[0009] Pre-training a random forest model and a time series model respectively using the first training sample data in the training sample data to obtain a pre-trained random forest model and a pre-trained time series model;
[0010] The pre-trained random forest model and the pre-trained time series model are jointly fine-tuned using the second training sample data in the training sample data to obtain a final customer churn prediction model.
[0011] Optionally, the training sample data for building the customer churn prediction model includes:
[0012] Obtain historical transaction data of customers;
[0013] Preprocessing the historical transaction data of the customer to obtain the preprocessed historical transaction data of the customer;
[0014] Filter the pre-processed historical transaction data of the customer based on the target customer screening condition to obtain the pre-processed historical transaction data of the target customer;
[0015] Performing feature engineering on the preprocessed historical transaction data of the target customer to obtain historical transaction feature data of the target customer;
[0016] The training sample data is obtained according to the historical transaction feature data of the target customers, the pre-processed historical transaction data and the corresponding churn prediction labels.
[0017] Optionally, the using the first training sample data in the training sample data to pre-train the random forest model and the time series model respectively to obtain the pre-trained random forest model and the pre-trained time series model comprises:
[0018] Pre-training the random forest model using the historical transaction feature data of the target customer to obtain a pre-trained random forest model;
[0019] The time series model is pre-trained using the pre-processed historical transaction data of the target customer to obtain a pre-trained time series model.
[0020] Optionally, the using the second training sample data in the training sample data to jointly fine-tune the pre-trained random forest model and the pre-trained time series model to obtain the final customer churn prediction model includes:
[0021] Inputting second training sample data in the training sample data into the pre-trained random forest model and the pre-trained time series model respectively to obtain a first customer churn prediction result and a second customer churn prediction result;
[0022] Calculate a comprehensive prediction loss according to the first customer churn prediction result, the second customer churn prediction result, and corresponding churn prediction labels;
[0023] Using the comprehensive prediction loss, the parameters of the pre-trained random forest model and the parameters of the pre-trained time series model are respectively updated to obtain a fine-tuned random forest model and a fine-tuned time series model;
[0024] The fine-tuned random forest model and the fine-tuned time series model are used as the final customer churn prediction model.
[0025] Optionally, calculating a comprehensive prediction loss according to the first customer churn prediction result, the second customer churn prediction result, and corresponding churn prediction labels includes:
[0026] Performing weighted fusion on the first customer churn prediction result and the second customer churn prediction result to obtain a comprehensive prediction result;
[0027] The comprehensive prediction loss is calculated based on the comprehensive prediction result and the corresponding churn prediction label.
[0028] Optionally, the parameters of the pre-trained random forest model include the fusion weight corresponding to the first customer churn prediction result, and the parameters of the pre-trained time series model include the fusion weight corresponding to the second customer churn prediction result.
[0029] In a second aspect, the embodiment of the present disclosure further provides a customer churn prediction method, the customer churn prediction method comprising:
[0030] Obtain historical transaction data of customers;
[0031] Determine a first customer churn prediction result by using a random forest model in a customer churn prediction model according to the historical transaction data of the customer, and determine a second customer churn prediction result by using a time series model in the customer churn prediction model;
[0032] Determine a final customer churn prediction result according to the first customer churn prediction result and the second customer churn prediction result;
[0033] The customer churn prediction model is trained based on any of the training methods for the customer churn prediction models described above.
[0034] In a third aspect, the embodiments of the present disclosure further provide a training device for a customer churn prediction model, the training device for a customer churn prediction model comprising:
[0035] A construction unit, used to construct training sample data of a customer churn prediction model, wherein the training sample data is constructed based on the customer's historical transaction data and the corresponding churn prediction label;
[0036] A pre-training unit, used to pre-train a random forest model and a time series model respectively using the first training sample data in the training sample data to obtain a pre-trained random forest model and a pre-trained time series model;
[0037] A fine-tuning unit is used to jointly fine-tune the pre-trained random forest model and the pre-trained time series model using the second training sample data in the training sample data to obtain a final customer churn prediction model.
[0038] In a fourth aspect, the embodiments of the present disclosure further provide a customer churn prediction device, the customer churn prediction device comprising:
[0039] An acquisition unit, used to acquire historical transaction data of a customer;
[0040] A first determination unit is used to determine a first customer churn prediction result by using a random forest model in a customer churn prediction model according to the historical transaction data of the customer, and to determine a second customer churn prediction result by using a time series model in the customer churn prediction model;
[0041] A second determining unit, configured to determine a final customer churn prediction result according to the first customer churn prediction result and the second customer churn prediction result;
[0042] Wherein, the customer churn prediction model is trained based on the training device of the aforementioned customer churn prediction model.
[0043] In a fifth aspect, an embodiment of the present disclosure further provides an electronic device, including:
[0044] A processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes any of the aforementioned customer churn prediction model training methods and any of the aforementioned customer churn prediction methods.
[0045] In a sixth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program or instructions, wherein the computer program or instructions are executed by a processor to train any of the aforementioned customer churn prediction models and to execute any of the aforementioned customer churn prediction methods.
[0046] At least one of the above technical solutions adopted in the embodiments of the present disclosure can achieve the following beneficial effects: the training method of the customer churn prediction model of the embodiments of the present disclosure first constructs the training sample data of the customer churn prediction model, and the training sample data is constructed based on the customer's historical transaction data and the corresponding churn prediction label; then the first training sample data in the training sample data is used to pre-train the random forest model and the time series model respectively, to obtain the pre-trained random forest model and the pre-trained time series model; finally, the second training sample data in the training sample data is used to jointly fine-tune the pre-trained random forest model and the pre-trained time series model to obtain the final customer churn prediction model. The training method of the customer churn early warning model of the embodiments of the present disclosure first trains the random forest model and the time series model separately, thereby respectively tapping the learning potential of the two models, and then through the joint fine-tuning training of the two models, the time series information in the customer transaction data is considered while also fully capturing the customer churn feature information, further giving full play to the performance of the joint model, and improving the accuracy of customer churn prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0048] Figure 1 A flowchart of a method for training a customer churn prediction model in an embodiment of the present disclosure;
[0049] Figure 2 A schematic diagram of a process of predicting customer churn in an embodiment of the present disclosure;
[0050] Figure 3 A schematic diagram of a customer churn prediction process in an embodiment of the present disclosure;
[0051] Figure 4 It is a structural schematic diagram of a training device for a customer churn prediction model in an embodiment of the present disclosure;
[0052] Figure 5 It is a structural schematic diagram of a customer churn prediction device in an embodiment of the present disclosure;
[0053] Figure 6 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0055] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0056] The main technical terms involved in the embodiments of the present disclosure include:
[0057] 1) Random Forest: Random Forest is a classifier that contains multiple decision trees, and the category it outputs is determined by the mode of the categories output by each tree model. It can be used to handle classification and regression problems, as well as dimensionality reduction problems. It also has a good tolerance for outliers and noise, and has better prediction and classification performance than decision trees.
[0058] 2) LSTM: LSTM (Long Short-Term Memory) is a time-recurrent neural network that is specially designed to solve the long-term dependency problem of general RNN (recurrent neural network). The main feature of LSTM is that it introduces a gating mechanism to control the speed of information accumulation, including selectively adding new information and selectively forgetting previously accumulated information, thereby improving the long-term dependency problem of the recurrent neural network (RNN) and alleviating the gradient vanishing problem during long sequence training.
[0059] The present disclosure provides a method for training a customer churn prediction model. Figure 1 As shown, a flow chart of a method for training a customer churn prediction model in an embodiment of the present disclosure is provided. The method for training a customer churn prediction model at least includes the following steps S110 to S130:
[0060] Step S110, constructing training sample data for a customer churn prediction model, wherein the training sample data is constructed based on the customer's historical transaction data and corresponding churn prediction labels.
[0061] When training a customer churn prediction model, it is necessary to first construct training sample data for training the model. The training sample data can be constructed based on the customer's historical transaction data and the corresponding churn prediction label. For example, historical transaction data may include transaction amount, transaction time, transaction frequency, customer satisfaction, etc. The churn prediction label is a label that indicates whether the customer has churned corresponding to each piece of historical transaction data. This can be determined by analyzing whether the customer has transaction behavior over a period of time.
[0062] Step S120, using the first training sample data in the training sample data to pre-train the random forest model and the time series model respectively, to obtain a pre-trained random forest model and a pre-trained time series model.
[0063] The customer churn prediction model disclosed in the present invention is composed of two basic models: a random forest model and a time series model. The training sample data of the customer churn prediction model can be divided into two parts, one of which is used as the first training sample data to train the random forest model and the time series model separately.
[0064] For example, the prediction loss of the random forest model is calculated based on the customer churn prediction results output by the random forest model and the corresponding churn prediction labels, and the parameters of the random forest model are iteratively updated using the prediction loss of the random forest model to obtain a pre-trained random forest model. The prediction loss of the time series model is calculated based on the customer churn prediction results output by the time series model and the corresponding churn prediction labels, and the parameters of the time series model are iteratively updated using the prediction loss of the time series model to obtain a pre-trained time series model.
[0065] The above-mentioned time series model may adopt an LSTM network, for example. Of course, those skilled in the art may flexibly select the specific time series model to be adopted according to actual needs, and no specific limitation is made here.
[0066] Step S130, using the second training sample data in the training sample data to jointly fine-tune the pre-trained random forest model and the pre-trained time series model to obtain a final customer churn prediction model.
[0067] Another part of the training sample data of the customer churn prediction model is used as the second training sample data to jointly fine-tune the two pre-trained models obtained in the above steps, so as to further improve the overall performance of the two models, and output the final jointly fine-tuned random forest model and time series model to form the final customer churn prediction model.
[0068] The training method of the customer churn warning model of the disclosed embodiment first trains the random forest model and the time series model separately, thereby respectively exploring the learning potential of the two models, and then jointly fine-tunes the two models to consider the time series information in the customer transaction data while also fully capturing the customer churn feature information, further giving full play to the performance of the joint model and improving the accuracy of customer churn prediction.
[0069] In some embodiments of the present disclosure, the training sample data for constructing a customer churn prediction model includes: acquiring the customer's historical transaction data; preprocessing the customer's historical transaction data to obtain the customer's preprocessed historical transaction data; filtering the customer's preprocessed historical transaction data based on target customer screening conditions to obtain the target customer's preprocessed historical transaction data; performing feature engineering on the target customer's preprocessed historical transaction data to obtain the target customer's historical transaction feature data; and constructing the training sample data based on the target customer's historical transaction feature data, the preprocessed historical transaction data, and the corresponding churn prediction label.
[0070] When constructing training sample data for a customer churn prediction model, you can first collect historical transaction data of customers from the company's database or data warehouse. The historical transaction data may include, for example, transaction amount, transaction time, transaction frequency, customer satisfaction, etc.
[0071] After obtaining the customer's historical transaction data, further preprocessing operations may be performed on the customer's historical transaction data, such as filling missing values, processing outliers, normalizing data, etc., to ensure the quality of the historical transaction data.
[0072] Considering the needs of actual application scenarios, the prediction and early warning of customer churn mainly targets the customer groups that the enterprise actually pays attention to, namely the target customers. For example, some high-value customers are the target customers that the enterprise pays more attention to. Therefore, the pre-processed historical transaction data can be screened according to the target customer screening conditions set according to actual needs, and the historical transaction data of the target customers can be screened from the pre-processed customer transaction data as the basis for training the customer churn prediction model, thereby improving the pertinence of the customer churn prediction model.
[0073] Taking the screening of high-value customers as an example, a comprehensive judgment can be made based on the customer's long-term transaction amount, number of transactions, whether there is any recent transaction behavior, AUM (Assets Under Management), whether there is a bank card and products of the bank, etc. For example, if the customer's long-term transaction amount exceeds the transaction amount threshold, the number of transactions exceeds the transaction number threshold, there is no recent transaction (indicating possible loss), the AUM exceeds the threshold and the customer has a bank card and products of the bank, then the customer can be considered a high-value customer.
[0074] Using multi-dimensional features such as asset value, loyalty, and activity to create customer portraits to screen high-value customers is more in line with actual business needs and can effectively reduce the difficulty of modeling. Of course, how to define target customers or how to screen customers can be flexibly set by technicians in this field according to actual scenario requirements, and no specific restrictions are made here.
[0075] In order to further improve the ability of the random forest model to capture customer churn information, feature engineering can be performed on the pre-processed historical transaction data before training the model to extract multi-dimensional transaction feature data from the historical transaction data of the target customers, such as the number of recent transactions, recent transaction amounts, recent transaction days, recent non-transaction days, the ratio of recent transaction days to non-transaction days, transaction fluctuations, and other feature data. Then, the importance of different feature data can be calculated using information gain, Gini coefficient, etc. to improve the discrimination of different features. Finally, training sample data is constructed based on the historical transaction feature data of the target customers and the corresponding churn prediction labels.
[0076] Through the screening and preprocessing steps, the model can be trained in a targeted manner and the quality of the training sample data can be improved. Through the feature engineering step, valuable features for predicting customer churn can be extracted and created, thereby improving the prediction accuracy of the model. Using high-quality training sample data that has been screened and preprocessed to train the model can optimize the performance of the model, enabling it to better capture customer churn information, thereby helping companies identify potential churn customers in advance, take timely retention measures, and improve customer satisfaction and loyalty.
[0077] In some embodiments of the present disclosure, the use of the first training sample data in the training sample data to pre-train a random forest model and a time series model respectively to obtain a pre-trained random forest model and a pre-trained time series model includes: using the historical transaction feature data of the target customer to pre-train the random forest model to obtain a pre-trained random forest model; using the pre-processed historical transaction data of the target customer to pre-train the time series model to obtain a pre-trained time series model.
[0078] Based on the historical transaction feature data of the target customers obtained in the above-mentioned embodiment and the preprocessed historical transaction data, the random forest model and the time series model are pre-trained respectively. Since the training of the random forest model is mainly to better capture the customer churn feature information in the transaction data, the historical transaction feature data of the target customers obtained by feature engineering can be used to pre-train the random forest model. The training of the time series model is mainly to better capture the time series information in the transaction data, so the preprocessed historical transaction data, that is, the transaction data in the form of time series, can be directly used for training.
[0079] In some embodiments of the present disclosure, the method of jointly fine-tuning the pre-trained random forest model and the pre-trained time series model using the second training sample data in the training sample data to obtain a final customer churn prediction model includes: inputting the second training sample data in the training sample data into the pre-trained random forest model and the pre-trained time series model, respectively, to obtain a first customer churn prediction result and a second customer churn prediction result; calculating a comprehensive prediction loss based on the first customer churn prediction result and the second customer churn prediction result and corresponding churn prediction labels; using the comprehensive prediction loss to update the parameters of the pre-trained random forest model and the parameters of the pre-trained time series model, respectively, to obtain a fine-tuned random forest model and a fine-tuned time series model; and using the fine-tuned random forest model and the fine-tuned time series model as the final customer churn prediction model.
[0080] In the joint fine-tuning stage, the historical transaction feature data in the second training sample data can also be input into the pre-trained random forest model, so that the pre-trained random forest model outputs the first customer churn prediction result, and the pre-processed historical transaction data in the second training sample data can be input into the pre-trained time series model, so that the pre-trained time series model outputs the second customer churn prediction result. Combining the first customer churn prediction result and the second customer churn prediction result and the corresponding churn prediction label, the comprehensive prediction loss of the two models can be calculated. The comprehensive prediction loss can be understood as the loss calculated after the prediction results of the two models are integrated. Finally, the parameters of the two models are jointly optimized based on the comprehensive prediction loss to obtain the final customer churn prediction model.
[0081] Through joint fine-tuning training, the performance of the two models is further optimized and brought into full play. It not only fully captures the customer churn characteristic information, but also takes into account the time series information of historical transaction data, thereby improving the accuracy of the customer churn prediction model.
[0082] In some embodiments of the present disclosure, the calculating of the comprehensive prediction loss based on the first customer churn prediction result, the second customer churn prediction result and the corresponding churn prediction label includes: weighted fusion of the first customer churn prediction result and the second customer churn prediction result to obtain a comprehensive prediction result; and calculating the comprehensive prediction loss based on the comprehensive prediction result and the corresponding churn prediction label.
[0083] When calculating the comprehensive prediction loss, the first customer churn prediction result output by the pre-trained random forest model and the second customer churn prediction result output by the pre-trained time series model can be weightedly summed to obtain a comprehensive prediction result, and the comprehensive prediction loss can be calculated by combining the above comprehensive prediction result with the corresponding churn prediction label.
[0084] On the one hand, by fusing the prediction results of the random forest model and the time series model, we can make full use of the advantages of the two models in capturing different features, thereby improving the accuracy of customer churn prediction. The weighted fusion strategy can further balance the prediction deviations of the two models, making the final prediction results more robust and reliable. On the other hand, fusing the prediction results of different models helps to reduce the overfitting problem that may exist in a single model, improve the generalization ability of the model, and improve the training efficiency of the model compared to training a more complex and time-consuming model alone.
[0085] In some embodiments of the present disclosure, the parameters of the pre-trained random forest model include the fusion weight corresponding to the first customer churn prediction result, and the parameters of the pre-trained time series model include the fusion weight corresponding to the second customer churn prediction result.
[0086] In the joint fine-tuning stage, the parameters of the pre-trained random forest model and time series model include not only the parameters within each model (such as the number, depth, splitting criteria, etc. of decision trees in the random forest model, and the autoregressive coefficient, moving average coefficient, etc. in the time series model), but also the fusion weights corresponding to the prediction results of the two models in the above embodiment can be used as model parameters to be optimized. Compared with the preset fixed fusion weights, it can more effectively balance the contribution of the random forest model and the time series model in the prediction, thereby improving the accuracy of the overall prediction.
[0087] In some embodiments of the present disclosure, continuous self-optimization of the customer churn prediction model can also be achieved. For example, the churn warning list predicted by the customer churn prediction model can be sent to business personnel to perform merchant wake-up operations, and the wake-up results are continuously fed back to the customer churn prediction model for training and optimization, thereby further improving the accuracy of the model prediction and improving the efficiency of the wake-up service.
[0088] The disclosed embodiment also provides a method for predicting customer churn. Figure 2 As shown, a flow chart of a customer churn prediction method in an embodiment of the present disclosure is provided, and the customer churn prediction method at least includes the following steps S210 to S230:
[0089] Step S210, obtaining the customer's historical transaction data;
[0090] Step S220, determining a first customer churn prediction result by using a random forest model in a customer churn prediction model according to the historical transaction data of the customer, and determining a second customer churn prediction result by using a time series model in the customer churn prediction model;
[0091] Step S230, determining a final customer churn prediction result according to the first customer churn prediction result and the second customer churn prediction result; wherein the customer churn prediction model is trained based on any of the training methods for the customer churn prediction models described above.
[0092] Combination Figure 3 , a schematic diagram of a customer churn prediction process in an embodiment of the present disclosure is provided. Similar to the process in the aforementioned model training phase, in the actual prediction phase, the random forest model and the time series model in the trained customer churn prediction model can be used to predict the historical transaction data of the current customer, respectively, so as to obtain the customer churn prediction results output by the two models, and finally the customer churn prediction results output by the two models are weighted and fused, and the size of the weight is the parameter determined in the training phase, so as to obtain the final customer churn prediction result.
[0093] In some embodiments of the present disclosure, determining a first customer churn prediction result based on the customer's historical transaction data using a random forest model in a customer churn prediction model, and determining a second customer churn prediction result using a time series model in the customer churn prediction model include: preprocessing the customer's historical transaction data to obtain the customer's preprocessed historical transaction data; screening the customer's preprocessed historical transaction data based on target customer screening conditions to obtain the target customer's preprocessed historical transaction data; performing feature engineering on the target customer's preprocessed historical transaction data to obtain the customer's historical transaction feature data; and inputting the customer's historical transaction feature data into the random forest model and the time series model, respectively, to obtain the first customer churn prediction result and the second customer churn prediction result.
[0094] Continue to refer Figure 3In the actual prediction stage, it is also necessary to first screen, preprocess and feature engineer the customer's historical transaction data to obtain the preprocessed historical transaction data and historical transaction feature data of the target customer. The target customer's historical transaction feature data is input into the random forest model for prediction, and the preprocessed historical transaction data of the target customer is input into the time series model for prediction, so that the model can accurately capture the churn feature information and time series information in the customer transaction data at the same time.
[0095] In summary, compared with the prior art, the present disclosure has achieved at least the following technical effects:
[0096] 1) Existing traditional machine learning methods such as random forests usually perform feature engineering on the original data to extract highly discriminative features to achieve better performance, but this also destroys the time series information in the original data. The present disclosure is based on the LSTM network. The neurons of the LSTM network can receive the output from the previous moment and use it as the input of the current moment. The LSTM network has a hidden state at each time step to store the information of the previous moment. This cyclic connection enables the LSTM network to process long sequence data and has a certain memory capacity. Therefore, the present disclosure fully considers the time series information in the original data and has a higher accuracy rate;
[0097] 2) Most existing deep learning methods use the raw data as the input data of the model after simple processing, without additional feature engineering. The present disclosure is based on random forests, and can use information gain, Gini coefficient, etc. to calculate the importance of different features. Therefore, the customer churn prediction model trained by the present disclosure has the advantages of high feature differentiation and strong interpretability.
[0098] The present disclosure also provides a training device 400 for a customer churn prediction model. Figure 4 As shown, a schematic diagram of the structure of a training device for a customer churn prediction model in an embodiment of the present disclosure is provided. The training device 400 for a customer churn prediction model includes: a construction unit 410, a pre-training unit 420, and a fine-tuning unit 430, wherein:
[0099] A construction unit 410 is used to construct training sample data of a customer churn prediction model, wherein the training sample data is constructed based on the customer's historical transaction data and the corresponding churn prediction label;
[0100] A pre-training unit 420, configured to pre-train a random forest model and a time series model respectively using the first training sample data in the training sample data to obtain a pre-trained random forest model and a pre-trained time series model;
[0101] The fine-tuning unit 430 is used to jointly fine-tune the pre-trained random forest model and the pre-trained time series model using the second training sample data in the training sample data to obtain a final customer churn prediction model.
[0102] In some embodiments of the present disclosure, the construction unit 410 is specifically used to: obtain the customer's historical transaction data; filter the customer's historical transaction data based on the target customer screening conditions to obtain the target customer's historical transaction data; preprocess the target customer's historical transaction data to obtain the preprocessed historical transaction data of the target customer; perform feature engineering on the preprocessed historical transaction data of the target customer to obtain the target customer's historical transaction feature data; and obtain the training sample data based on the target customer's preprocessed historical transaction data, the historical transaction feature data, and the corresponding churn prediction label construction.
[0103] In some embodiments of the present disclosure, the fine-tuning unit 430 is specifically used to: input the second training sample data in the training sample data into the pre-trained random forest model and the pre-trained time series model respectively to obtain a first customer churn prediction result and a second customer churn prediction result; calculate a comprehensive prediction loss according to the first customer churn prediction result and the second customer churn prediction result and the corresponding churn prediction labels; use the comprehensive prediction loss to update the parameters of the pre-trained random forest model and the parameters of the pre-trained time series model respectively to obtain a fine-tuned random forest model and a fine-tuned time series model; and use the fine-tuned random forest model and the fine-tuned time series model as the final customer churn prediction model.
[0104] In some embodiments of the present disclosure, the fine-tuning unit 430 is specifically used to: perform weighted fusion on the first customer churn prediction result and the second customer churn prediction result to obtain a comprehensive prediction result; and calculate the comprehensive prediction loss based on the comprehensive prediction result and the corresponding churn prediction label.
[0105] In some embodiments of the present disclosure, the parameters of the pre-trained random forest model include the fusion weight corresponding to the first customer churn prediction result, and the parameters of the pre-trained time series model include the fusion weight corresponding to the second customer churn prediction result.
[0106] It can be understood that the above-mentioned customer churn prediction model training device can implement the various steps of the customer churn prediction model training method provided in the aforementioned embodiment. The relevant explanations on the customer churn prediction model training method are applicable to the customer churn prediction model training device and will not be repeated here.
[0107] The present disclosure also provides a customer churn prediction device 500. Figure 5 As shown, a schematic diagram of the structure of a customer churn prediction device in an embodiment of the present disclosure is provided, wherein the customer churn prediction device 500 comprises: an acquisition unit 510, a first determination unit 520 and a second determination unit 530, wherein:
[0108] An acquisition unit 510 is used to acquire historical transaction data of a customer;
[0109] A first determining unit 520 is configured to determine a first customer churn prediction result by using a random forest model in a customer churn prediction model according to the historical transaction data of the customer, and to determine a second customer churn prediction result by using a time series model in the customer churn prediction model;
[0110] A second determining unit 530, configured to determine a final customer churn prediction result according to the first customer churn prediction result and the second customer churn prediction result;
[0111] The customer churn prediction model is trained based on any of the training methods for the customer churn prediction models described above.
[0112] It can be understood that the above-mentioned customer churn prediction device can implement each step of the customer churn prediction method provided in the above-mentioned embodiment, and the relevant explanations about the customer churn prediction method are applicable to the customer churn prediction device and will not be repeated here.
[0113] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 6 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0114] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0115] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0116] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a training device for the customer churn prediction model and a customer churn prediction device at the logical level. The processor executes the program stored in the memory.
[0117] The above application Figure 1 The method disclosed in the embodiment shown is performed by the training device of the customer churn prediction model and the method of the present application Figure 2 The method performed by the customer churn prediction device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0118] The present disclosure also provides a computer program product, including a computer program or an instruction, which is implemented when the computer program or the instruction is executed by a processor. Figure 1Training method and implementation of customer churn prediction model in the illustrated embodiment Figure 2 The customer churn prediction method in the illustrated embodiment.
[0119] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0120] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0121] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0123] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0124] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0125] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0126] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0127] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0128] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A training method for a customer churn prediction model, characterized in that: The training method of the customer churn prediction model includes: Constructing training sample data for a customer churn prediction model, wherein the training sample data is constructed based on the customer's historical transaction data and corresponding churn prediction labels; Pre-training a random forest model and a time series model respectively using the first training sample data in the training sample data to obtain a pre-trained random forest model and a pre-trained time series model; The pre-trained random forest model and the pre-trained time series model are jointly fine-tuned using the second training sample data in the training sample data to obtain a final customer churn prediction model.
2. The training method of the customer churn prediction model according to claim 1, characterized in that: The training sample data for building the customer churn prediction model includes: Obtain historical transaction data of customers; Preprocessing the historical transaction data of the customer to obtain the preprocessed historical transaction data of the customer; Filter the pre-processed historical transaction data of the customer based on the target customer screening condition to obtain the pre-processed historical transaction data of the target customer; Performing feature engineering on the preprocessed historical transaction data of the target customer to obtain historical transaction feature data of the target customer; The training sample data is obtained according to the historical transaction feature data of the target customers, the pre-processed historical transaction data and the corresponding churn prediction labels.
3. The training method of the customer churn prediction model according to claim 2, characterized in that: The method of pre-training the random forest model and the time series model respectively by using the first training sample data in the training sample data to obtain the pre-trained random forest model and the pre-trained time series model comprises: Pre-training the random forest model using the historical transaction feature data of the target customer to obtain a pre-trained random forest model; The time series model is pre-trained using the pre-processed historical transaction data of the target customer to obtain a pre-trained time series model.
4. The training method of the customer churn prediction model according to claim 1, characterized in that: The method of jointly fine-tuning the pre-trained random forest model and the pre-trained time series model using the second training sample data in the training sample data to obtain the final customer churn prediction model includes: Inputting second training sample data in the training sample data into the pre-trained random forest model and the pre-trained time series model respectively to obtain a first customer churn prediction result and a second customer churn prediction result; Calculate a comprehensive prediction loss according to the first customer churn prediction result, the second customer churn prediction result, and corresponding churn prediction labels; Using the comprehensive prediction loss, the parameters of the pre-trained random forest model and the parameters of the pre-trained time series model are respectively updated to obtain a fine-tuned random forest model and a fine-tuned time series model; The fine-tuned random forest model and the fine-tuned time series model are used as the final customer churn prediction model.
5. The training method of the customer churn prediction model according to claim 4, characterized in that: The calculating of the comprehensive prediction loss according to the first customer churn prediction result, the second customer churn prediction result and the corresponding churn prediction labels comprises: Performing weighted fusion on the first customer churn prediction result and the second customer churn prediction result to obtain a comprehensive prediction result; The comprehensive prediction loss is calculated based on the comprehensive prediction result and the corresponding churn prediction label.
6. The training method of the customer churn prediction model according to claim 5, characterized in that: The parameters of the pre-trained random forest model include the fusion weight corresponding to the first customer churn prediction result, and the parameters of the pre-trained time series model include the fusion weight corresponding to the second customer churn prediction result.
7. A customer churn prediction method, characterized in that: The customer churn prediction method comprises: Obtain historical transaction data of customers; Determine a first customer churn prediction result by using a random forest model in a customer churn prediction model according to the historical transaction data of the customer, and determine a second customer churn prediction result by using a time series model in the customer churn prediction model; Determine a final customer churn prediction result according to the first customer churn prediction result and the second customer churn prediction result; Wherein, the customer churn prediction model is trained based on the training method of the customer churn prediction model according to any one of claims 1 to 6.
8. A training device for a customer churn prediction model, characterized in that: The training device of the customer churn prediction model comprises: A construction unit, used to construct training sample data of a customer churn prediction model, wherein the training sample data is constructed based on the customer's historical transaction data and the corresponding churn prediction label; A pre-training unit, used to pre-train a random forest model and a time series model respectively using the first training sample data in the training sample data to obtain a pre-trained random forest model and a pre-trained time series model; A fine-tuning unit is used to jointly fine-tune the pre-trained random forest model and the pre-trained time series model using the second training sample data in the training sample data to obtain a final customer churn prediction model.
9. A customer churn prediction device, characterized in that: The customer churn prediction device comprises: An acquisition unit, used to acquire historical transaction data of a customer; A first determination unit is used to determine a first customer churn prediction result by using a random forest model in a customer churn prediction model according to the historical transaction data of the customer, and to determine a second customer churn prediction result by using a time series model in the customer churn prediction model; A second determining unit, configured to determine a final customer churn prediction result according to the first customer churn prediction result and the second customer churn prediction result; Wherein, the customer churn prediction model is trained based on the customer churn prediction model training device according to claim 8.
10. An electronic device, comprising: processor; And a memory arranged to store computer executable instructions, which, when executed, cause the processor to execute the training method of the customer churn prediction model of any one of claims 1 to 6, and execute the customer churn prediction method of claim 7.
11. A computer program product, comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the training method of the customer churn prediction model of any one of claims 1 to 6 is implemented, and the customer churn prediction method of claim 7 is executed.