Merchant loss prediction method, device and equipment and readable storage medium

By combining the LSTM time series model and the XGboost model, the dynamic transaction characteristics and static characteristics of merchants are analyzed in combination, which solves the problem of low accuracy of merchant churn prediction in the existing technology, and achieves more efficient merchant churn prediction.

CN119398221APending Publication Date: 2025-02-07CHINA UNIONPAY MERCHANT SERVICES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411401561.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The reference data used in the existing merchant churn prediction methods are not comprehensive enough, resulting in low accuracy of merchant churn prediction.

Method used

By combining the LSTM time series model and the XGboost model, the dynamic transaction characteristics and static characteristics of merchants are analyzed to improve the accuracy of merchant churn prediction. The specific steps include obtaining the dynamic transaction characteristics of the merchant to be predicted, analyzing the dynamic transaction characteristics based on the LSTM model to obtain the first churn probability, and then combining the first churn probability and static feature analysis based on the XGboost model to obtain the second churn probability, and using it as Final churn probability output.

Benefits of technology

By combining the two models to analyze the dynamic transaction characteristics and static characteristics of merchants, the accuracy of merchant churn prediction is significantly improved, resources can be allocated more effectively, and merchant churn rate can be reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119398221A_ABST
    Figure CN119398221A_ABST
Patent Text Reader

Abstract

The invention discloses a merchant loss prediction method, device and equipment and a readable storage medium, and can be applied to the technical field of computers, and the method comprises the steps: obtaining a dynamic transaction feature of a fixed time period corresponding to a to-be-predicted merchant; the dynamic transaction features comprise the number and amount of daily transactions, a daily payment tool, a daily payment form and the number of days from the last transaction to the prediction date; analyzing the dynamic transaction characteristics based on a trained LSTM time sequence model, and obtaining a first loss probability; based on a trained XGboost model, analyzing the first loss probability and the static feature of the to-be-predicted merchant, and obtaining a second loss probability; and taking the second loss probability as a final loss probability of the to-be-predicted merchant, and outputting the second loss probability. In this way, the dynamic transaction features and the static features of the commercial tenants are combined and analyzed by combining the two models, and the accuracy of commercial tenant loss prediction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a merchant churn prediction method, device, equipment and readable storage medium. Background Art

[0002] Merchant churn refers to the situation where old merchants stop using the company's products or services for some reason. The merchant churn probability is the most direct indicator of merchant churn.

[0003] For some companies, merchants are the most basic and important guarantee for their development. The cost of expanding a new merchant is several times the cost of retaining an existing merchant. Therefore, in order to allocate resources more effectively and reduce the merchant churn rate, the company needs an efficient and accurate merchant churn prediction method. The reference data used in the existing merchant churn prediction method is not comprehensive enough, which leads to the problem of low accuracy of merchant churn prediction.

[0004] Therefore, how to improve the accuracy of merchant churn prediction is an issue that technical personnel in this field need to solve urgently. Summary of the invention

[0005] Based on the above problems, the embodiments of the present application provide a merchant churn prediction method, device, equipment and readable storage medium, which improves the accuracy of merchant churn prediction by combining two models to analyze the dynamic transaction characteristics and static characteristics of merchants.

[0006] In a first aspect, an embodiment of the present application provides a merchant churn prediction method, comprising:

[0007] Obtain dynamic transaction features of a fixed period corresponding to the merchant to be predicted; the dynamic transaction features include the number and amount of daily transactions, daily payment tools, daily payment methods, and the number of days from the last transaction to the prediction date;

[0008] Analyze the dynamic transaction characteristics based on the trained LSTM time series model and obtain a first churn probability;

[0009] Analyze the first churn probability and the static characteristics of the merchant to be predicted based on the trained XGboost model to obtain a second churn probability;

[0010] The second churn probability is used as the final churn probability of the merchant to be predicted and outputted.

[0011] Optionally, the step of obtaining dynamic transaction characteristics of a fixed time period corresponding to the merchant to be predicted includes:

[0012] Get the dynamic transaction characteristics of the merchant to be predicted within 180 days from the prediction date.

[0013] Optionally, the LSTM time series model is trained by the following method:

[0014] Build LSTM basic network model;

[0015] Obtain dynamic transaction characteristics of a preset number of merchants in normal status over the past 180 days before the forecast period;

[0016] Determine the merchant tags corresponding to each of the merchants in the normal state based on the preset business caliber representing the merchant loss and the dynamic transaction characteristics; the merchant tags include lost merchants and non-lost merchants;

[0017] The LSTM basic network model is trained based on the merchant tag and the dynamic transaction feature, and an LSTM time series model is obtained.

[0018] Optionally, the preset business criteria for characterizing merchant loss include: no merchant transactions within one month or merchant active withdrawal.

[0019] Optionally, the training of the LSTM basic network model based on the merchant tag and the dynamic transaction feature to obtain the LSTM time series model includes:

[0020] Analyze the daily changes of the average values ​​of the dynamic transaction features of the different merchant tags within 180 days before the forecast period, and obtain the change trend;

[0021] Fill the dynamic transaction features corresponding to each merchant with null values ​​and perform normalization processing to obtain normalized data of each dynamic transaction feature corresponding to each merchant;

[0022] Divide the merchants into a training set and a validation set; the number of merchants in the training set with a merchant label of lost merchants is equal to the number of merchants with a merchant label of non-lost merchants; the number of merchants in the validation set with a merchant label of lost merchants is equal to the number of merchants with a merchant label of non-lost merchants;

[0023] The LSTM basic network model is trained based on the training set and the normalized data of each dynamic transaction feature corresponding to each merchant in the training set, and is verified based on the validation set and the normalized data of each dynamic transaction feature corresponding to each merchant in the validation set during the training process to obtain an LSTM time series model.

[0024] Optionally, the XGboost model is trained by the following method:

[0025] Perform one-hot encoding on the static features corresponding to the merchants in the training set;

[0026] Using the LSTM time series model to predict the churn of each merchant in the training set, and obtaining the predicted churn probability corresponding to each merchant;

[0027] The XGboost parameters are searched by using a grid search method, and the XGboost model is trained based on the encoded static features and the predicted churn probability to obtain a trained XGboost model.

[0028] Optionally, the method further includes:

[0029] Comparing the final churn probability with a preset threshold;

[0030] If the comparison result shows that the final churn probability is greater than or equal to the preset threshold, the merchant information of the merchant to be predicted corresponding to the final churn probability is sent to the account manager, and the account manager is urged to conduct a customer return visit.

[0031] In a second aspect, an embodiment of the present application provides a merchant loss prediction device, characterized in that it includes:

[0032] An acquisition module is used to acquire dynamic transaction features of a fixed period of time corresponding to the merchant to be predicted; the dynamic transaction features include the number and amount of daily transactions, daily payment tools, daily payment methods, and the number of days from the last transaction to the prediction date;

[0033] A first analysis module, configured to analyze the dynamic transaction features based on a trained LSTM time series model and obtain a first churn probability;

[0034] A second analysis module is used to analyze the first churn probability and the static characteristics of the merchant to be predicted based on the trained XGboost model, and obtain a second churn probability;

[0035] An output module is used to use the second churn probability as the final churn probability of the merchant to be predicted and output it.

[0036] In a third aspect, an embodiment of the present application provides a merchant loss prediction device, characterized in that it includes:

[0037] Memory for storing computer programs;

[0038] A processor is used to implement the steps of the merchant loss prediction method as described above when executing the computer program.

[0039] In a fourth aspect, an embodiment of the present application provides a readable storage medium, characterized in that a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the merchant churn prediction method described above are implemented.

[0040] It can be seen from the above technical solutions that compared with the prior art, the present application has the following advantages:

[0041] This application first obtains the dynamic transaction characteristics of a fixed time period corresponding to the merchant to be predicted. Among them, the dynamic transaction characteristics include the number and amount of daily transactions, daily payment tools, daily payment forms, and the number of days from the last transaction to the prediction date. Then, based on the trained LSTM time series model, the dynamic transaction characteristics are analyzed, and the first churn probability is obtained. Then, based on the trained XGboost model, the first churn probability and the static characteristics of the merchant to be predicted are analyzed, and the second churn probability is obtained. Finally, the second churn probability is used as the final churn probability of the merchant to be predicted, and is output. In this way, by combining the two models to analyze the dynamic transaction characteristics and static characteristics of the merchant, the accuracy of merchant churn prediction is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of an overall system design provided for an embodiment of the present application;

[0043] Figure 2 A flowchart of a merchant loss prediction method provided in an embodiment of the present application;

[0044] Figure 3 A characteristic trend diagram of a merchant label as a lost merchant provided in an embodiment of the present application;

[0045] Figure 4 A characteristic trend diagram of a merchant label as a non-churn merchant provided in an embodiment of the present application;

[0046] Figure 5 A schematic diagram of the structure of a merchant churn prediction device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] As mentioned above, the existing merchant churn prediction methods have the problem of low prediction accuracy. Specifically, the existing methods generally use a trained single XGboost model combined with some merchant features for model prediction, but this method is difficult to ensure that the reference data used is comprehensive, which easily leads to the problem of low merchant churn prediction accuracy.

[0048] In order to solve the above problems, an embodiment of the present application provides a merchant churn prediction method, comprising: first obtaining the dynamic transaction characteristics of a fixed time period corresponding to the merchant to be predicted. Wherein, the dynamic transaction characteristics include the number and amount of transactions per day, the daily payment tool, the daily payment form, and the number of days from the last transaction to the prediction date. Then, based on the trained LSTM time series model, the dynamic transaction characteristics are analyzed to obtain a first churn probability. Then, based on the trained XGboost model, the first churn probability and the static characteristics of the merchant to be predicted are analyzed to obtain a second churn probability. Finally, the second churn probability is used as the final churn probability of the merchant to be predicted and output.

[0049] In this way, by combining the two models to analyze the dynamic transaction characteristics and static characteristics of merchants, the accuracy of merchant churn prediction is improved.

[0050] It should be noted that the merchant churn prediction method, device, equipment and readable storage medium provided by the present application can be applied to the field of computer technology. The above is only an example and does not limit the application field of the merchant churn prediction method, device, equipment and readable storage medium provided by the present application.

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. 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 creative work are within the scope of protection of this application.

[0052] Figure 1 A schematic diagram of the overall design of a system provided in an embodiment of the present application. Figure 1 As shown, the overall system for merchant loss prediction provided by the embodiment of the present application includes a transaction system, a merchant management system, a Xuanwu big data platform, a machine learning modeling platform, and a silver merchant party. Among them, the transaction system is the core system of the company's acquiring business, which records each transaction flow of the merchant's acquiring. The flow information generally includes the merchant number, transaction time, terminal number, payment tool, payment form, handling fee, and transaction amount, etc. The merchant management system is used to record the static information of the account, including the merchant name, merchant number, merchant status, network access time, branch office, district and county, merchant level, merchant category code, etc. The Xuanwu big data platform is used to collect, synchronize, process and manage data from various business systems to form data assets. The machine learning modeling platform is used to build, train and deploy machine learning models. Silver Merchant Party is an APP proposed in this application for use by account managers to operate and serve merchants.

[0053] Figure 2 A flowchart of a merchant loss prediction method provided in an embodiment of the present application. Figure 2 As shown, a merchant loss prediction method provided by an embodiment of the present application may include:

[0054] S201: Obtain dynamic transaction features of a fixed time period corresponding to the merchant to be predicted; the dynamic transaction features include the number and amount of daily transactions, daily payment tools, daily payment methods, and the number of days from the last transaction to the prediction date.

[0055] In practical applications, the merchant loss prediction device provided by the present application can predict the loss of a certain merchant or multiple merchants cooperating with the company, and the predicted merchants are called merchants to be predicted. Before cooperating with the company, the merchant to be predicted generally needs to sign a contract and register the merchant information. At this time, the merchant information is the static information of the merchant and is recorded in the merchant management system. During the cooperation between the merchant and the company, the merchant will generate a series of flow information, which is recorded in the transaction system. The LSTM time series model is trained and generated based on the merchant's flow information, and the merchant's flow information at a certain moment is meaningless for loss prediction. Therefore, when predicting the loss of merchants, the embodiment of the present application first obtains the flow information (dynamic transaction features) of the merchant to be predicted within a period of time. Among them, the span of "a period of time" is generally consistent with the time span of the reference data used when training the LSTM time series model. The dynamic transaction features here are transaction features that may affect the loss of merchants, and can include the number and amount of daily transactions, daily payment tools, daily payment forms, and the number of days from the last transaction to the prediction date.

[0056] In addition, since the selection of the fixed time period is not the same, the embodiment of the present application can illustrate a possible selection method.

[0057] In one case, the obtaining of dynamic transaction characteristics of a fixed time period corresponding to the merchant to be predicted includes:

[0058] Get the dynamic transaction characteristics of the merchant to be predicted within 180 days from the prediction date.

[0059] In practical applications, the longer the time span of the reference data used, the more obvious its changing trend characteristics, and the better the effect of training the LSTM time series model. The embodiment of the present application uses reference data with a time span of 180 days for model training. Therefore, when predicting merchant churn, the merchant churn prediction device also needs to obtain the dynamic transaction characteristics of the merchant to be predicted 180 days from the prediction date. For example, if the company conducts merchant churn prediction once a month, when predicting merchant churn on June 1, 2024, the merchant churn prediction device obtains the 180-day dynamic transaction characteristics from 180 days before May 31, 2024 to May 31, 2024.

[0060] S202: Analyze the dynamic transaction characteristics based on the trained LSTM time series model and obtain a first churn probability.

[0061] In practical applications, the trained LSTM time series model is used to preliminarily determine the churn probability (first churn probability) of the merchant to be predicted. In combination with the above, the trained LSTM time series model can preliminarily predict the first churn probability of the merchant to be predicted based on the dynamic transaction characteristics of the merchant to be predicted 180 days from the prediction date, and the first churn probability is between 0 and 1.

[0062] S203: Analyze the first churn probability and the static characteristics of the merchant to be predicted based on the trained XGboost model to obtain a second churn probability.

[0063] In practical applications, the XGboost model is generated by modeling using the XGboost algorithm based on the LSTM time series model. The data used for training the XGboost model is the churn probability output by the LSTM time series model and the static information (static features) of the merchant. Therefore, in the process of predicting merchant churn for the merchant to be predicted, the first churn probability obtained by the LSTM time series model analysis and the static information of the merchant to be predicted need to be sent to the trained XGboost model for analysis, and the second churn probability is obtained. Static features include: the network access time, branch, district, county, merchant level, merchant category code, number of terminals, average merchant rate, merchant type, whether it is a pure code merchant, a stone T+0 merchant, whether it is a large merchant, and whether it is a small and micro merchant.

[0064] S204: Taking the second churn probability as the final churn probability of the merchant to be predicted, and outputting it.

[0065] In actual applications, although only using dynamic transaction features to predict merchant churn can dig out merchant transaction trends, since only the merchant transaction features within half a year are used, for some periodic merchants, such as mooncakes, rice dumplings and other merchants with specific cycles or attributes, it is impossible to judge whether the merchant has churned based on transactions within half a year. Therefore, it is necessary to introduce static features such as merchant type and merchant level during prediction to make up for this information. In this way, the LSTM time series model and the XGboost model are combined to jointly predict the dynamic transaction features and static features of the merchant to be predicted, so as to obtain the second churn probability that better represents the merchant churn probability, and the second churn probability is used as the final churn probability of the merchant to be predicted, and is output and displayed for company analysis.

[0066] In addition, since different final loss probabilities correspond to different processing methods, the embodiment of the present application can illustrate a possible processing method.

[0067] In one embodiment, the method further comprises:

[0068] Comparing the final churn probability with a preset threshold;

[0069] If the comparison result shows that the final churn probability is greater than or equal to the preset threshold, the merchant information of the merchant to be predicted corresponding to the final churn probability is sent to the account manager, and the account manager is urged to conduct a customer return visit.

[0070] In actual applications, the value of the final churn probability is also between 0 and 1. It is understandable that the larger the value, the greater the probability of merchant churn. Combined with the training experience of the model, a probability threshold (preset threshold) is set to divide the processing method. Specifically, after obtaining the final churn probability of the merchant to be predicted, the merchant churn prediction device compares it with the preset threshold and obtains the comparison result. When the comparison shows that the final churn probability is less than the preset threshold, only the final churn probability is associated with time and recorded; when the comparison result shows that the final churn probability is greater than or equal to the preset threshold, it is highlighted on the Yinshang Pai, and the merchant to be predicted corresponding to the final churn probability is sent to the account manager, and the account manager is urged to make a customer return visit as soon as possible.

[0071] To summarize, first obtain the dynamic transaction features of a fixed time period corresponding to the merchant to be predicted. Among them, the dynamic transaction features include the number and amount of daily transactions, daily payment tools, daily payment forms, and the number of days from the last transaction to the prediction date. Then, based on the trained LSTM time series model, the dynamic transaction features are analyzed to obtain the first churn probability. Then, based on the trained XGboost model, the first churn probability and the static features of the merchant to be predicted are analyzed to obtain the second churn probability. Finally, the second churn probability is used as the final churn probability of the merchant to be predicted and output. In this way, by combining the two models to analyze the dynamic transaction features and static features of the merchant, the accuracy of merchant churn prediction is improved.

[0072] In addition, the model training methods corresponding to different implementation schemes are not the same, so the embodiments of the present application can illustrate a possible training method.

[0073] In one case, the LSTM time series model is trained by:

[0074] Build LSTM basic network model;

[0075] Obtain dynamic transaction characteristics of a preset number of merchants in normal status over the past 180 days before the forecast period;

[0076] Determine the merchant tags corresponding to each of the merchants in the normal state based on the preset business caliber representing the merchant loss and the dynamic transaction characteristics; the merchant tags include lost merchants and non-lost merchants;

[0077] The LSTM basic network model is trained based on the merchant tag and the dynamic transaction feature, and an LSTM time series model is obtained.

[0078] In practical applications, the modeling of the LSTM time series model is based on the LSTM basic network model, and the training rules can be manually formulated. Specifically, technicians can list the dynamic transaction features that may affect merchant churn based on business experience, such as the number and amount of daily transactions (0-10 yuan per day, 10-100 yuan per day, 100-1000 yuan per day, 1000-10000 yuan per day, 10000-10000 yuan per day, 10000-50000 yuan per day, the number and amount of transactions above 50000 yuan per day, and the total number and amount of daily transactions); daily payment tools (daily bank cards, daily Alipay / WeChat, daily UnionPay QR codes, daily Quanmin and daily other transaction numbers and amounts); daily payment methods (offline barcode payment, online payment and offline card payment numbers and amounts); the number of days from the last transaction to the prediction. Then determine the prediction time for each month and the time data used for training. For example, Yinshangpai synchronizes data on the 1st of each month, so the prediction time point for merchant churn prediction is set at 0:00 on the 1st of each month. The feature time uses the 180-day feature data from 180 days before May 31, 2024 to May 31, 2024, and the churn label time uses the 30-day label from June 1, 2024 to June 30, 2024. Then, the model is trained based on whether the merchant eventually churns and the changing trend of the 180-day dynamic transaction characteristics of each merchant, so that the trained model can accurately predict the merchant label (churn merchant / non-churn merchant) of each merchant according to the changing trend of the merchant's dynamic transaction characteristics. Specifically, a LSTM basic network model including 30 neurons is first constructed. Then, assuming that the prediction period is from June 1 to June 30, merchants with normal merchant status on May 31, 2024 are obtained as training samples, and a certain number of merchants are selected from the training samples for training, and the dynamic transaction characteristics listed above that may affect merchant churn are obtained from these merchants from 180 days before May 31, 2024 to 180 days on May 31, 2024. Then, the labels within 30 days from June 1, 2024 to June 30, 2024 are calculated according to the business caliber of merchant loss, and the selected merchants are divided into lost merchants and non-lost merchants. Finally, the merchant loss prediction device trains the LSTM basic network model according to the merchant labels of each merchant (lost merchants or non-lost merchants) and the dynamic transaction features corresponding to each merchant, and obtains the LSTM time series model.

[0079] In addition, since the business definitions for characterizing merchant loss vary, the embodiments of the present application may describe a possible characterization method.

[0080] In one case, the preset business criteria for characterizing merchant loss include: no merchant transactions within one month or merchant active withdrawal.

[0081] In actual applications, the business caliber that represents merchant loss is used to determine the merchant tag. Different companies have different setting methods, such as no transactions within half a month, or even shorter.

[0082] In addition, since the methods of training to obtain the LSTM time series model are not the same, the embodiment of the present application can illustrate a possible training method.

[0083] In one embodiment, the LSTM basic network model is trained based on the merchant tag and the dynamic transaction feature to obtain the LSTM time series model, including:

[0084] Analyze the daily changes of the average values ​​of the dynamic transaction features of the different merchant tags within 180 days before the forecast period, and obtain the change trend;

[0085] Fill the dynamic transaction features corresponding to each merchant with null values ​​and perform normalization processing to obtain normalized data of each dynamic transaction feature corresponding to each merchant;

[0086] Divide the merchants into a training set and a validation set; the number of merchants in the training set with a merchant label of lost merchants is equal to the number of merchants with a merchant label of non-lost merchants; the number of merchants in the validation set with a merchant label of lost merchants is equal to the number of merchants with a merchant label of non-lost merchants;

[0087] The LSTM basic network model is trained based on the training set and the normalized data of each dynamic transaction feature corresponding to each merchant in the training set, and is verified based on the validation set and the normalized data of each dynamic transaction feature corresponding to each merchant in the validation set during the training process to obtain an LSTM time series model.

[0088] In practical applications, combined with the above, assuming that merchants on May 31, 2024 are screened, the number of samples of merchants that meet the normal merchant status is 4179061, and the LSTM basic network model includes 30 neurons. At this time, the training data dimension of the dynamic transaction feature is 4179061 samples * 180 days * 30 transaction features. At the same time, because merchants do not have transaction data every day and every transaction feature, the data needs to be filled with 0. That is, each feature of each merchant within 180 days is normalized from 0 to 1. It can be understood that the normalization logic is: traverse 30 transaction features, for feature n, the 180 features of Day1-Day180 of feature n are normalized from 0 to 1 to ensure that the interval after feature scaling is [0,1]. Then divide the acquired merchants into training set, test set and validation set. For example, randomly select 10,000 lost merchants from the above selected merchants in normal state as positive samples, select 10,000 non-lost merchants as negative samples, and integrate the two as training set; then select 10,000 positive and negative samples as validation set; select 310 positive samples and 10,000 negative samples as test set (this ratio is close to the real loss ratio). Continuing with the above, the LSTM basic network model sets the number of neurons to 30, the input data dimension is 180*30, where 180 is the time length and 30 is the feature dimension of a single time length. Based on the normalized data of each dynamic transaction feature corresponding to each merchant in the training set and the training set, the number of batch input samples is 32, the LSTM basic network model is trained, and during the training process, it is verified based on the normalized data of each dynamic transaction feature corresponding to each merchant in the validation set and the validation set, and the LSTM time series model is obtained. In addition, it is necessary to make predictions based on the test set. After adjusting the probability threshold, it is found that when the threshold is 0.7, the F1 (harmonic mean of precision and recall) value is the highest, reaching 0.68, which means that it has both good precision and good recall.

[0089] Figure 3 A characteristic trend diagram of a merchant label as a lost merchant provided in an embodiment of the present application. Figure 3 As shown in the figure, a is the trend of the number of transactions of 10-100 yuan per day, b is the trend of the total number of transactions per day, and c is the trend of the number of Alipay / WeChat transactions per day. Through analysis, it can be seen that the dynamic transaction characteristics of lost merchants have shown a clear downward trend in half a year.

[0090] Figure 4 A characteristic trend diagram of a merchant label as a non-churn merchant provided in an embodiment of the present application. Figure 4As shown in the figure, a is the trend of the number of transactions of 10-100 yuan per day, b is the trend of the total number of transactions per day, and c is the trend of the number of Alipay / WeChat transactions per day. Through analysis, it can be seen that the dynamic transaction characteristics of non-churned merchants have shown a stable trend within half a year.

[0091] In addition, since there are different ways to train the XGboost model, the embodiment of the present application can illustrate a possible training method.

[0092] In one case, the XGboost model is trained by:

[0093] Perform one-hot encoding on the static features corresponding to the merchants in the training set;

[0094] Using the LSTM time series model to predict the churn of each merchant in the training set, and obtaining the predicted churn probability corresponding to each merchant;

[0095] The XGboost parameters are searched by using a grid search method, and the XGboost model is trained based on the encoded static features and the predicted churn probability to obtain a trained XGboost model.

[0096] In practical applications, the above-trained LSTM time series model is first used to predict the loss of each merchant in the training set, and the predicted loss probability P corresponding to each merchant is obtained. Then, combined with business experience and merchant information in the merchant management system, technical personnel select static features that may be useful for merchant loss prediction, such as network access time, branch, district, merchant level, merchant category code, number of terminals, merchant average rate, merchant type, whether it is a pure code merchant, whether it is a T+0 merchant, whether it is a large merchant, and whether it is a small and micro merchant. Then, some static features of the merchants selected from the above training set (such as branches, districts, counties, merchant levels, merchant category codes, and merchant types) are uniquely encoded. Then, the above-encoded discrete features and a series of static features that do not require encoding, such as the number of terminals, the average merchant rate, whether it is a pure code merchant, whether it is a T+0 merchant, whether it is a large merchant, whether it is a small merchant, and the predicted churn probability P, are input into the XGboost model. Based on the above division of the training set, validation set, and test set, the grid search method is used to search for XGboost parameters, train the model, and obtain the best model parameters and the best model to complete the training of the XGboost model. In addition, based on the test set and probability P, after adjusting the probability threshold, it can be concluded that when the threshold is 0.87, the F1 value is the highest, exceeding 0.83, the accuracy is 0.86, and the recall rate is 0.81.

[0097] In summary, the present application first obtains the dynamic transaction characteristics of a fixed time period corresponding to the merchant to be predicted. Among them, the dynamic transaction characteristics include the number and amount of daily transactions, daily payment tools, daily payment forms, and the number of days from the last transaction to the prediction date. Then, based on the trained LSTM time series model, the dynamic transaction characteristics are analyzed, and the first churn probability is obtained. Then, based on the trained XGboost model, the first churn probability and the static characteristics of the merchant to be predicted are analyzed, and the second churn probability is obtained. Finally, the second churn probability is used as the final churn probability of the merchant to be predicted, and is output. In this way, by combining the two models to analyze the dynamic transaction characteristics and static characteristics of the merchant, the accuracy of merchant churn prediction is improved.

[0098] Based on the merchant loss prediction method provided in the above embodiment, the present application also provides a merchant loss prediction device. The merchant loss prediction device is described below in conjunction with the embodiments and drawings.

[0099] Figure 5 A schematic diagram of the structure of a merchant loss prediction device provided in an embodiment of the present application. Figure 5 As shown, the merchant loss prediction device 500 provided in the embodiment of the present application includes:

[0100] Acquisition module 501, acquires dynamic transaction features of a fixed period corresponding to the merchant to be predicted; the dynamic transaction features include the number and amount of daily transactions, daily payment tools, daily payment forms, and the number of days from the last transaction to the prediction date;

[0101] A first analysis module 502, configured to analyze the dynamic transaction features based on a trained LSTM time series model and obtain a first churn probability;

[0102] A second analysis module 503 is used to analyze the first churn probability and the static characteristics of the merchant to be predicted based on the trained XGboost model, and obtain a second churn probability;

[0103] The output module 504 is used to use the second churn probability as the final churn probability of the merchant to be predicted and output it.

[0104] As an implementation method, with respect to how to obtain the dynamic transaction features of a fixed time period corresponding to the merchant to be predicted, the acquisition module 501 is specifically used to:

[0105] Get the dynamic transaction characteristics of the merchant to be predicted within 180 days from the prediction date.

[0106] As an implementation method, with respect to how to obtain the LSTM time series model, the above-mentioned merchant loss prediction device 500 further includes: a construction submodule, an acquisition submodule, a determination submodule and a first training module;

[0107] Construct submodules to build LSTM basic network models;

[0108] The acquisition submodule is used to obtain the dynamic transaction characteristics of a preset number of merchants in normal state since 180 days before the forecast period;

[0109] A determination submodule, configured to determine a merchant tag corresponding to each merchant in the normal state based on a preset business caliber characterizing merchant loss and the dynamic transaction characteristics; the merchant tags include lost merchants and non-lost merchants;

[0110] The first training module is used to train the LSTM basic network model based on the merchant tag and the dynamic transaction feature, and obtain an LSTM time series model.

[0111] Among them, the preset business definitions that represent merchant loss include: no transactions with the merchant within one month or the merchant actively withdraws.

[0112] As an implementation method, regarding how to train to obtain the LSTM time series model, the first training module is specifically used for:

[0113] Analyze the daily changes of the average values ​​of the dynamic transaction features of the different merchant tags within 180 days before the forecast period, and obtain the change trend;

[0114] Fill the dynamic transaction features corresponding to each merchant with null values ​​and perform normalization processing to obtain normalized data of each dynamic transaction feature corresponding to each merchant;

[0115] Divide the merchants into a training set and a validation set; the number of merchants in the training set with a merchant label of lost merchants is equal to the number of merchants with a merchant label of non-lost merchants; the number of merchants in the validation set with a merchant label of lost merchants is equal to the number of merchants with a merchant label of non-lost merchants;

[0116] The LSTM basic network model is trained based on the training set and the normalized data of each dynamic transaction feature corresponding to each merchant in the training set, and is verified based on the validation set and the normalized data of each dynamic transaction feature corresponding to each merchant in the validation set during the training process to obtain an LSTM time series model.

[0117] As an implementation method, regarding how to train the XGboost model, the merchant churn prediction device 500 further includes a second training module;

[0118] The second training module is used to perform one-hot encoding on the static features corresponding to the merchants in the training set;

[0119] Using the LSTM time series model to predict the churn of each merchant in the training set, and obtaining the predicted churn probability corresponding to each merchant;

[0120] The XGboost parameters are searched by using a grid search method, and the XGboost model is trained based on the encoded static features and the predicted churn probability to obtain a trained XGboost model.

[0121] As an implementation method, in order to deal with merchants with different final churn probabilities, the merchant churn prediction device 500 further includes a processing module;

[0122] A processing module, used for comparing the final churn probability with a preset threshold;

[0123] If the comparison result shows that the final churn probability is greater than or equal to the preset threshold, the merchant information of the merchant to be predicted corresponding to the final churn probability is sent to the account manager, and the account manager is urged to conduct a customer return visit.

[0124] In summary, the present application first obtains the dynamic transaction characteristics of a fixed time period corresponding to the merchant to be predicted. Among them, the dynamic transaction characteristics include the number and amount of daily transactions, daily payment tools, daily payment forms, and the number of days from the last transaction to the prediction date. Then, based on the trained LSTM time series model, the dynamic transaction characteristics are analyzed, and the first churn probability is obtained. Then, based on the trained XGboost model, the first churn probability and the static characteristics of the merchant to be predicted are analyzed, and the second churn probability is obtained. Finally, the second churn probability is used as the final churn probability of the merchant to be predicted, and is output. In this way, by combining the two models to analyze the dynamic transaction characteristics and static characteristics of the merchant, the accuracy of merchant churn prediction is improved.

[0125] In addition, the present application also provides a merchant churn prediction device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the merchant churn prediction methods described above when executing the computer program.

[0126] In addition, the present application also provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the merchant churn prediction method as described in any one of the above items are implemented.

[0127] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A merchant churn prediction method, characterized in that: The method comprises: Obtain dynamic transaction features of a fixed period corresponding to the merchant to be predicted; the dynamic transaction features include the number and amount of daily transactions, daily payment tools, daily payment methods, and the number of days from the last transaction to the prediction date; Analyze the dynamic transaction characteristics based on the trained LSTM time series model and obtain a first churn probability; Analyze the first churn probability and the static characteristics of the merchant to be predicted based on the trained XGboost model to obtain a second churn probability; The second churn probability is used as the final churn probability of the merchant to be predicted and outputted.

2. The method according to claim 1, characterized in that The obtaining of dynamic transaction characteristics of a fixed time period corresponding to the merchant to be predicted includes: Get the dynamic transaction characteristics of the merchant to be predicted within 180 days from the prediction date.

3. The method according to claim 1, characterized in that The LSTM time series model is trained by the following method: Build LSTM basic network model; Obtain dynamic transaction characteristics of a preset number of merchants in normal status over the past 180 days before the forecast period; Determine the merchant tags corresponding to each of the merchants in the normal state based on the preset business caliber representing the merchant loss and the dynamic transaction characteristics; the merchant tags include lost merchants and non-lost merchants; The LSTM basic network model is trained based on the merchant tag and the dynamic transaction feature, and an LSTM time series model is obtained.

4. The method according to claim 3, characterized in that The preset business criteria for representing merchant loss include: no merchant transactions within one month or merchant active withdrawal.

5. The method according to claim 3, characterized in that: The step of training the LSTM basic network model based on the merchant tag and the dynamic transaction feature and obtaining the LSTM time series model includes: Analyze the daily changes of the average values ​​of the dynamic transaction features of the different merchant tags within 180 days before the forecast period, and obtain the change trend; Fill the dynamic transaction features corresponding to each merchant with null values ​​and perform normalization processing to obtain normalized data of each dynamic transaction feature corresponding to each merchant; Divide the merchants into a training set and a validation set; the number of merchants in the training set with a merchant label of lost merchants is equal to the number of merchants with a merchant label of non-lost merchants; the number of merchants in the validation set with a merchant label of lost merchants is equal to the number of merchants with a merchant label of non-lost merchants; The LSTM basic network model is trained based on the training set and the normalized data of each dynamic transaction feature corresponding to each merchant in the training set, and is verified based on the validation set and the normalized data of each dynamic transaction feature corresponding to each merchant in the validation set during the training process to obtain an LSTM time series model.

6. The method according to claim 5, characterized in that The XGboost model is trained by the following method: Perform one-hot encoding on the static features corresponding to the merchants in the training set; Using the LSTM time series model to predict the churn of each merchant in the training set, and obtaining the predicted churn probability corresponding to each merchant; The XGboost parameters are searched by using a grid search method, and the XGboost model is trained based on the encoded static features and the predicted churn probability to obtain a trained XGboost model.

7. The method according to claim 1, characterized in that The method further comprises: Comparing the final churn probability with a preset threshold; If the comparison result shows that the final churn probability is greater than or equal to the preset threshold, the merchant information of the merchant to be predicted corresponding to the final churn probability is sent to the account manager, and the account manager is urged to conduct a customer return visit.

8. A merchant loss prediction device, characterized in that: include: An acquisition module is used to acquire dynamic transaction characteristics of a fixed period of time corresponding to the merchant to be predicted; The dynamic transaction characteristics include the number and amount of daily transactions, daily payment instruments, daily payment forms, and the number of days from the last transaction to the predicted date; A first analysis module, configured to analyze the dynamic transaction features based on a trained LSTM time series model and obtain a first churn probability; A second analysis module is used to analyze the first churn probability and the static characteristics of the merchant to be predicted based on the trained XGboost model, and obtain a second churn probability; An output module is used to use the second churn probability as the final churn probability of the merchant to be predicted and output it.

9. A merchant loss prediction device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the merchant churn prediction method according to any one of claims 1 to 7 when executing the computer program.

10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the merchant churn prediction method according to any one of claims 1 to 7 are implemented.