A method, device, equipment and storage medium for determining user churn rate
By introducing a user stability coefficient into the random forest model, and combining it with a logistic regression model and an improved random forest model, the problem of inaccurate prediction of periodic user churn rates in existing technologies is solved, and the accuracy of user churn rate prediction is improved. This method is applicable to scenarios such as catering, petroleum, and entertainment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA PETROLEUM & CHEMICAL CORP
- Filing Date
- 2022-12-29
- Publication Date
- 2026-07-14
AI Technical Summary
Existing customer churn prediction solutions have poor accuracy in industries with cyclical characteristics, failing to accurately identify peak periods and resulting in high customer churn rates.
Introducing a user stability coefficient into the random forest model, determining the user stability coefficient through a logistic regression model, and combining it with the improved random forest model to predict user churn rate, making it a linear result of user stability and churn.
It improves the accuracy of user churn prediction and is applicable to scenarios with cyclical consumption behaviors, such as catering, petroleum, and entertainment. By introducing a user stability coefficient parameter to improve the random forest model, the prediction accuracy is enhanced.
Smart Images

Figure CN116258516B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device, and storage medium for determining user churn rate. Background Technology
[0002] Existing solutions for predicting customer churn rate involve obtaining a churn prediction model. Based on this model and customers' historical consumption behavior, the churn rate is predicted for a period of time. However, this method has poor prediction accuracy for some industries with cyclical characteristics, and it cannot accurately grasp the expected peak period, which can easily lead to a high customer churn rate. Summary of the Invention
[0003] This application provides a method, apparatus, device, and storage medium for determining user churn rate. By introducing a user stability coefficient as a parameter into the existing random forest model, the model is improved. Based on the improved random forest model, the user churn rate is predicted, making the user churn rate a linear result of user stability and churn, thereby improving the accuracy of predicting the user churn rate.
[0004] In a first aspect, embodiments of this application also provide a method for determining user churn rate, the method comprising:
[0005] Acquire user feature data, logistic regression model, and improved random forest model;
[0006] The user stability coefficient is determined based on user characteristic data and a logistic regression model.
[0007] User churn rate is determined based on user characteristic data, user stability coefficient, and an improved random forest model;
[0008] The improved random forest model includes a user stability coefficient.
[0009] Optionally, before determining the user stability coefficient based on user characteristic data and a logistic regression model, embodiments of this application also provide a method comprising:
[0010] Preprocess user data feature data;
[0011] Preprocessing includes feature engineering, anomaly handling, and data warping.
[0012] In one example, determining the user stability coefficient based on user characteristic data and a logistic regression model includes:
[0013] The user feature data is trained using a logistic regression model to obtain the trained model parameters;
[0014] The user stability coefficient is determined based on user characteristic data and the parameters of the trained model.
[0015] In one example, determining the user stability coefficient based on user feature data and trained model parameters includes:
[0016] Based on user feature data and trained model parameters, the user stability coefficient is determined using the first formula.
[0017] The first formula includes:
[0018]
[0019] Where β0, β1, β2, ..., βd are the trained model parameters, and x1, x2, ..., xd are user feature data.
[0020] In one example, the determination of user churn rate based on user characteristic data, user stability coefficient, and an improved random forest model includes:
[0021] M classification results are determined based on user characteristic data and an improved random forest model;
[0022] Among them, the M classification results correspond one-to-one with the M decision trees contained in the improved random forest model, where M is an integer greater than 0;
[0023] The user churn rate is determined based on the user stability coefficient, M classification results, and an improved random forest model.
[0024] In one example, M classification outcomes are determined based on user feature data and an improved random forest model, including:
[0025] The improved random forest model is used to evaluate user feature data and identify user feature data that can be referenced.
[0026] The classification results are determined based on available user feature data and an improved random forest model.
[0027] In one example, the user churn rate is determined based on the user stability coefficient, M classification results, and an improved random forest model, including:
[0028] The user churn rate is determined based on the user stability coefficient, classification results, and the improved random forest algorithm included in the improved random forest model.
[0029] The improved random forest algorithm is implemented through a second formula, which includes:
[0030] User churn rate = (1-C)*m1 + C*m2
[0031] Where C represents the user stability coefficient, m1 represents the number of decision trees that are classified as churned, m2 represents the number of decision trees that are classified as not churned, and m1+m2=M.
[0032] Secondly, embodiments of this application also provide an apparatus for determining user churn rate, the apparatus comprising:
[0033] The acquisition module is used to acquire user feature data, a logistic regression model, and an improved random forest model;
[0034] The determination module is used to determine the user stability coefficient based on user characteristic data and a logistic regression model.
[0035] The determination module is also used to determine the user churn rate based on user characteristic data, user stability coefficient, and an improved random forest model;
[0036] The improved random forest model includes a user stability coefficient.
[0037] Thirdly, embodiments of this application also provide a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method for determining user churn rate as provided in any embodiment of this application.
[0038] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for determining user churn rate as provided in any embodiment of this application.
[0039] This application provides a method, apparatus, device, and storage medium for determining user churn rate. The method includes: acquiring user feature data, a logistic regression model, and an improved random forest model; determining a user stability coefficient based on the user feature data and the logistic regression model; and determining the user churn rate based on the user feature data, the user stability coefficient, and the improved random forest model. The improved random forest model includes the user stability coefficient. This solution improves the existing random forest model by introducing the user stability coefficient as a parameter. The improved random forest model is used to predict the user churn rate, making it a linear result of user stability and churn, thereby improving the accuracy of user churn rate prediction. Attached Figure Description
[0040] Figure 1 This is a flowchart of a method for determining user churn rate provided in an embodiment of this application;
[0041] Figure 2 This is a schematic diagram of a device structure for determining user churn rate provided in an embodiment of this application;
[0042] Figure 3 This is a schematic diagram of another device structure for determining user churn rate provided in an embodiment of this application;
[0043] Figure 4 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation
[0044] The present disclosure will be further described below with reference to the embodiments shown in the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the present application and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present application are shown in the drawings, not the entire structure.
[0045] Furthermore, in the embodiments of this application, terms such as "optionally" or "exemplarily" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "optionally" or "exemplarily" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "optionally" or "exemplarily" is intended to present the relevant concepts in a specific manner.
[0046] To facilitate a clearer understanding of the solutions provided in the embodiments of this application, the relevant concepts involved in the embodiments of this application are further explained in detail below:
[0047] One-Hot encoding, also known as one-bit valid encoding, primarily uses an N-bit state register to encode N states. Each state has an independent register bit, and only one bit is valid at any given time. One-Hot encoding is mainly used to represent categorical variables as binary vectors. Its encoding approach is to first map the categorical values to integer values, and then represent each integer value as a binary vector, with all integer indices marked as zero except for the indices, which are marked as 1.
[0048] In machine learning algorithms such as regression, classification, and clustering, calculating the distance or similarity between features is crucial. Common distance or similarity calculations are based on Euclidean space. The One-Hot encoding described above extends the values of discrete features to Euclidean space, where a value of a discrete feature corresponds to a point in Euclidean space. Using One-Hot encoding for discrete features makes the distance calculation between features more reasonable.
[0049] Figure 1This application provides a flowchart of a method for determining user churn rate. This method can be applied to scenarios with cyclical consumption behaviors, such as catering, petroleum, and entertainment. It improves existing random forest models by introducing a user stability coefficient as a parameter, and then predicts user churn rate based on the improved random forest model, thereby improving the accuracy of user churn rate prediction. This method can be executed by the device for determining user churn rate provided in this application, which can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated into a computer device, such as a server. The following embodiments will illustrate this using the integration of the device into a computer device as an example. Figure 1 As shown, the method may include, but is not limited to, the following steps:
[0050] S101. Obtain user feature data, logistic regression model, and improved random forest model.
[0051] The user characteristic data in this application embodiment may include user consumption behavior, recharge behavior, attribute characteristics, marketing behavior, etc. Specifically, taking the application scenario of a user refueling a car as an example, the above-mentioned consumption behavior may include the highest single refueling volume, the lowest single refueling volume, the average refueling volume, refueling frequency, refueling time interval, and the ratio of the refueling interval in the past month to the average refueling interval, etc. Recharge behavior may include the number of recharges, recharge amount, maximum single recharge amount, recharge interval, etc. Attribute characteristics may include whether the user is a member, membership number, gender, age, vehicle model, gas station preference, whether they are a corporate user, etc. Marketing behavior may include the number of times coupons are used, coupon amount, coupon usage ratio, etc. The above user characteristic data can be set according to different application scenarios, and this application embodiment will not provide detailed examples here.
[0052] The logistic regression model in this embodiment can be a model already available in the prior art, and its main function is to train model parameters. The improved random forest model mentioned above includes a user stability coefficient as a parameter. Specifically, the user stability coefficient can be included in the improved random forest algorithm contained in the model, and the user churn rate can be predicted based on the improved random forest model.
[0053] S102. Determine the user stability coefficient based on user characteristic data and logistic regression model.
[0054] For example, this step can be implemented by training the user feature data according to the logistic regression model to obtain the trained model parameters; then, the user stability coefficient is determined based on the user feature data and the trained model parameters.
[0055] For example, the model formula of the logistic regression model selected in the embodiments of this application may include:
[0056] logit=β0'+β1'x1+β2'x2+…+βd'xd
[0057] Where β0', β1', β2', ..., βd' are the model parameters of the logistic regression model, and x1, x2, ..., xd are the user feature data.
[0058] S103. Determine the user churn rate based on user characteristic data, user stability coefficient, and improved random forest model.
[0059] As is well known to those skilled in the art, a random forest model contains several decision trees; for example, suppose it contains M decision trees, where M is an integer greater than 0. Accordingly, this step can be designed to determine M classification results based on user feature data and the improved random forest model. These M classification results correspond one-to-one with the M decision trees in the improved random forest model, meaning each decision tree has one classification result. Then, the user churn rate is determined based on the determined user stability coefficient, the M classification results, and the improved random forest model.
[0060] This application provides a method for determining user churn rate. The method includes acquiring user feature data, a logistic regression model, and an improved random forest model; determining a user stability coefficient based on the user feature data and the logistic regression model; and determining the user churn rate based on the user feature data, the user stability coefficient, and the improved random forest model. The improved random forest model includes the user stability coefficient. This solution improves the existing random forest model by introducing the user stability coefficient as a parameter. The improved random forest model is used to predict the user churn rate, making it a linear result of user stability and churn rate, thereby improving the accuracy of user churn rate prediction.
[0061] In one example, prior to step S102 above, this embodiment of the application also provides an implementation method that includes preprocessing the aforementioned user feature data. This preprocessing may include feature engineering, outlier processing, and data warping. Specifically, feature engineering may include One-Hot encoding of textual features in the user data, that is, converting discrete textual labels (e.g., male, female, confidential) into discrete encoding forms (e.g., 100, 010, 001). Outlier processing may include handling missing values and outliers. Missing value handling includes deleting relevant data for a certain dimension if 80% of the data is missing, and filling in the missing values according to the preset business rules corresponding to that dimension. Outlier processing includes deleting duplicate values and outliers (e.g., negative age values). Data warping may include weight of evidence (WOE) transformation and sampling of the data.
[0062] It should be noted that the specific processing procedures of each of the above preprocessing steps can be set according to the actual situation, and the embodiments of this application do not limit this.
[0063] In one example, the implementation of determining the user stability coefficient based on user feature data and trained model parameters in step S102 above may include determining the user stability coefficient based on a first formula, using the user feature data and trained model parameters. The first formula may include...
[0064]
[0065] Where β0, β1, β2, ..., βd are the trained model parameters, and x1, x2, ..., xd are user feature data.
[0066] In one example, the implementation of step S103 above, which involves determining the classification result based on user feature data and the improved random forest model, may include evaluating the user feature data based on the information gain parameter included in the improved random forest model to determine the user feature data that can be referenced. For example, based on the business definition of whether users churn, and setting user churn as the target variable, or user stability as the target variable, the importance of various types of data in the user feature data may be evaluated based on the information gain parameter included in the improved random forest model, and several important data points may be selected as the user feature data that can be referenced. The classification result is then determined based on the determined user feature data and the improved random forest model.
[0067] In one example, step S103 above, which involves determining the user churn rate based on the determined user stability coefficient, M classification results, and the improved random forest model, may include: determining the user churn rate based on the user stability coefficient, classification results, and the improved random forest algorithm included in the improved random forest model. This improved random forest algorithm can be implemented using a second formula, which may include:
[0068] User churn rate = (1-C)*m1 + C*m2
[0069] Where C is the user stability coefficient, m1 represents the number of decision trees whose classification result is churn, m2 represents the number of decision trees whose classification result is not churn, and m1+m2=M.
[0070] The solution provided in this application can be applied to scenarios with periodic consumption, such as refueling a car. If a user only uses their vehicle on weekends, their refueling frequency is low, but this does not necessarily indicate user churn. Conversely, if a user refuels frequently during holidays due to travel needs, this does not necessarily indicate a low churn rate. Therefore, this application introduces a user stability coefficient into the traditional random forest algorithm, making the user churn rate a linear result of user stability and churn. Thus, if user stability is high, even with low refueling frequency, the number of decision trees classifying the user as not churning is high, leading to a low churn rate. Similarly, if user refueling frequency is high, the number of decision trees classifying the user as not churning is high, but the user stability coefficient is low, indicating that the decision tree voting results are unreliable, and the final result is biased towards user churn.
[0071] Figure 2 A schematic diagram of a device for determining user churn rate provided in an embodiment of this application is shown below. Figure 2 As shown, the device may include: an acquisition module 201 and a determination module 202;
[0072] The acquisition module is used to acquire user feature data, a logistic regression model, and an improved random forest model.
[0073] The determination module is used to determine the user stability coefficient based on user feature data and logistic regression model, and to determine the user churn rate based on user feature data, user stability coefficient and improved random forest model;
[0074] The improved random forest model includes a user stability coefficient.
[0075] like Figure 3 As shown, in one example, the above-described apparatus may further include a processing module 203;
[0076] This processing module is used to preprocess user data feature data, including feature engineering, anomaly data processing, and data warping.
[0077] In one example, the aforementioned determining module can be used to train user feature data based on a logistic regression model to obtain trained model parameters, and to determine user stability coefficients based on user feature data and trained model parameters.
[0078] Specifically, the module can determine the user stability coefficient based on the first formula, according to user feature data and trained model parameters;
[0079] The first formula includes:
[0080]
[0081] Where β0, β1, β2, ..., βd are the trained model parameters, and x1, x2, ..., xd are user feature data.
[0082] In one example, the determination module can also determine M classification results based on user feature data and an improved random forest model; and determine the user churn rate based on the user stability coefficient, the M classification results, and the improved random forest model.
[0083] Among them, the M classification results correspond one-to-one with the M decision trees contained in the improved random forest model, where M is an integer greater than 0;
[0084] In one example, the determination module can be used to evaluate user feature data based on the information gain parameter contained in the improved random forest model, determine referable user feature data, and determine the classification result based on the referable user feature data and the improved random forest model.
[0085] In one example, a determination module is used to determine the user churn rate based on the user stability coefficient, classification results, and the improved random forest algorithm contained in the improved random forest model;
[0086] The improved random forest algorithm is implemented through a second formula, which includes:
[0087] User churn rate = (1-C)*m1 + C*m2
[0088] Where C represents the user stability coefficient, m1 represents the number of decision trees that are classified as churned, m2 represents the number of decision trees that are classified as not churned, and m1+m2=M.
[0089] The aforementioned device for determining user churn rate can perform... Figure 1The provided method for determining user churn rate includes the corresponding devices and beneficial effects.
[0090] Figure 4 This application provides a schematic diagram of the structure of a computer device, as shown in the embodiment of the present application. Figure 4 As shown, the computer device includes a controller 401, a memory 402, an input device 403, and an output device 404; the number of controllers 401 in the computer device can be one or more. Figure 4 Taking a controller 401 as an example; the controller 401, memory 402, input device 403, and output device 404 in a computer device can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0091] Memory 402, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as... Figure 1 The program instructions / modules corresponding to the method for determining user churn rate in the embodiments (e.g., the acquisition module 201 and the determination module 202 in the device for determining user churn rate). The controller 401 executes various functions of the computer device and data processing by running the software programs, instructions, and modules stored in the memory 402, thereby implementing the above-described method for determining user churn rate.
[0092] The memory 402 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on computer usage. Furthermore, the memory 402 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, the memory 402 may further include memory remotely configured relative to the controller 401, which can be connected to a terminal / server via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0093] Input device 403 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the computer device. Output device 404 may include a display device such as a screen.
[0094] This application also provides a storage medium containing computer-executable instructions, which, when executed by a computer controller, are used to perform a method for determining user churn rate, the method including... Figure 1 The steps are shown.
[0095] Based on the above description of the implementation methods, those skilled in the art can clearly understand that this application can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0096] It is worth noting that the modules included in the above-mentioned device for determining user churn rate are only divided according to functional logic, but are not limited to the above division method. As long as the corresponding function can be achieved, it is acceptable and is not intended to limit the scope of protection of this application.
[0097] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the appended claims.
Claims
1. A method for determining user churn rate, characterized in that, The method includes: Acquire user feature data, logistic regression model, and improved random forest model; The user feature data is trained using the logistic regression model to obtain trained model parameters; based on the user feature data and the trained model parameters, a user stability coefficient is determined using a first formula; wherein the first formula includes: in, These are the parameters of the trained model. The user feature data is used as the basis for determining M classification results based on the user feature data and the improved random forest model. Each of the M classification results corresponds one-to-one with one of the M decision trees in the improved random forest model, where M is an integer greater than 0. The user churn rate is determined based on the user stability coefficient, the classification results, and the improved random forest algorithm included in the improved random forest model. The improved random forest algorithm is implemented using a second formula, which includes: User churn rate = (1-C)*m1 +C*m2 Where C represents the user stability coefficient, m1 represents the number of decision trees that are classified as churned, m2 represents the number of decision trees that are classified as not churned, and m1+m2=M; The improved random forest model includes the user stability coefficient.
2. The method according to claim 1, characterized in that, Before determining the user stability coefficient based on the user characteristic data and the logistic regression model, the method further includes: The user data feature data is preprocessed; The preprocessing includes feature engineering, anomaly data processing, and data regularization.
3. The method according to claim 1, characterized in that, The step of determining M classification results based on the user feature data and the improved random forest model includes: The user feature data is evaluated based on the information gain parameter contained in the improved random forest model to determine the user feature data that can be referenced. The classification results are determined based on the referenced user feature data and the improved random forest model.
4. A device for determining user churn rate, characterized in that, The device includes: The acquisition module is used to acquire user feature data, a logistic regression model, and an improved random forest model; The determination module is configured to train the user feature data according to the logistic regression model to obtain trained model parameters; and determine the user stability coefficient based on the user feature data and the trained model parameters using a first formula; wherein the first formula includes: in, These are the parameters of the trained model. The user characteristic data; The determining module is further configured to determine M classification results based on the user feature data and the improved random forest model; wherein the M classification results correspond one-to-one with the M decision trees included in the improved random forest model, and M is an integer greater than 0; and to determine the user churn rate based on the user stability coefficient, the classification results, and the improved random forest algorithm included in the improved random forest model; wherein the improved random forest algorithm is implemented by a second formula, the second formula including: User churn rate = (1-C)*m1 +C*m2 Where C represents the user stability coefficient, m1 represents the number of decision trees that are classified as churned, m2 represents the number of decision trees that are classified as not churned, and m1+m2=M; The improved random forest model includes the user stability coefficient.
5. A computer device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method for determining user churn rate as described in any one of claims 1-3.
6. A device-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method for determining user churn rate as described in any one of claims 1-3.