Customer churn warning method and device
By combining random forest and genetic algorithms, the customer churn type can be quickly and accurately determined, solving the problem of slow and low accuracy of customer churn warning in existing technologies and increasing the bank's revenue.
Patent Information
- Application Number
- CN202210982379.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-16
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-08-16
AI Technical Summary
Existing customer churn early warning methods are slow and inaccurate, resulting in increased revenue losses for banks.
A method combining random forest and genetic algorithm is adopted to classify and process the current customer feature vector, construct a fitness function, determine the historical customer target vector, and use the final power coefficient and multiple coefficient to provide customer churn type warning.
It improves the speed and accuracy of customer churn warning, reduces manual intervention, enhances the response speed to customer churn, and reduces the bank's income loss.
Smart Images

Figure CN115375357B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of customer churn warning, in particular to the field of artificial intelligence, and more particularly to a customer churn warning method and device. Background Art
[0002] Customer churn can lead to increased revenue losses for banks. Therefore, banks need to analyze current customers who are likely to churn and, based on the analysis results, issue early warnings to relevant staff so they can promptly retain these customers. However, existing customer churn early warning methods primarily rely on analysts manually analyzing current customers' information, determining their churn type (e.g., churn intention type or churn likelihood type), and generating early warning information to alert relevant staff. This early warning process requires analysts to spend a considerable amount of time compiling customer data, conducting appropriate analysis, and manually generating early warning information, resulting in a slow early warning process. Furthermore, because the determination of churn types during early warnings is often based on manual experience, customers identified as requiring early warnings may not have an intention to churn, or customers identified as not requiring early warnings may have a strong intention to churn, resulting in low early warning accuracy. In summary, existing technologies suffer from slow and inaccurate customer churn early warnings, resulting in low efficiency and ineffective customer retention strategies. This, in turn, leads to significant revenue losses for banks and hinders revenue growth. Summary of the Invention
[0003] One object of the present invention is to provide a customer churn early warning method to address the problem in the prior art of slow and inaccurate customer churn early warning, which results in low efficiency and hinders the retention of current customers, leading to significant revenue losses for the bank and hindering its revenue growth. Another object of the present invention is to provide a customer churn early warning device. A further object of the present invention is to provide a computer device. Yet another object of the present invention is to provide a readable medium.
[0004] In order to achieve the above objectives, one aspect of the present invention discloses a customer churn early warning method, the method comprising:
[0005] Classify the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector;
[0006] Obtaining weights of element types of vector elements based on a preset random forest, and determining a corresponding historical customer target vector based on the weights and a preset historical customer feature vector; constructing a corresponding fitness function based on the historical customer target vector; and performing genetic iteration based on the fitness function to determine a plurality of final power coefficients and final multiple coefficients of the corresponding historical customer target vector;
[0007] According to the classification value of the random forest and the current customer feature vector, it is determined whether the corresponding current customer is a customer who is about to churn. If so, the churn type of the current customer is determined based on the current customer feature vector, the final power coefficient and the final multiplication coefficient, and an early warning is issued based on the churn type.
[0008] Optionally, further including:
[0009] The vector elements of the current customer feature vector are classified according to the corresponding element values, and before obtaining the classification value corresponding to each vector element in the current customer feature vector,
[0010] Based on multiple preset customer authentication codes, corresponding initial historical customer information is obtained respectively;
[0011] Performing data cleaning, data extraction, and data standardization on the initial historical customer information to obtain intermediate historical customer information;
[0012] The intermediate historical customer information is subjected to feature vector quantization processing to obtain the historical customer feature vector.
[0013] Optionally, further including:
[0014] Before classifying the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector,
[0015] The preset current customer information is subjected to feature vectorization processing to obtain the current customer feature vector.
[0016] Optionally, the classifying the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector includes:
[0017] Based on the element value of the current customer feature vector, the element type of the corresponding vector element, and a plurality of different element value intervals corresponding to the preset element type, determining the belonging interval corresponding to the element value of each vector element of the current customer feature vector from the element value intervals;
[0018] Based on the attribution interval, a classification value of a corresponding vector element in the current customer feature vector is obtained.
[0019] Optionally, further including:
[0020] Before getting the weight of the element type of the vector element based on the preset random forest,
[0021] Classifying the vector elements of the historical customer feature vector according to corresponding element values to obtain a classification value corresponding to each vector element in the historical customer feature vector;
[0022] Segmenting and clustering all the historical customer feature vectors to obtain multiple historical sets;
[0023] Based on the plurality of historical customer feature vectors, the classification values of the historical customer feature vectors, and the corresponding historical churn labels in each of the historical sets, respectively constructing a decision tree corresponding to the historical set;
[0024] Based on the multiple decision trees, the random forest is formed.
[0025] Optionally, the classifying the vector elements of the historical customer feature vector according to corresponding element values to obtain the classification value corresponding to each vector element in the historical customer feature vector includes:
[0026] Based on the element value of the historical customer feature vector, the element type of the corresponding vector element, and a plurality of different element value intervals corresponding to the preset element type, determining the belonging interval corresponding to the element value of each vector element of the historical customer feature vector from the element value interval;
[0027] Based on the attribution interval, a classification value of a corresponding vector element in the historical customer feature vector is obtained.
[0028] Optionally, constructing a decision tree corresponding to each historical set based on the plurality of historical customer feature vectors, the classification values of the historical customer feature vectors, and the corresponding historical churn labels in each historical set includes:
[0029] Obtaining the complete information entropy of the historical set according to all the historical customer feature vectors and corresponding historical churn labels in the historical set; wherein the value of the historical churn label is a churned label or a non-churned label;
[0030] Obtaining the root conditional entropy of each element type in the historical set according to the historical churn labels and classification values of the vector elements corresponding to all the historical customer feature vectors in the historical set;
[0031] According to the complete information entropy and the root conditional entropy, a root information gain entropy corresponding to the element type in the historical set is obtained, and the element type with the largest root information gain entropy is used as a root node attribute to establish a root node of a decision tree of the historical set; based on each possible classification value of the root node attribute, a child node corresponding to each classification value is established respectively;
[0032] Repeat the step of establishing child nodes until no child nodes can be established to complete the construction of the decision tree, wherein the step of establishing child nodes includes:
[0033] According to the sub-classification value corresponding to each of the sub-nodes, determining a plurality of historical customer feature vectors having vector elements corresponding to the sub-classification value in the history set as sub-vectors of the sub-node;
[0034] Determining whether the historical churn labels corresponding to the subvectors of each of the child nodes are the same, and if so, treating the child nodes as leaf nodes; and determining, based on the leaf classification value corresponding to each leaf node, multiple historical customer feature vectors in the historical set having vector elements corresponding to the leaf classification value as leaf vectors of the leaf node;
[0035] If not, obtaining the sub-conditional entropy of each element type in the child node according to the historical loss labels and classification values of the vector elements corresponding to all the sub-vectors;
[0036] According to the complete information entropy and the sub-conditional entropy, the sub-information gain entropy corresponding to the element type is obtained, and the element type with the largest sub-information gain entropy is used as the child node attribute; and the child node of the next layer of the child node is established based on each classification value that the child node attribute can take.
[0037] Optionally, obtaining the complete information entropy of the historical set according to all the historical customer feature vectors and corresponding historical churn labels in the historical set includes:
[0038] According to all the historical customer feature vectors and the corresponding historical churn labels in the historical set, a first number of historical customer feature vectors whose historical churn labels are values of churned labels and a second number of historical customer feature vectors whose historical churn labels are values of not churned labels are obtained;
[0039] Obtaining a churn rate based on the first number and the total number of all historical customer feature vectors in the historical set;
[0040] Obtaining a non-churn rate based on the second number and the total number of all historical customer feature vectors in the historical set;
[0041] Based on the churn rate and the non-churn rate, a complete information entropy is obtained.
[0042] Optionally, obtaining the root conditional entropy of each element type in the historical set according to the historical churn labels and classification values of the vector elements corresponding to all the historical customer feature vectors in the historical set includes:
[0043] According to the classification value of the vector element, respectively obtaining the number of divisions of the vector elements with different classification values in the element type in the historical set;
[0044] Obtaining a division rate according to the number of divisions and the total number of all historical customer feature vectors in the historical set;
[0045] Using historical customer feature vectors corresponding to different classification values of the element type in the historical set as corresponding partitioning vectors, and obtaining partitioning information entropies corresponding to different classification values based on the partitioning vectors corresponding to different classification values of the element type in the historical set and historical churn labels corresponding to the partitioning vectors;
[0046] Based on the partition rates and partition information entropies corresponding to different classification values that the element type in the history set can take, the root conditional entropy of the element type is obtained.
[0047] Optionally, obtaining the sub-conditional entropy of each element type in the child node according to the historical churn labels and classification values of the vector elements corresponding to all the sub-vectors includes:
[0048] According to the classification values of the vector elements of the sub-vectors, respectively obtaining the number of sub-divisions of the vector elements with different classification values in the element type of the sub-vectors;
[0049] Obtaining a subdivision rate according to the subdivision quantity and the subvector quantity of the subvector;
[0050] Sub-vectors corresponding to different classification values in the element type are respectively used as corresponding sub-partition vectors, and based on the sub-partition vectors corresponding to different classification values in the element type and historical loss labels corresponding to the sub-partition vectors, sub-partition information entropy corresponding to the different classification values is obtained;
[0051] Based on the sub-division rates and sub-division information entropies corresponding to different classification values that the element type can take, the sub-conditional entropy of the element type is obtained.
[0052] Optionally, obtaining the weight of the element type of the vector element based on a preset random forest includes:
[0053] Based on the element type, determining the total number of nodes corresponding to child node attributes and root node attributes that are the same as the element type in each decision tree in the random forest;
[0054] The total number of nodes is used as the sub-weight of the decision tree corresponding to the element type, and the average of the sub-weights corresponding to all decision trees in the random forest is used as the weight of the element type.
[0055] Optionally, obtaining the weight of the element type of the vector element based on a preset random forest includes:
[0056] Based on the element type, determining the depth of a sub-node corresponding to a sub-node attribute having the same element type as that of each decision tree in the random forest;
[0057] Determine whether the root node attribute in the decision tree is the same as the element type; if not, obtain the sub-weight of the decision tree corresponding to the element type according to the depth; if so, obtain the sub-weight of the decision tree corresponding to the element type according to the depth, and add the sub-weight to the preset root weight to obtain the sub-weight of the decision tree corresponding to the element type;
[0058] The average value of the score weights corresponding to all decision trees in the random forest is used as the weight of the element type.
[0059] Optionally, determining a corresponding historical customer target vector based on the weight and a preset historical customer feature vector includes:
[0060] Determine whether the historical churn label of the historical customer feature vector is a churn label, and if so, use the historical customer feature vector as a candidate vector;
[0061] Based on the weights, determining a plurality of element types with the largest weights and a preset number of reserved elements as standard types;
[0062] According to the vector elements corresponding to the standard type in each candidate vector, a historical customer target vector corresponding to the candidate vector is determined.
[0063] Optionally, constructing a corresponding fitness function according to the historical customer target vector includes:
[0064] respectively setting a corresponding power coefficient variable and a multiple coefficient variable for each vector element in each of the historical customer target vectors;
[0065] Obtaining a sub-fitness parameter corresponding to each vector element based on the power coefficient variable, the multiple coefficient variable, and the element value of the corresponding vector element;
[0066] According to the sub-fitness parameter corresponding to each vector element, the fitness function of the corresponding historical customer target vector is constructed.
[0067] Optionally, performing genetic iteration based on the fitness function to determine a plurality of final power coefficients and final multiple coefficients corresponding to the historical customer target vector includes:
[0068] Randomly setting the initial power coefficient of each power coefficient variable and the initial multiple coefficient of each multiple coefficient variable in the fitness function, and repeatedly performing the genetic iteration step until all final power coefficients and final multiple coefficients of each fitness function are determined, the genetic iteration step comprising:
[0069] Based on all the fitness functions, obtaining the fitness of each corresponding historical customer target vector; based on the churn value corresponding to the historical churn label of the corresponding historical customer target vector and the fitness, obtaining a sub-fitting value corresponding to the historical customer target vector; and superimposing the sub-fitting values corresponding to all the historical customer target vectors to obtain a fitting value;
[0070] Determine whether the fitting value is less than or equal to a preset fitting threshold; if so, use the initial power coefficient of each power coefficient variable in the fitness function as the final power coefficient, and use the initial multiple coefficient of each multiple coefficient variable as the final multiple coefficient;
[0071] If not, repeat the crossover and mutation operations until all fitness functions are updated;
[0072] The crossover mutation operation includes:
[0073] Selecting an unupdated fitness function from all fitness functions as a current fitness function, and selecting multiple fitness functions from other fitness functions except the current fitness function as crossover operator functions;
[0074] According to the power coefficients of the corresponding power coefficient variables in the multiple crossover operator functions and a preset first random number, a power crossover operator of each corresponding power coefficient variable of the current fitness function is obtained; and according to the multiple coefficients of the corresponding multiple coefficient variables in the multiple crossover operator functions and the first random number, a multiple crossover operator of each corresponding multiple coefficient variable of the current fitness function is obtained;
[0075] According to the power crossover operator and the preset second random number, a corresponding power mutation operator is obtained; and according to the multiple crossover operator and the second random number, a corresponding multiple mutation operator is obtained;
[0076] The power mutation operator corresponding to each power coefficient variable of the current fitness function is used as the initial power coefficient of the power coefficient variable, and the multiple mutation operator corresponding to each multiple coefficient variable of the current fitness function is used as the initial multiple coefficient of the multiple coefficient variable to complete the update of the current fitness function.
[0077] Optionally, obtaining a sub-fitting value corresponding to the historical customer target vector based on the churn value corresponding to the historical churn label of the corresponding historical customer target vector and the fitness includes:
[0078] Subtracting the fitness from the loss value to obtain a fitness difference;
[0079] The square of the absolute value of the adaptation difference is taken as the sub-fitting value.
[0080] Optionally, judging whether the corresponding current customer is a customer about to churn based on the classification value of the random forest and the current customer feature vector, and if so, determining the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient, includes:
[0081] Determining a corresponding path in each decision tree of the random forest according to the classification value of the vector element of the current customer feature vector;
[0082] According to the path, obtaining a leaf node corresponding to the current customer feature vector in the decision tree;
[0083] Based on the historical churn labels corresponding to the leaf nodes corresponding to the current customer feature vector in each decision tree, determining a first number of decision trees to which leaf nodes corresponding to the historical churn labels with a value of churned labels belong, and a second number of decision trees to which leaf nodes corresponding to the historical churn labels with a value of not churned labels belong;
[0084] Determine whether the first decision quantity is greater than the second decision quantity; if so, determine the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient.
[0085] Optionally, determining the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient includes:
[0086] Substituting the element values of the vector elements of the current customer feature vector into the fitness function corresponding to each historical customer target vector, and obtaining the current customer fitness value corresponding to the historical customer target vector based on the final power coefficient and the final multiplication coefficient corresponding to the historical customer target vector in the fitness function;
[0087] Subtract the current customer fitness value from the churn value corresponding to the historical churn label of the historical customer target vector to obtain an initial closeness value, and take the absolute value of the initial closeness value to obtain a closeness difference value;
[0088] The churn type of the current customer is determined according to the historical churn label corresponding to the historical customer target vector with the smallest proximity difference.
[0089] Optionally, the step of correspondingly substituting the element values of the vector elements of the current customer feature vector into the fitness function corresponding to each historical customer target vector includes:
[0090] The element value of the vector element in the current customer feature vector is used to replace the element value in the sub-fitness parameter of the corresponding vector element in the fitness function.
[0091] In order to achieve the above objectives, another aspect of the present invention discloses a customer churn early warning device, the device comprising:
[0092] An element mapping module is used to classify the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector;
[0093] a fitness processing module configured to obtain weights of element types of vector elements based on a preset random forest, and determine a corresponding historical customer target vector based on the weights and a preset historical customer feature vector; construct a corresponding fitness function based on the historical customer target vector; and perform genetic iteration based on the fitness function to determine a plurality of final power coefficients and final multiple coefficients of the corresponding historical customer target vector;
[0094] An early warning module is used to determine whether the corresponding current customer is a customer who is about to churn based on the classification value of the random forest and the current customer feature vector. If so, the churn type of the current customer is determined based on the current customer feature vector, the final power coefficient and the final multiplication coefficient, and an early warning is issued based on the churn type.
[0095] The present invention also discloses a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the method described above is implemented when the processor executes the program.
[0096] The present invention also discloses a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.
[0097] The customer churn warning method and device provided by the present invention classifies the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector. It can map some vector elements in the current customer feature vector with an infinite value range to classification values with a finite value range, and the classification values can only take a finite number of values. Therefore, the subsequent steps related to random forest to determine the attribute type weight and whether the current customer is a customer about to churn can be implemented based on the classification values in the limited range, reducing the need for traversal and operations in the process of data processing and classification related to random forest. The number of data, thereby significantly improving the speed of overall customer churn warning; by obtaining the weight of the element type of the vector element based on the preset random forest, and determining the corresponding historical customer target vector based on the weight and the preset historical customer feature vector, the random forest can be used to have a strong resistance to the interference of missing data and unbalanced data in the sample, is not prone to overfitting, and thus effectively reduces the incidence of falling into local optimality during operation and processing, and has the characteristics of low computational complexity, to accurately and quickly determine the decisive role and influence of different vector element types in the feature vector on the overall feature, thereby facilitating the retention of only the elements that have an impact on the overall feature. The vector elements corresponding to the element type with the larger degree are used to determine the corresponding historical customer target vector as the basis for determining the customer churn type, further reducing the amount of data that needs to be traversed and operated, thereby indirectly improving the speed and accuracy of determining the customer churn type in subsequent steps, and thereby indirectly improving the speed and accuracy of overall customer churn warning. By constructing a corresponding fitness function based on the historical customer target vector and performing genetic iteration based on the fitness function to determine multiple final power coefficients and final multiplication coefficients corresponding to the historical customer target vector, it is possible to improve the relevant processing procedures of genetic iteration in the genetic algorithm, and construct a fitness function associated with historical customer characteristics based on the historical customer target vector that can fully reflect the historical customer characteristics and only retains vector elements with the greatest impact on the overall characteristics. The optimized genetic iteration process can more quickly and accurately find the optimal solution for the power coefficient variables and multiplication coefficient variables specifically set for the historical customer characteristics in the fitness function, and can ensure that the final power coefficient and final multiplication coefficient obtained as the optimal solution have a high degree of consistency with the historical customer characteristics, thereby improving the accuracy and speed of determining the current customer churn type based on the optimal solution in subsequent steps, thereby facilitating the improvement of the speed and accuracy of overall customer churn warning.By determining whether the corresponding current customer is about to churn based on the classification value of the random forest and the current customer feature vector, and if so, determining the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient, and issuing an early warning based on the churn type, the random forest can be used for a quick and accurate initial screening to filter out the feature vectors of current customers who will not churn in the future, retaining only the feature vectors of current customers who will churn or may churn in the future as the objects for determining the churn type, thereby effectively reducing the amount of customer information that needs to be processed and analyzed during subsequent early warnings and improving the overall early warning speed. Subsequently, based on the relevant principles of genetic algorithms and the characteristics of genetic algorithms that are suitable for processing quantitative features, the churn type of the current customer can be quickly and accurately determined with low computational complexity, thereby effectively improving the speed and accuracy of overall customer churn early warnings. Moreover, the overall steps of the customer churn early warning method can be implemented through relevant programs, algorithms, software, or applications, significantly reducing the degree of manual intervention required, thereby significantly improving the speed of early warnings, thereby improving the speed of customer retention responses based on early warnings, and more conducive to reducing customer losses and thus reducing revenue losses for banks. In summary, the customer churn warning method and device provided by the present invention can improve the speed and accuracy of customer churn warning, thereby improving the efficiency of customer churn warning, and further facilitating the corresponding retention of current customers of different churn types to increase the bank's income. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0099] Figure 1 A schematic diagram showing a process flow of a customer churn early warning method according to an embodiment of the present invention is shown;
[0100] Figure 2 A schematic diagram showing an exemplary decision tree according to an embodiment of the present invention is shown;
[0101] Figure 3 A schematic diagram showing an optional step of determining a historical customer target vector according to an embodiment of the present invention is shown;
[0102] Figure 4 A schematic diagram showing an optional step of determining whether a current customer is a customer who is about to churn is shown in an embodiment of the present invention;
[0103] Figure 5A schematic diagram showing an optional step of determining the churn type of a current customer according to an embodiment of the present invention is shown;
[0104] Figure 6 A schematic diagram of a module of a customer churn warning device according to an embodiment of the present invention is shown;
[0105] Figure 7 A schematic diagram showing the structure of a computer device suitable for implementing an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0106] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0107] The terms “first,” “second,” etc. used herein do not particularly refer to an order or sequence, nor are they used to limit the present invention. They are only used to distinguish elements or operations described with the same technical terms.
[0108] The words “include,” “including,” “have,” “contain,” etc. used in this document are open-ended terms, meaning including but not limited to.
[0109] As used herein, "and / or" includes any and all combinations of the items mentioned.
[0110] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of the present invention are in compliance with the relevant provisions of national laws and regulations.
[0111] The embodiment of the present invention discloses a customer churn early warning method, such as Figure 1 As shown, the method specifically includes the following steps:
[0112] S101: Classify the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector.
[0113] S102: Obtaining weights of element types of vector elements based on a preset random forest, and determining a corresponding historical customer target vector based on the weights and a preset historical customer feature vector; constructing a corresponding fitness function based on the historical customer target vector; and performing genetic iteration based on the fitness function to determine multiple final power coefficients and final multiple coefficients of the corresponding historical customer target vector.
[0114] S103: Determine whether the corresponding current customer is a customer who is about to churn based on the classification value of the random forest and the current customer feature vector. If so, determine the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient, and issue an early warning based on the churn type.
[0115] The random forest includes multiple decision trees and is associated with multiple preset historical customer feature vectors, classification values of each element in the historical customer feature vectors, and historical churn labels corresponding to the historical customer feature vectors.
[0116] Exemplarily, the specific implementation method of the warning based on the churn type can be determined by those skilled in the art according to actual conditions, and the embodiments of the present invention do not limit this. For example, for a current customer whose churn type is "strong churn intention", a warning message corresponding to the churn type such as "this customer has a strong churn intention, please ask the staff to retain this customer with the strongest retention efforts" is generated, and sent to the staff along with the relevant information of the current customer, so that the staff can retain the current customer with the strongest retention efforts (for example, giving the current customer high-value insurance, giving high-value financial subsidies and deposit interest, opening a priority channel for business processing within a preset time for the current customer, and giving the current customer high-value souvenirs at home and inviting the customer to dinner, etc.); for a current customer whose churn type is "relatively strong churn intention", a warning message corresponding to the churn type such as "this customer has a strong churn intention, please ask the staff to retain this customer with a strong retention effort" is generated, and sent to the staff along with the relevant information of the current customer. The system generates a warning message for each customer, which is sent to the staff along with the relevant information of the current customer, so that the staff can use strong retention efforts to retain the current customer (for example, giving the customer certain discounts in related services that require the customer to consume, giving the customer a small gift, waiving some business expenses such as labor costs, and contacting the customer by phone to apologize, etc.); for the current customer whose churn type is "average churn intention", a warning message corresponding to the churn type is generated, such as "This customer's churn intention is average, please use medium retention efforts to retain this customer." The warning message is sent to the staff along with the relevant information of the current customer, so that the staff can use medium retention efforts to retain the current customer (for example, contacting the customer to apologize via SMS and push notifications in the application, inviting the customer to participate in relevant promotional activities or welfare activities, and moderately increasing the customer's deposit interest, etc.). The specific method of issuing a warning based on the churn type may be, but is not limited to, determining the current customer's churn intention strength based on the churn type, and then issuing a warning to the staff accordingly based on the churn intention strength, so that the staff can use the corresponding retention method to retain the current customer.
[0117] Exemplarily, the element type of the vector element corresponds to the relevant attributes of the customer, including but not limited to gender (if the customer is an individual, it is the individual's gender; if it is a company, it is the chairman's gender or CEO's gender, etc.), customer level, account balance, loan balance, overdue balance, fund balance, insurance balance, number of recent transactions, number of recent complaints, recent average monthly salary or recent average transaction amount, etc. In an embodiment of the present invention, the element type of the vector element of the historical customer feature vector needs to be consistent with the element type of the vector element of the current customer feature vector. It should be noted that the element type of the vector element can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation.
[0118] The customer churn warning method and device provided by the present invention classifies the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector. It can map some vector elements in the current customer feature vector with an infinite value range to classification values with a finite value range, and the classification values can only take a finite number of values. Therefore, the subsequent steps related to random forest to determine the attribute type weight and whether the current customer is a customer about to churn can be implemented based on the classification values in the limited range, reducing the need for traversal and operations in the process of data processing and classification related to random forest. The number of data, thereby significantly improving the speed of overall customer churn warning; by obtaining the weight of the element type of the vector element based on the preset random forest, and determining the corresponding historical customer target vector based on the weight and the preset historical customer feature vector, the random forest can be used to have a strong resistance to the interference of missing data and unbalanced data in the sample, is not prone to overfitting, and thus effectively reduces the incidence of falling into local optimality during operation and processing, and has the characteristics of low computational complexity, to accurately and quickly determine the decisive role and influence of different vector element types in the feature vector on the overall feature, thereby facilitating the retention of only the elements that have an impact on the overall feature. The vector elements corresponding to the element type with the larger degree are used to determine the corresponding historical customer target vector as the basis for determining the customer churn type, further reducing the amount of data that needs to be traversed and operated, thereby indirectly improving the speed and accuracy of determining the customer churn type in subsequent steps, and thereby indirectly improving the speed and accuracy of overall customer churn warning. By constructing a corresponding fitness function based on the historical customer target vector and performing genetic iteration based on the fitness function to determine multiple final power coefficients and final multiplication coefficients corresponding to the historical customer target vector, it is possible to improve the relevant processing procedures of genetic iteration in the genetic algorithm, and construct a fitness function associated with historical customer characteristics based on the historical customer target vector that can fully reflect the historical customer characteristics and only retains vector elements with the greatest impact on the overall characteristics. The optimized genetic iteration process can more quickly and accurately find the optimal solution for the power coefficient variables and multiplication coefficient variables specifically set for the historical customer characteristics in the fitness function, and can ensure that the final power coefficient and final multiplication coefficient obtained as the optimal solution have a high degree of consistency with the historical customer characteristics, thereby improving the accuracy and speed of determining the current customer churn type based on the optimal solution in subsequent steps, thereby facilitating the improvement of the speed and accuracy of overall customer churn warning.By determining whether the corresponding current customer is about to churn based on the classification value of the random forest and the current customer feature vector, and if so, determining the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient, and issuing an early warning based on the churn type, the random forest can be used for a quick and accurate initial screening to filter out the feature vectors of current customers who will not churn in the future, retaining only the feature vectors of current customers who will churn or may churn in the future as the objects for determining the churn type, thereby effectively reducing the amount of customer information that needs to be processed and analyzed during subsequent early warnings and improving the overall early warning speed. Subsequently, based on the relevant principles of genetic algorithms and the characteristics of genetic algorithms that are suitable for processing quantitative features, the churn type of the current customer can be quickly and accurately determined with low computational complexity, thereby effectively improving the speed and accuracy of overall customer churn early warnings. Moreover, the overall steps of the customer churn early warning method can be implemented through relevant programs, algorithms, software, or applications, significantly reducing the degree of manual intervention required, thereby significantly improving the speed of early warnings, thereby improving the speed of customer retention responses based on early warnings, and more conducive to reducing customer losses and thus reducing revenue losses for banks. In summary, the customer churn warning method and device provided by the present invention can improve the speed and accuracy of customer churn warning, thereby improving the efficiency of customer churn warning, and further facilitating the corresponding retention of current customers of different churn types to increase the bank's income.
[0119] In an optional embodiment, further comprising:
[0120] The vector elements of the current customer feature vector are classified according to the corresponding element values, and before obtaining the classification value corresponding to each vector element in the current customer feature vector,
[0121] Based on multiple preset customer authentication codes, corresponding initial historical customer information is obtained respectively;
[0122] Performing data cleaning, data extraction, and data standardization on the initial historical customer information to obtain intermediate historical customer information;
[0123] The intermediate historical customer information is subjected to feature vector quantization processing to obtain the historical customer feature vector.
[0124] Exemplarily, the customer authentication code may be, but is not limited to, the customer's unified social credit code or organizational structure code.
[0125] For example, the data cleaning of the initial historical customer information may include, but is not limited to, replacing or deleting abnormal data in the historical customer information using cleaning methods such as spline interpolation and linear regression. The data extraction may include, but is not limited to, performing a dimensionality reduction operation on highly correlated variables. For example, if the initial historical customer information contains two variables, account balance and bank card balance, since the embodiment of the present invention does not focus on the bank card balance and the account balance and bank card balance are essentially the same and highly correlated, the bank card balance variable is deleted (so that subsequent related attributes and element types do not include the bank card balance) to complete the dimensionality reduction operation. The data standardization processing may include, but is not limited to, converting the relevant data into various appropriate formats. For example, for the relevant amount, its format is converted to a format with a granularity of two decimal places, such as converting the amount of 10,000 yuan into the amount of 10,000.00 yuan. It should be noted that the specific implementation method for performing data cleaning, data extraction, and data standardization on the initial historical customer information to obtain the intermediate historical customer information can be determined by those skilled in the art based on actual circumstances. The above description is only an example and does not constitute a limitation.
[0126] Exemplarily, the feature vectorization processing of the intermediate historical customer information to obtain the historical customer feature vector may be, but is not limited to, extracting corresponding features from each attribute information in the intermediate historical customer information to obtain vector elements of the corresponding attribute information, and then concatenating and integrating the respective vector elements to obtain the corresponding historical customer feature vector. Specifically, for attribute information whose attribute values are numbers, when determining the vector elements, the numerical attribute values may be directly determined as the corresponding vector elements, or the attribute values may be normalized to obtain the corresponding vector elements; and for attribute information whose attribute values are not numbers (e.g., text or characters), when determining the vector elements, the attribute information may be digitized to obtain the corresponding vectorized elements, or the digitized products may be normalized to obtain the corresponding vectorized elements. The digitization processing may be implemented by, but is not limited to, using a digital encoding (e.g., one-hot encoding) algorithm or processing against an ASCII code table. For attribute information whose attribute value is a category (e.g., customer level, gender, etc.), all possible categories of the attribute information can be encoded to obtain numbers corresponding to the categories, and the attribute value in the attribute information can be replaced with the corresponding number. For example, if the attribute information is gender information and the possible categories are male and female, the number 0 can be used to represent male and the number 1 can be used to represent female. It should be noted that the specific implementation method for performing feature vectorization processing on the intermediate historical customer information to obtain the historical customer feature vector can be determined by those skilled in the art based on actual circumstances. The above description is only an example and does not constitute a limitation.
[0127] For example, the acquisition and processing of historical customer information may be implemented through, but not limited to, a corresponding big data platform, such as, but not limited to, a Hadoop big data platform.
[0128] Through the above steps, it is possible to quickly and accurately convert historical customer information into a vector form that is easy to participate in calculations and processing on the basis of error correction and simplification of historical customer information, thereby making the operations of subsequent steps related calculations and processing (for example, constructing random forests based on historical customer feature vectors and performing genetic iterations, etc.) more concise, and effectively improving the speed of overall customer churn warning.
[0129] In an optional embodiment, further comprising:
[0130] Before classifying the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector,
[0131] The preset current customer information is subjected to feature vectorization processing to obtain the current customer feature vector.
[0132] Exemplarily, the specific implementation method of performing feature vector processing on the preset current customer information to obtain the current customer feature vector can refer to the description of the steps of performing feature vector processing on the intermediate historical customer information to obtain the historical customer feature vector in the embodiment of the present invention, which will not be repeated here.
[0133] Through the above steps, the current customer information can be quickly and accurately converted into a vector form that is easy to participate in calculations and processing, thereby making the operations of subsequent related calculations and processing (for example, determining whether the current customer is about to churn and specifically determining the type of churn based on the current customer feature vector) more concise, effectively improving the speed of overall customer churn warning.
[0134] In a preferred embodiment, before the preset current customer information is subjected to feature vector quantization processing, the current customer information is first subjected to data cleaning, data extraction and data standardization processing to correct errors and simplify the current customer information, so as to improve the accuracy of the generated current customer feature vector and make it more convenient to participate in calculation and processing.
[0135] In an optional embodiment, the classifying the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector includes:
[0136] Based on the element value of the current customer feature vector, the element type of the corresponding vector element, and a plurality of different element value intervals corresponding to the preset element type, determining the belonging interval corresponding to the element value of each vector element of the current customer feature vector from the element value intervals;
[0137] Based on the attribution interval, a classification value of a corresponding vector element in the current customer feature vector is obtained.
[0138] For example, the multiple different element value intervals corresponding to the element type can be determined by those skilled in the art based on actual conditions, and the embodiments of the present invention do not impose any restrictions on this. For example, for the numerical element type of account balance, the element value interval can be set to, but not limited to: [0, 100000), [100000, 500000), [500000, 1000000), and [1000000, +∞). For example, for the categorical element type, the element value interval can be set to the element value itself. For example, for the categorical element type of customer level, the three values can be "Bronze Customer", "Silver Customer", and "Gold Customer" (which can correspond to 0, 1, and 2 or other corresponding numbers after encoding), and the corresponding element value intervals can be set to "Bronze Customer", "Silver Customer", and "Gold Customer" (the corresponding encoded values can also be 0, 1, and 2 or other corresponding numbers).
[0139] Exemplarily, the determination of the belonging interval corresponding to the element value of each vector element of the current customer feature vector from the element value interval can be, but is not limited to, first obtaining multiple element value intervals of the element type to which the vector element belongs, and then determining the element value interval in which the element value of the vector element lies as the corresponding belonging interval. For example, an element in a current customer feature vector (assuming the corresponding element type is account balance) has an element value of 300,000, and it is known that the multiple element value intervals corresponding to the account balance are: [0, 100,000), [100,000, 500,000), [500,000, 1000,000), and [1000,000, +∞). Therefore, the interval corresponding to the element value 300,000 is [100,000, 500,000). Therefore, the belonging interval of the vector element of the current customer feature vector is determined to be [100,000, 500,000). It should be noted that the specific implementation method of determining the belonging interval corresponding to the element value of each vector element of the current customer feature vector from the element value interval based on the element value of the current customer feature vector, the element type of the corresponding vector element, and a plurality of different element value intervals corresponding to the preset element type can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation to this.
[0140] Exemplarily, the classification value of the corresponding vector element in the current customer feature vector is obtained based on the attribution interval. This can be determined by, but is not limited to, querying a predetermined correspondence relationship between the element value interval and the classification value, or by using the average of the upper limit and the lower limit of the attribution interval, or one of the two, as the classification value. For example, for a vector element of a certain account balance type in a current customer feature vector, whose attribution interval is [100000, 500000), then by querying the correspondence relationship between its element value interval and the classification value, it can be obtained that: the classification value corresponding to [0, 100000) is 0, the classification value corresponding to [100000, 500000) is 1, the classification value corresponding to [500000, 1000000) is 2, and the classification value corresponding to [1000000, +∞) is 3. Therefore, it can be seen that the classification value corresponding to this vector element in the current customer feature vector is 1. For another example, if a vector element of a certain gender type in a current customer feature vector has an attribute interval of 0 (corresponding to male), then its attribute interval can be directly used as the classification value, that is, the classification value is also 0. Setting classification values is mainly for element types with an infinite value range, such as account balances and average transaction amounts, so that the values of the corresponding elements in their vectors can be mapped to classification values of a finite set during the relevant processing process, and the classification values are used instead of the original true values for subsequent random forest-related processing. In this way, during the random forest-related processing, the decision trees of the random forest will not have to traverse too many branches and long paths due to the excessive number of possible values of the corresponding elements, which will make the relevant processing troublesome and time-consuming, or cause errors and jams.
[0141] Through the above steps, the specific basis for determining the classification value can be refined, so that the classification values corresponding to all vector elements in multiple feature vectors will not be contradictory or have low accuracy due to a large coverage, thereby improving the accuracy of the random forest processing steps based on the classification values in subsequent steps, and mapping the element values to simple classification values to participate in the random forest processing can make the random forest have a faster decision-making speed, thereby improving the speed of initial screening of current customers who are about to be lost based on the random forest, and thereby improving the speed of overall customer churn warning.
[0142] In an optional embodiment, further comprising:
[0143] Before getting the weight of the element type of the vector element based on the preset random forest,
[0144] Classifying the vector elements of the historical customer feature vector according to corresponding element values to obtain a classification value corresponding to each vector element in the historical customer feature vector;
[0145] Segmenting and clustering all the historical customer feature vectors to obtain multiple historical sets;
[0146] Based on the plurality of historical customer feature vectors, the classification values of the historical customer feature vectors, and the corresponding historical churn labels in each of the historical sets, respectively constructing a decision tree corresponding to the historical set;
[0147] Based on the multiple decision trees, the random forest is formed.
[0148] Exemplarily, the process of segmenting and clustering all of the historical customer feature vectors to obtain multiple historical sets may include, but is not limited to, selecting a portion of the historical customer feature vectors from all of the historical customer feature vectors for clustering to obtain one of the historical sets, and then clustering other portions of the historical customer feature vectors in the same manner to obtain other historical sets. The intersection of the multiple historical sets may or may not be a null value, preferably a null value. The historical customer feature vectors included in the union of the multiple historical sets may or may not include all of the historical customer feature vectors, preferably including all of the historical customer feature vectors. The segmentation and clustering steps include the following examples:
[0149] The total number of historical customer feature vectors is 1000. 300 historical customer feature vectors are selected from all of the historical customer feature vectors for clustering to obtain one historical set. Another 300 historical customer feature vectors are then selected from all of the historical customer feature vectors for clustering to obtain another historical set. Another 200 historical customer feature vectors are then selected from all of the historical customer feature vectors for clustering to obtain yet another historical set. Finally, the remaining 200 historical customer feature vectors are clustered to obtain a final historical set. In this way, four historical sets are obtained, and the intersection of these four historical sets is null. The historical customer feature vectors included in the union include all of the historical customer feature vectors.
[0150] Exemplarily, one history set corresponds to one decision tree.
[0151] Exemplarily, the random forest formed based on the multiple decision trees may include, but is not limited to, using the ensemble of the multiple decision trees as the random forest, wherein the multiple decision trees in the random forest are independent of each other and are not connected by paths. For example, if there are four history sets and four decision trees are formed accordingly, then the ensemble of the four decision trees is used as the corresponding random forest, wherein the random forest includes the four decision trees.
[0152] Through the above steps, all historical feature vector samples can be divided into multiple clusters (each cluster includes multiple corresponding feature vector samples), so as to lay the foundation for the subsequent generation of different multiple decision trees based on different clusters, and then lay the foundation for the subsequent formation of random forests. Then, the multiple feature vector samples and corresponding decision category labels required for building the decision tree are used as input to construct the corresponding decision tree, so that each decision tree constructed is complete, so that when the random forest composed of decision trees is used for related processing in the future, there will be no processing stagnation due to the lack of tree structure, which is more conducive to the smooth execution of the subsequent initial screening of the current customer feature vectors of the current customers who are about to be lost. Moreover, by forming a random forest through multiple decision trees, the subsequent initial screening step and the step of determining the weight can comprehensively consider the decision-making situation of multiple decision trees, reduce errors and thus improve the relevant accuracy.
[0153] In an optional embodiment, the classifying the vector elements of the historical customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the historical customer feature vector includes:
[0154] Based on the element value of the historical customer feature vector, the element type of the corresponding vector element, and a plurality of different element value intervals corresponding to the preset element type, determining the belonging interval corresponding to the element value of each vector element of the historical customer feature vector from the element value interval;
[0155] Based on the attribution interval, a classification value of a corresponding vector element in the historical customer feature vector is obtained.
[0156] Exemplarily, the specific implementation method of determining the belonging interval corresponding to the element value of each vector element of the historical customer feature vector from the element value interval based on the element value of the historical customer feature vector, the element type of the corresponding vector element, and the multiple different element value intervals corresponding to the preset element type, can refer to the description of determining the belonging interval corresponding to the element value of each vector element of the current customer feature vector from the element value interval based on the element value of the current customer feature vector, the element type of the corresponding vector element, and the multiple different element value intervals corresponding to the preset element type in the embodiment of the present invention, which will not be repeated here.
[0157] Exemplarily, the specific implementation method of obtaining the classification value of the corresponding vector element in the historical customer feature vector based on the attribution interval can refer to the description of obtaining the classification value of the corresponding vector element in the current customer feature vector based on the attribution interval in the embodiment of the present invention, which will not be repeated here.
[0158] By classifying the vector elements of the historical customer feature vector according to the corresponding element values, the classification value corresponding to each vector element in the historical customer feature vector is obtained. This ensures that when a decision tree and a random forest are subsequently constructed based on the classification values of a finite set space, there will not be too many related branches and paths. Therefore, the computational complexity of constructing the decision tree and the random forest can be reduced, thereby speeding up the construction speed. The probability of errors occurring during the construction process is also reduced, thereby improving the accuracy of the random forest finally obtained, which can help improve the speed and accuracy of the overall customer churn warning.
[0159] In an optional embodiment, constructing a decision tree corresponding to each historical set based on the plurality of historical customer feature vectors, the classification values of the historical customer feature vectors, and the corresponding historical churn labels in each historical set includes:
[0160] Obtaining the complete information entropy of the historical set according to all the historical customer feature vectors and corresponding historical churn labels in the historical set; wherein the value of the historical churn label is a churned label or a non-churned label;
[0161] Obtaining the root conditional entropy of each element type in the historical set according to the historical churn labels and classification values of the vector elements corresponding to all the historical customer feature vectors in the historical set;
[0162] According to the complete information entropy and the root conditional entropy, a root information gain entropy corresponding to the element type in the historical set is obtained, and the element type with the largest root information gain entropy is used as a root node attribute to establish a root node of a decision tree of the historical set; based on each possible classification value of the root node attribute, a child node corresponding to each classification value is established respectively;
[0163] Repeat the step of establishing child nodes until no child nodes can be established to complete the construction of the decision tree, wherein the step of establishing child nodes includes:
[0164] According to the sub-classification value corresponding to each of the sub-nodes, determining a plurality of historical customer feature vectors having vector elements corresponding to the sub-classification value in the history set as sub-vectors of the sub-node;
[0165] Determining whether the historical churn labels corresponding to the subvectors of each of the child nodes are the same, and if so, treating the child nodes as leaf nodes; and determining, based on the leaf classification value corresponding to each leaf node, multiple historical customer feature vectors in the historical set having vector elements corresponding to the leaf classification value as leaf vectors of the leaf node;
[0166] If not, obtaining the sub-conditional entropy of each element type in the child node according to the historical loss labels and classification values of the vector elements corresponding to all the sub-vectors;
[0167] According to the complete information entropy and the sub-conditional entropy, the sub-information gain entropy corresponding to the element type is obtained, and the element type with the largest sub-information gain entropy is used as the child node attribute; and the child node of the next layer of the child node is established based on each classification value that the child node attribute can take.
[0168] Exemplarily, obtaining the root information gain entropy corresponding to the element type in the historical set based on the complete information entropy and the root conditional entropy is performed by subtracting the root conditional entropy from the complete information entropy to obtain the root information gain entropy. The vector range on which the complete information entropy is based is all historical customer feature vectors in a historical set (the current historical set). Similarly, the root conditional entropy is the root conditional entropy for a certain element type in the current historical set.
[0169] For example, establishing the root node of a decision tree based on the root node attributes is a conventional technical means in this field and will not be described in detail here. Figure 2 As shown in the figure, if the element type with the largest root information entropy is customer level, then customer level is used as the root node attribute to establish the root node of the decision tree - node 1.
[0170] Exemplarily, based on each possible classification value of the root node attribute, a child node corresponding to each classification value is established, as follows:
[0171] like Figure 2 As shown, node 1 is the root node, and its root node attribute is customer level. At this time, it is known that the element of customer level can take three classification values: 0, 1, and 2 (0 corresponds to a bronze customer, 1 corresponds to a silver customer, and 2 corresponds to a gold customer). Therefore, three paths are extended from the root node, and each path is provided with a child node at one end away from the root node. The classification value (sub-classification value) corresponding to each child node is different. For example, the sub-classification value corresponding to node 2 as a child node is 0, the sub-classification value corresponding to node 3 is 1, and the sub-classification value corresponding to node 4 is 2. It should be noted that the specific implementation method of establishing a child node corresponding to each classification value based on each possible classification value of the root node attribute can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation to this.
[0172] Exemplarily, according to the sub-classification value corresponding to each of the sub-nodes, determining multiple historical customer feature vectors having vector elements corresponding to the sub-classification value in the history set as sub-vectors of the sub-node, there are the following examples:
[0173] For node 2, its corresponding sub-classification value is 0, and among all the historical customer feature vectors in the current historical set, the historical customer feature vectors whose vector elements corresponding to the element type "customer level" have a classification value of 0 (that is, the historical customer feature vectors whose elements representing "customer level" in the vector have a classification value of 0) are A, B and C, then A, B and C are determined as sub-vectors of node 2.
[0174] For node 3, its corresponding sub-classification value is 1, and among all historical customer feature vectors, the historical customer feature vectors whose classification values of the vector elements corresponding to the element type "customer level" are 1 are Ding, Wu and Ji, so Ding, Wu and Ji are determined as sub-vectors of node 3.
[0175] For node 4, its corresponding sub-classification value is 2. Among all historical customer feature vectors, the historical customer feature vectors with classification values of 2 corresponding to the vector elements of element type "customer level" are Geng, Xin, Ren and Gui. Therefore, Geng, Xin, Ren and Gui are determined as sub-vectors of node 4.
[0176] It should be noted that the specific implementation method of determining, according to the sub-classification value corresponding to each of the sub-nodes, multiple historical customer feature vectors having vector elements corresponding to the sub-classification value in the historical set as sub-vectors of the sub-node can be determined by those skilled in the art based on actual conditions. The above description is only an example and does not constitute a limitation to this.
[0177] Exemplarily, the process of determining whether the historical churn labels corresponding to the subvectors of each of the child nodes are the same, and if so, treating the child nodes as leaf nodes; and determining, based on the leaf classification value corresponding to each leaf node, multiple historical customer feature vectors in the historical set having vector elements corresponding to the leaf classification value as leaf vectors of the leaf node, may include the following examples:
[0178] The sub-vectors of node 2 are A, B, and C. Among them, the historical loss labels corresponding to A, B, and C are all lost labels. It can be seen that the historical loss labels of the sub-vectors of node 2 are all the same. In this case, node 2 is regarded as a leaf node, and its corresponding leaf classification value is 0. The corresponding leaf vectors are A, B, and C.
[0179] It should be noted that, for respectively judging whether the historical churn labels corresponding to the sub-vectors of each of the sub-nodes are the same, if so, the sub-nodes are regarded as leaf nodes; according to the leaf classification value corresponding to each leaf node, determining that multiple historical customer feature vectors having vector elements corresponding to the leaf classification value in the historical set are the leaf vectors of the leaf node. The specific implementation method can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation to this.
[0180] Exemplarily, the sub-conditional entropy for each element type in the child node is obtained based on the historical churn labels and classification values of the vector elements corresponding to all the sub-vectors. This means that the conditional entropy is calculated for all sub-vectors corresponding to the current node (for example, for node 3, all its sub-vectors are Ding, Wu, and Ji), rather than for all historical customer feature vectors in the current historical set. Therefore, the sub-conditional entropy is not equivalent to the root conditional entropy. The principle of calculating the sub-conditional entropy is the same as that of calculating the root conditional entropy, and both are calculated using standard conditional entropy calculation methods and formulas.
[0181] Exemplarily, the sub-information gain entropy corresponding to the element type is obtained according to the complete information entropy and the sub-conditional entropy, and the element type with the largest sub-information gain entropy is used as the child node attribute; the specific implementation method of establishing the child node of the next layer of the child node based on each classification value that the child node attribute can take can refer to the embodiment of the present invention for obtaining the root information gain entropy corresponding to the element type in the historical set according to the complete information entropy and the root conditional entropy, and establishing the root node of the decision tree of the historical set with the element type with the largest root information gain entropy as the root node attribute; based on each classification value that the root node attribute can take, the steps of establishing the child node corresponding to each classification value are respectively described, which will not be repeated here.
[0182] For example, Figure 2 As shown, if the child node attribute of node 3 is the number of recent transactions, and its corresponding possible classification values are 10 and 11 respectively (10 corresponds to a recent transaction number greater than 50, and 11 corresponds to a recent transaction number less than or equal to 50), then node 5 with a classification value of 10 and node 6 with a classification value of 11 are established respectively. Similarly, if the child node attribute of node 4 is the number of recent complaints, and its corresponding possible classification values are 20 and 21 respectively (20 corresponds to a recent complaint number greater than 5, and 21 corresponds to a recent complaint number less than or equal to 5), then node 7 with a classification value of 20 and node 8 with a classification value of 21 are established respectively. And if the classification values corresponding to the historical customer feature vectors contained in nodes 5, 6, 7, and 8 are all consistent, then nodes 5, 6, 7, and 8 are determined to be leaf nodes.
[0183] It should be noted that the specific implementation of each step of constructing the decision tree can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation thereto.
[0184] Through the above steps, a decision tree can be constructed using the standard ID3 decision tree method. Since the structure and parameters of ID3 decision trees are not complex, the ID3 decision tree can be used to initially screen for current customers who are about to churn, resulting in faster processing and calculation speeds, thereby improving the overall speed of customer churn warning. Furthermore, the steps required to construct an ID3 decision tree are also not complex, so the decision tree construction speed is also relatively fast, which indirectly improves the overall speed of customer churn warning.
[0185] In an optional embodiment, obtaining the complete information entropy of the historical set based on all the historical customer feature vectors and corresponding historical churn labels in the historical set includes:
[0186] According to all the historical customer feature vectors and the corresponding historical churn labels in the historical set, a first number of historical customer feature vectors whose historical churn labels are values of churned labels and a second number of historical customer feature vectors whose historical churn labels are values of not churned labels are obtained;
[0187] Obtaining a churn rate based on the first number and the total number of all historical customer feature vectors in the historical set;
[0188] Obtaining a non-churn rate based on the second number and the total number of all historical customer feature vectors in the historical set;
[0189] Based on the churn rate and the non-churn rate, a complete information entropy is obtained.
[0190] Exemplarily, obtaining the churn rate based on the first number and the total number of all historical customer feature vectors in the historical set is performed by dividing the first number by the total number of all historical customer feature vectors in the current historical set to obtain the churn rate.
[0191] Exemplarily, obtaining the non-churn rate based on the second number and the total number of all historical customer feature vectors in the historical set is to obtain the non-churn rate by dividing the second number by the total number of all historical customer feature vectors in the current historical set.
[0192] Exemplarily, the complete information entropy obtained based on the churn rate and the non-churn rate can be expressed as follows:
[0193]
[0194] Where H(p) represents the complete information entropy of the current history set, p i When i=1, it represents the churn rate corresponding to the historical customer feature vector in the current historical set, and p iWhen i=2, it represents the non-churn rate corresponding to the historical customer feature vector. The specific value of the historical churn label for each historical customer feature vector can be manually set by relevant staff based on relevant historical circumstances. It should be noted that the specific implementation method for obtaining the complete information entropy based on the churn rate and non-churn rate can be determined by those skilled in the art based on actual circumstances. The above description is only an example and does not constitute a limitation.
[0195] Through the above steps, the complete information entropy can be determined using the standard information entropy method, thereby improving the accuracy of the obtained complete information entropy, and further improving the accuracy of the decision tree constructed in the subsequent steps and the related processing based on the decision tree, thereby improving the accuracy of the overall customer churn prediction.
[0196] In an optional embodiment, obtaining the root conditional entropy of each element type in the historical set according to the historical churn labels and classification values of the vector elements corresponding to all the historical customer feature vectors in the historical set includes:
[0197] According to the classification value of the vector element, respectively obtaining the number of divisions of the vector elements with different classification values in the element type in the historical set;
[0198] Obtaining a division rate according to the number of divisions and the total number of all historical customer feature vectors in the historical set;
[0199] Using historical customer feature vectors corresponding to different classification values of the element type in the historical set as corresponding partitioning vectors, and obtaining partitioning information entropies corresponding to different classification values based on the partitioning vectors corresponding to different classification values of the element type in the historical set and historical churn labels corresponding to the partitioning vectors;
[0200] Based on the partition rates and partition information entropies corresponding to different classification values that the element type in the history set can take, the root conditional entropy of the element type is obtained.
[0201] Exemplarily, the number of partitions of vector elements with different classification values in the element type is the number of historical customer feature vectors with different classification values for a certain element type. For example, if the element type is customer grade, in the current historical collection, there are 2,000 historical customer feature vectors with a customer grade element classification value of 0, 3,000 historical customer feature vectors with a customer grade element classification value of 1, and 5,000 historical customer feature vectors with a customer grade element classification value of 2. Therefore, for the element type of customer grade, the number of partitions with a classification value of 0 is 2,000, the number of partitions with a classification value of 1 is 3,000, and the number of partitions with a classification value of 2 is 5,000.
[0202] Exemplarily, the division rate is obtained based on the number of divisions and the total number of all historical customer feature vectors in the historical set. Specifically, the division rate is obtained by dividing the number of divisions by the total number. For example, for the element type of customer grade, the number of divisions with a classification value of 0 is 2000, and the total number is 10000, then the division rate is 2000 / 10000=20%.
[0203] Exemplarily, based on the partitioning vectors corresponding to different classification values in the element type in the historical set and the historical churn labels corresponding to the partitioning vectors, the specific principles of obtaining the partitioning information entropy corresponding to different classification values can refer to the description of the steps for calculating the complete information entropy in the embodiment of the present invention, which will not be repeated here. The only difference is that when calculating the partitioning information entropy, the range is all the partitioning vectors corresponding to a certain classification value in the current historical set, while when calculating the complete information entropy, the range is all the historical customer feature vectors in the current historical set.
[0204] Exemplarily, the root conditional entropy of the element type is obtained based on the partitioning rates and partitioning information entropies corresponding to different classification values that the element type in the history set can take, which can be expressed as the following formula:
[0205]
[0206] Among them, H(Y|X) represents the root conditional entropy corresponding to the element type, p i H(Y|X=X) i ) represents the partition information entropy corresponding to the element type X when it takes a certain classification value Xi. Here, one element type corresponds to one root conditional entropy. It should be noted that the specific implementation method for obtaining the root conditional entropy of the element type based on the partition ratio and partition information entropy corresponding to the different classification values that the element type in the historical set can take can be determined by those skilled in the art based on actual circumstances. The above description is only for example and does not constitute a limitation thereto.
[0207] Through the above steps, the root conditional entropy of each element type can be obtained using the standard method of calculating conditional entropy, so that the obtained root conditional entropy has a higher accuracy, thereby improving the accuracy of the decision tree constructed in the subsequent steps and the related processing based on the decision tree, and improving the accuracy of the overall customer churn warning.
[0208] In an optional embodiment, obtaining the sub-conditional entropy of each element type in the child node according to the historical loss labels and classification values of the vector elements corresponding to all the sub-vectors includes:
[0209] According to the classification values of the vector elements of the sub-vectors, respectively obtaining the number of sub-divisions of the vector elements with different classification values in the element type of the sub-vectors;
[0210] Obtaining a subdivision rate according to the subdivision quantity and the subvector quantity of the subvector;
[0211] Sub-vectors corresponding to different classification values in the element type are respectively used as corresponding sub-partition vectors, and based on the sub-partition vectors corresponding to different classification values in the element type and historical loss labels corresponding to the sub-partition vectors, sub-partition information entropy corresponding to the different classification values is obtained;
[0212] Based on the sub-division rates and sub-division information entropies corresponding to different classification values that the element type can take, the sub-conditional entropy of the element type is obtained.
[0213] Exemplarily, the specific principle of obtaining the number of sub-divisions of the vector elements with different classification values in the element type of the sub-vector according to the classification values of the vector elements of the sub-vector can be referred to the description of the steps of obtaining the number of divisions of the vector elements with different classification values in the element type in the historical set according to the classification values of the vector elements in the embodiments of the present invention, which will not be repeated here.
[0214] Exemplarily, the specific principle of obtaining the sub-division rate based on the number of sub-divisions and the number of sub-vectors of the sub-vector can be referred to the description of the steps of obtaining the division rate based on the number of divisions and the total number of all historical customer feature vectors in the historical set in the embodiment of the present invention, and will not be repeated here.
[0215] Exemplarily, the specific principle of respectively taking the sub-vectors corresponding to different classification values in the element type as corresponding sub-partitioning vectors, and obtaining the sub-partitioning information entropy corresponding to different classification values based on the sub-partitioning vectors corresponding to different classification values in the element type and the historical churn labels corresponding to the sub-partitioning vectors, can refer to the description of the steps of respectively taking the historical customer feature vectors corresponding to different classification values in the element type in the historical set as corresponding partitioning vectors, and obtaining the partitioning information entropy corresponding to different classification values based on the partitioning vectors corresponding to different classification values in the element type in the historical set and the historical churn labels corresponding to the partitioning vectors in the embodiment of the present invention, which will not be repeated here.
[0216] Exemplarily, the specific principle of obtaining the sub-conditional entropy of the element type based on the sub-division rate and sub-division information entropy corresponding to the different classification values that the element type can take can refer to the description of the steps of obtaining the root conditional entropy of the element type based on the division rate and division information entropy corresponding to the different classification values that the element type can take in the historical set in the embodiment of the present invention, which will not be repeated here.
[0217] Through the above steps, the sub-conditional entropy of each element type in a specific child node can be obtained by using the standard method of calculating conditional entropy, so that the obtained sub-conditional entropy has a higher accuracy, thereby improving the accuracy of the decision tree constructed in the subsequent steps and the related processing based on the decision tree, and improving the accuracy of the overall warning.
[0218] In an optional embodiment, obtaining the weight of the element type of the vector element based on the preset random forest includes:
[0219] Based on the element type, determining the total number of nodes corresponding to child node attributes and root node attributes that are the same as the element type in each decision tree in the random forest;
[0220] The total number of nodes is used as the sub-weight of the decision tree corresponding to the element type, and the average of the sub-weights corresponding to all decision trees in the random forest is used as the weight of the element type.
[0221] Exemplarily, based on the element type, the total number of nodes corresponding to the child node attributes and root node attributes of each decision tree in the random forest with the same element type is determined, and the total number of nodes is used as the sub-weight of the decision tree corresponding to the element type. This can be, but is not limited to, taking each decision tree as a separate calculation object, traversing the root node and all child nodes in the decision tree and obtaining the node attributes corresponding to each node, determining the number of nodes belonging to the node attributes with the same element type as the total number of nodes corresponding to the current decision tree, and using the total number of nodes as the sub-weight of the decision tree corresponding to the element type. For example, for a certain element type "customer level", in a corresponding decision tree A, the number of child nodes with the node attribute of "customer level" is 2, and the node attribute of the root node is also "customer level". Therefore, the above-mentioned total number of nodes of decision tree A is 3, and the sub-weight of the element type "customer level" of decision tree A is also 3. It should be noted that the specific implementation of determining the total number of nodes corresponding to the child node attributes and root node attributes of the same element type in each decision tree in the random forest based on the element type and using the total number of nodes as the sub-weight of the decision tree corresponding to the element type can be determined by those skilled in the art based on actual circumstances. The above description is only an example and does not constitute a limitation. For each element type, one decision tree corresponds to one sub-weight.
[0222] Exemplarily, the average value of the weights corresponding to all decision trees in the random forest is used as the weight of the element type. Examples are as follows:
[0223] In a random forest, there are decision trees A, B, C, and D. For the element type "customer level," the weight of the score determined by decision tree A is 3, the weight of the score determined by decision tree B is 5, the weight of the score determined by decision tree C is 4, and the weight of the score determined by decision tree D is 8. The average value is (3 + 5 + 4 + 8) / 4 = 5, so the weight of the element type "customer level" is 5.
[0224] It should be noted that the specific implementation method of using the average value of the sub-weights corresponding to all decision trees in the random forest as the weight of the element type can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation to this.
[0225] Since the number of nodes to which the node attribute corresponding to the element type belongs is one of the parameters in the decision tree that mainly reflects the degree of influence of the element type on the overall vector characteristics, the above steps can make the determined sub-weight consistent with and positively correlated with the degree of influence of the corresponding element type on the overall vector characteristics, thereby improving the accuracy of the determined sub-weight. In a random forest, since there are multiple decision trees and each of the decision trees has a corresponding sub-weight, and the multiple decision trees are established based on different historical sets (including historical customer feature vectors), the weight of the corresponding element type is obtained by taking the average value based on the multiple sub-weights in the above steps. This can reduce errors and further improve the accuracy of the determined weights based on comprehensive and full consideration of a large number of different historical samples, thereby improving the accuracy of the subsequent steps in determining the historical customer target vector based on the weights and the accuracy of the subsequent customer churn warning.
[0226] In an optional embodiment, obtaining the weight of the element type of the vector element based on the preset random forest includes:
[0227] Based on the element type, determining the depth of a sub-node corresponding to a sub-node attribute having the same element type as that of each decision tree in the random forest;
[0228] Determine whether the root node attribute in the decision tree is the same as the element type; if not, obtain the sub-weight of the decision tree corresponding to the element type according to the depth; if so, obtain the sub-weight of the decision tree corresponding to the element type according to the depth, and add the sub-weight to the preset root weight to obtain the sub-weight of the decision tree corresponding to the element type;
[0229] The average value of the score weights corresponding to all decision trees in the random forest is used as the weight of the element type.
[0230] Exemplarily, based on the element type, determining the depth of the child node corresponding to the child node attribute with the same element type in each decision tree in the random forest can be, but is not limited to, taking each decision tree as a separate calculation object, and determining the path length from the root node to each child node belonging to the child node attribute with the same element type in the decision tree as the depth of the corresponding child node, wherein determining the path length between the child node and the root node is a conventional technical means in the art and will not be repeated here. For example, in Figure 2 In the decision tree shown, the path length between node 3 and root node 1 is 1, and the path length between node 6 and root node 1 is 2.
[0231] Exemplarily, the weight of the element type obtained according to the depth can be obtained by, but is not limited to, subtracting the height of the decision tree (the path length from the node with the greatest depth in the decision tree to the root node) from the depth of each child node corresponding to the child node attribute with the same element type in the decision tree to obtain the relative sub-weight of each child node, and superimposing or averaging the relative sub-weight of each child node to obtain the sub-weight of the element type corresponding to the decision tree. It should be noted that the specific implementation method for obtaining the sub-weight of the element type corresponding to the decision tree according to the depth can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation thereto.
[0232] Exemplarily, the specific implementation method of obtaining the sub-weight of the decision tree corresponding to the element type according to the depth can refer to the description of the steps of obtaining the sub-weight of the decision tree corresponding to the element type according to the depth in the embodiment of the present invention, which will not be repeated here.
[0233] For example, the specific value of the root weight can be determined by those skilled in the art according to actual conditions, and the embodiment of the present invention does not limit this. For example, the root weight can be set to but not limited to 5, 6 or 10, etc.
[0234] Exemplarily, the average value of the score weights corresponding to all decision trees in the random forest is used as the weight of the element type. For example, reference can be made to the description of the embodiment of the present invention above on using the average value of the score weights corresponding to all decision trees in the random forest as the weight of the element type, which will not be repeated here.
[0235] Since the depth of the node to which the node attribute corresponding to the element type belongs is one of the parameters in the decision tree that mainly reflects the degree of influence of the element type on the overall vector feature, the above steps can make the determined sub-weight consistent with and positively correlated with the degree of influence of the corresponding element type on the overall vector feature, thereby improving the accuracy of the determined sub-weight. Moreover, when the root node attribute in the decision tree is the same as the element type, it means that the degree of influence of the element type on the overall vector feature has additional additional strength. Therefore, when it is determined that the root node attribute in the decision tree is the same as the element type, the sub-weight of the element type is obtained according to the depth. It is reasonable to add the sub-weight to the preset root weight to obtain the sub-weight of the element type, which can further improve the accuracy of the obtained sub-weight. In a random forest, since there are multiple decision trees and each decision tree has a corresponding weight, and multiple decision trees are established based on different historical sets (including historical customer feature vectors), the weight of the corresponding element type is obtained by taking the average of multiple weights in the above steps. This can reduce errors and further improve the accuracy of the determined weights based on comprehensive and full consideration of a large number of different historical samples, thereby improving the accuracy of determining the historical customer target vector based on the weight in subsequent steps and the accuracy of subsequent customer churn warnings.
[0236] In an optional embodiment, if Figure 3 As shown, the step of determining the corresponding historical customer target vector based on the weight and the preset historical customer feature vector includes the following steps:
[0237] S301: Determine whether the historical churn label of the historical customer feature vector is a churned label. If so, use the historical customer feature vector as a candidate vector.
[0238] S302: Based on the weights, a plurality of element types with a preset reserved number having the largest weights are determined as standard types.
[0239] S303: Determine, based on the vector elements corresponding to the standard type in each candidate vector, a historical customer target vector corresponding to the candidate vector.
[0240] Exemplarily, the specific value of the preset retention number can be determined by those skilled in the art according to actual conditions, and the embodiments of the present invention do not limit this. For example, the preset retention number can be 20, 25, 30, 15, or 10, etc., preferably 20. Since one element type corresponds to one weight, the first several element types with the largest weights among all element types can be directly determined as standard types. For example, if the total number of element types is 50 and the preset retention number is 20, the first 20 element types with the largest weights among the 50 element types are selected as the standard types.
[0241] Exemplarily, the determining of the historical customer target vector corresponding to each alternative vector based on the vector elements corresponding to the standard type in each alternative vector may be, but is not limited to, extracting the vector elements corresponding to the standard type in the alternative vector and re-splicing the vectors to obtain the corresponding historical customer target vectors, wherein the length of the historical customer target vectors is the value of the preset retention number. For example, if the preset retention number is 3, and there is an alternative vector (first element type element value, second element type element value, third element type element value, fourth element type element value, fifth element type element value), and the vector elements corresponding to the standard type are the first element type, the second element type, and the third element type, then the spliced historical customer target vector is (first element type element value, second element type element value, third element type element value).
[0242] Through step S301, historical customer feature vectors corresponding to historical customers who have actually churned can be selected as candidate vectors, so that feature vectors of historical customers who have not actually churned will not be included in the samples involved in the subsequent genetic iteration. On the one hand, this can reduce the amount of data processed during the genetic iteration to increase the speed of the loop iteration process. On the other hand, it can prevent the feature vectors of historical customers who have not actually churned from acting as impurity samples and interfering with the relevant processes, thereby improving the accuracy of the subsequent genetic iteration process. Through step S302, based on the size of the weight, the element type with the greatest influence on the feature can be more accurately and quickly determined as the standard type. In the subsequent steps, the customer churn type can be determined based on the historical customer target vector that only includes elements of the standard type vector, further reducing the amount of data that needs to be traversed and operated. Through step S303, the length of the historical customer target vector can be reduced without losing the overall characteristics of the original corresponding candidate vector, thereby further facilitating the speed of subsequent genetic iteration and other related operations and processing. Therefore, the above steps can improve the speed and accuracy of determining the churn type in the subsequent steps, thereby improving the speed and accuracy of the overall customer churn warning.
[0243] In an optional embodiment, constructing a corresponding fitness function according to the historical customer target vector includes:
[0244] respectively setting a corresponding power coefficient variable and a multiple coefficient variable for each vector element in each of the historical customer target vectors;
[0245] Obtaining a sub-fitness parameter corresponding to each vector element based on the power coefficient variable, the multiple coefficient variable, and the element value of the corresponding vector element;
[0246] According to the sub-fitness parameter corresponding to each vector element, the fitness function of the corresponding historical customer target vector is constructed.
[0247] Exemplarily, the sub-fitness parameter corresponding to each vector element is obtained based on the power coefficient variable, the multiple coefficient variable and the element value of the corresponding vector element. It can be, but is not limited to, using the power coefficient variable as the exponent of the element value of the corresponding vector element to obtain the sub-fitness composition parameter, and multiplying the sub-fitness composition parameter by the multiple coefficient variable to obtain the sub-fitness parameter of the corresponding vector element. For example, a historical customer target vector B is (1,000,000, 3,000,000, 200,000), where 1,000,000 represents a vector element in vector B whose element type is account balance (and whose element value is 1,000,000, which can represent, but is not limited to, the customer's account balance of RMB 1,000,000), 3,000,000 represents a vector element in vector B whose element type is fund balance (and whose element value is 3,000,000, which can represent, but is not limited to, the customer's fund balance of RMB 3,000,000), and 200,000 represents a vector element in vector B whose element type is recent average transaction amount (and whose element value is 200,000, which can represent, but is not limited to, the customer's recent average transaction amount of RMB 200,000). The power coefficient variable corresponding to the account balance element in vector B is denoted by k1, and the multiplication coefficient variable is denoted by e1. The power coefficient variable of the fund balance vector element corresponding to vector B is expressed as k2, and the multiple coefficient variable is expressed as e2. The power coefficient variable of the recent average transaction amount vector element corresponding to vector B is expressed as k3, and the multiple coefficient variable is expressed as e3. For vector B, the sub-fitness component parameters of the account balance vector element are The sub-fitness parameter is The sub-fitness composition parameters of the fund balance vector elements are The sub-fitness parameter is The sub-fitness parameters of the recent average transaction amount vector element are The sub-fitness parameter is It should be noted that the specific implementation method of obtaining the sub-fitness parameter corresponding to each vector element based on the power coefficient variable, the multiple coefficient variable and the element value of the corresponding vector element can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation to this.
[0248] Exemplarily, the fitness function of the corresponding historical customer target vector is constructed based on the sub-fitness parameters corresponding to each vector element, which may be, but is not limited to, adding all the sub-fitness parameters and then superimposing (or not superimposing) a constant to construct the fitness function of the corresponding historical customer target vector. For example, corresponding to the above example, the fitness function of vector B may be, but is not limited to:
[0249]
[0250] The value of C can be determined by those skilled in the art based on actual conditions and is not limited in the present invention. For example, C can be, but is not limited to, 0, 1, 2, 3, or 50. f(x) represents the fitness obtained when the vector parameter x is set to vector B.
[0251] The above description is only for the example of vector B. In actual processing, the number of vector elements is not necessarily 3 like vector B. However, one vector element corresponds to one power coefficient variable e and one multiple coefficient variable k, and one vector element corresponds to one sub-fitness parameter. Among them, the fitness function can be generally expressed as follows:
[0252]
[0253] Among them, f(x) represents the fitness variable corresponding to the vector parameter x, n represents the number of elements in the input historical customer target vector (that is, the maximum element number), and the subscripts "1", "2", "3" and "n" represent the element numbers of the vector, x1, x2, x3 and x n etc. represent the element value variables of the vector elements corresponding to the corresponding element numbers. The number of e, k, and x in the corresponding fitness function is equal to the number of vector elements in the historical customer target vector.
[0254] It should be noted that the specific implementation method of constructing the fitness function of the corresponding historical customer target vector based on the sub-fitness parameters corresponding to each vector element can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation to this.
[0255] Through the above steps, the fitness function can be fully associated with the characteristics of each vector element, and both the power coefficient variable and the multiple coefficient variable are set for each vector element. From the perspective of multiplication and exponentiation, the correlation between the characteristics of the vector elements and the variables to be solved in the fitness function can be improved, thereby improving the consistency of the final power coefficient and the final multiple coefficient obtained after subsequent iterative solutions with the historical customer characteristics, thereby improving the accuracy of the churn type determined based on the final power coefficient and the final multiple coefficient, and thus improving the accuracy of customer churn warning.
[0256] In an optional embodiment, performing genetic iteration based on the fitness function to determine a plurality of final power coefficients and final multiplication coefficients corresponding to the historical customer target vector includes:
[0257] Randomly setting the initial power coefficient of each power coefficient variable and the initial multiple coefficient of each multiple coefficient variable in the fitness function, and repeatedly performing the genetic iteration step until all final power coefficients and final multiple coefficients of each fitness function are determined, the genetic iteration step comprising:
[0258] Based on all the fitness functions, obtaining the fitness of each corresponding historical customer target vector; based on the churn value corresponding to the historical churn label of the corresponding historical customer target vector and the fitness, obtaining a sub-fitting value corresponding to the historical customer target vector; and superimposing the sub-fitting values corresponding to all the historical customer target vectors to obtain a fitting value;
[0259] Determine whether the fitting value is less than or equal to a preset fitting threshold; if so, use the initial power coefficient of each power coefficient variable in the fitness function as the final power coefficient, and use the initial multiple coefficient of each multiple coefficient variable as the final multiple coefficient;
[0260] If not, repeat the crossover and mutation operations until all fitness functions are updated;
[0261] The crossover mutation operation includes:
[0262] Selecting an unupdated fitness function from all fitness functions as a current fitness function, and selecting multiple fitness functions from other fitness functions except the current fitness function as crossover operator functions;
[0263] According to the power coefficients of the corresponding power coefficient variables in the multiple crossover operator functions and a preset first random number, a power crossover operator of each corresponding power coefficient variable of the current fitness function is obtained; and according to the multiple coefficients of the corresponding multiple coefficient variables in the multiple crossover operator functions and the first random number, a multiple crossover operator of each corresponding multiple coefficient variable of the current fitness function is obtained;
[0264] According to the power crossover operator and the preset second random number, a corresponding power mutation operator is obtained; and according to the multiple crossover operator and the second random number, a corresponding multiple mutation operator is obtained;
[0265] The power mutation operator corresponding to each power coefficient variable of the current fitness function is used as the initial power coefficient of the power coefficient variable, and the multiple mutation operator corresponding to each multiple coefficient variable of the current fitness function is used as the initial multiple coefficient of the multiple coefficient variable to complete the update of the current fitness function.
[0266] Exemplarily, since the power coefficient variables and the multiple coefficient variables have been set to exact values, the values of the variables in the fitness function are all known, so the fitness of each corresponding historical customer target vector can be directly obtained based on all the fitness functions.
[0267] Exemplarily, one historical customer target vector corresponds to one sub-fitting value, and one historical customer target vector corresponds to one churn value.
[0268] Exemplarily, the churn value corresponding to the historical churn label may be, but is not limited to, the ID value contained therein when the historical churn label is a churned label, wherein different ID values correspond to different historical churn types of historical users. For example, if the ID value is 1000000, it indicates that the historical churn type of the historical customer corresponding to the historical customer target vector corresponding to the historical churn label is "strong churn intention"; if the ID value is 2000000, it indicates that the historical churn type of the historical customer corresponding to the historical customer target vector corresponding to the historical churn label is "relatively strong churn intention"; and if the ID value is 3000000, it indicates that the historical churn type of the historical customer corresponding to the historical customer target vector corresponding to the historical churn label is "general churn intention".
[0269] It should be noted that the churn value corresponding to the historical churn label and its corresponding relationship with the historical churn type can be determined by those skilled in the art based on actual circumstances. The above description is only an example and does not constitute a limitation. However, different churn values may correspond to different historical churn types.
[0270] Exemplarily, the sub-fitting values corresponding to all historical customer target vectors are superimposed to obtain a fitting value, which can be expressed as but not limited to the following formula:
[0271]
[0272] Where E represents the fitted value, N represents the number of historical customer target vectors (the number of sub-fitted values), i represents the number of historical customer target vectors, |F(x i )-f(x i )| 2It should be noted that the specific implementation method of superimposing the sub-fitting values corresponding to all historical customer target vectors to obtain the fitting value can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation thereto.
[0273] Exemplarily, the fitting threshold can be determined by those skilled in the art according to actual conditions, and the embodiments of the present invention do not limit this. For example, the fitting threshold can be but is not limited to 200, 50, 100, 1000 or 10000, etc.
[0274] Exemplarily, the initial power coefficient of each power coefficient variable in the fitness function is used as the final power coefficient, specifically the initial power coefficient of the power coefficient variable of each corresponding vector element in the fitness function is used as the final power coefficient of the corresponding vector element, and the same applies to the initial multiple coefficient of each multiple coefficient variable being used as the final multiple coefficient.
[0275] Exemplarily, the method of selecting an unupdated fitness function from all fitness functions as the current fitness function, and selecting multiple fitness functions from other fitness functions except the current fitness function as the crossover operator function, has the following examples:
[0276] There are fitness function A, fitness function B, fitness function C, fitness function D, and fitness function E, and fitness function A is already the updated fitness function during this round of crossover mutation. Therefore, the fitness functions that have not been updated are fitness function B, fitness function C, fitness function D, and fitness function E. Fitness function B is selected as the current fitness function, and the other fitness functions other than the current fitness function include other updated fitness functions and unupdated fitness functions, for example, fitness function A, fitness function C, fitness function D, and fitness function E. The number of crossover operator functions selected can be determined by those skilled in the art according to actual circumstances, and the embodiment of the present invention does not impose any limitation on this. For example, the number of "multiple fitness functions" selected can be, but is not limited to, 2, 3, or 4, and is preferably 2. However, the number of crossover operator functions selected cannot be less than 2. Among them, when selecting the crossover operator function, it can be selected randomly or according to a specific rule. For example, a fitness function that is adjacent in order or number to the current fitness function can be selected as the crossover operator function. For example, when the current fitness function is fitness function B, fitness function A and fitness function C can be selected as the crossover operator function, or when the current fitness function is fitness function A, fitness function B and fitness function E can be selected as the crossover operator function.
[0277] It should be noted that the specific implementation method of selecting an unupdated fitness function from all fitness functions as the current fitness function, and selecting multiple fitness functions from other fitness functions except the current fitness function as the crossover operator function can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation to this.
[0278] Exemplarily, the first random number may be, but is not limited to, a normally distributed random number or a random number generated based on a random number generation function.
[0279] Exemplarily, the power crossover operator of each corresponding power coefficient variable of the current fitness function is obtained based on the power coefficients of the corresponding power coefficient variables in multiple crossover operator functions and a preset first random number. This can be, but is not limited to, obtaining the power crossover operator of the power coefficient variable of the corresponding element type of the current fitness function based on the power coefficient variables of the vector elements of the corresponding element types in multiple crossover operator functions and a first random number, wherein the value range of the first random number is (0, 1). Specifically, there are the following examples:
[0280] For a certain element type "account balance", the power coefficient F1 of the power coefficient variable k3 of the element value variable x3 of the corresponding vector element in the crossover operator function A is 3, the power coefficient F2 of the power coefficient variable k3 of the element value variable x3 of the corresponding vector element in the crossover operator function B is 5, and the value of the first random number a is 0.8, then the power crossover operator of the vector element corresponding to the element type "account balance" in the current fitness function C can be expressed as follows:
[0281] Power crossover operator = F1*a+F2*(1-a)
[0282] After substituting, the power crossover operator value is 3.4.
[0283] It should be noted that the specific implementation method of obtaining the power crossover operator of each corresponding power coefficient variable of the current fitness function based on the power coefficients of the corresponding power coefficient variables in multiple crossover operator functions and a preset first random number can be determined by those skilled in the art based on actual conditions. The above description is only an example and does not constitute a limitation to this.
[0284] Exemplarily, the specific implementation method of obtaining the multiple crossover operator of each corresponding multiple coefficient variable of the current fitness function according to the multiple coefficients of the corresponding multiple coefficient variables in multiple crossover operator functions and the first random number can refer to the description of the steps of obtaining the power crossover operator of each corresponding power coefficient variable of the current fitness function according to the power coefficients of the corresponding power coefficient variables in multiple crossover operator functions and the preset first random number in the embodiment of the present invention. The principle is the same and will not be repeated here.
[0285] Exemplarily, the second random number may be, but is not limited to, a normally distributed random number or a random number generated based on a random number generation function.
[0286] Exemplarily, the power mutation operator obtained based on the power crossover operator and the preset second random number can be, but is not limited to, a power crossover operator of a power coefficient variable of a corresponding element type of the current fitness function and a mutation operation performed on the second random number to obtain a power mutation operator of a power coefficient variable of a corresponding element type of the current fitness function. The value range of the second random number is (-0.3, 0.3). Specific examples are as follows:
[0287] For a certain element type "account balance", the value of the second random number b is 0.1, then the power mutation operator of the vector element corresponding to the element type "account balance" in the current fitness function C can be expressed as follows:
[0288] Power mutation operator = power crossover operator + 0.3*b
[0289] After substituting, the power variation operator value is 3.43. The 0.3 in 0.3*b is a correction coefficient, which does not necessarily need to be set to 0.3 and can also be set to other values. The specific value can be determined by those skilled in the art based on actual conditions.
[0290] It should be noted that the specific implementation method of obtaining the corresponding power mutation operator based on the power crossover operator and the preset second random number can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation to this.
[0291] Exemplarily, the specific implementation method of obtaining the corresponding multiple mutation operator based on the multiple crossover operator and the second random number can refer to the description of the steps of obtaining the corresponding power mutation operator based on the power crossover operator and the preset second random number in the embodiment of the present invention. The principle is the same and will not be repeated here.
[0292] For example, assume that the current fitness function C is:
[0293]
[0294] The crossover operator function A is:
[0295]
[0296] The crossover operator function B is:
[0297]
[0298] Then the above-mentioned updating steps include based on e 1a The value of (multiplier coefficient), e 1b The value (multiplier coefficient) and the first random number, calculate e 1c Multiple crossover operator, and then according to e 1c The multiple crossover operator and the second random number get e 1c Multiple mutation operator, and based on k 1a The value of (power coefficient), k 1b The value (power coefficient) and the first random number, calculate k 1c The power crossover operator, and then according to k 1c The power crossover operator and the second random number get k 1c The power mutation operator of 2c Multiple mutation operator, k 2c The power mutation operator, e 3c The multiple mutation operator and k 3c The method of determining the power mutation operator is similar and will not be repeated here.
[0299] Through the above steps, while fully utilizing the principle of the genetic algorithm's elite retention strategy for selective inheritance, ensuring that the initial power coefficients and initial multiplication coefficients updated after each iteration are closer to the characteristics of the corresponding vector elements, the unnecessary random selection process is eliminated (for the classification scenario of this solution, the random selection process is dispensable and has no effect on increasing iteration accuracy), thereby reducing the time of genetic iterations. Therefore, while ensuring that the final power coefficients and final multiplication coefficients obtained after the iteration are highly consistent with the characteristics of the corresponding vector elements, thereby increasing the accuracy of the final power coefficients and final multiplication coefficients, the speed of genetic iterations is also increased, thereby improving the accuracy and speed of the overall determination of the current customer churn type, and thus improving the accuracy and speed of the overall customer churn warning.
[0300] In an optional embodiment, obtaining a sub-fitting value corresponding to the historical customer target vector based on the churn value corresponding to the historical churn label of the corresponding historical customer target vector and the fitness includes:
[0301] Subtracting the fitness from the loss value to obtain a fitness difference;
[0302] The square of the absolute value of the adaptation difference is taken as the sub-fitting value.
[0303] For example, it has been clearly stated above that |F(x i )-f(x i )| 2 represents the sub-fitting value, then F(x i ) represents the churn value of the corresponding historical customer target vector, f(x i ) represents the fitness of the corresponding historical customer target vector, F(x i )-f(x i ) represents the adaptation difference to the historical customer target vector.
[0304] Through the above steps, the sub-fitting value can more clearly and obviously reflect the gap between the churn value and fitness of the same corresponding historical customer target vector, so as to more clearly and obviously reflect the gap between all the power coefficients and multiple coefficients corresponding to one iteration and the total characteristics of the corresponding historical customer target vector as a whole. This is conducive to more accurately judging whether the genetic iteration has achieved the goal of making the gap between all the power coefficients and multiple coefficients and the total characteristics of the corresponding historical customer target vector as a whole less than a specific degree, thereby indirectly improving the accuracy of the final power coefficients and final multiple coefficients obtained subsequently, and further indirectly improving the accuracy of the overall customer churn warning.
[0305] In an optional embodiment, if Figure 4 As shown, the method of judging whether the corresponding current customer is a customer about to churn based on the classification value of the random forest and the current customer feature vector, and if so, determining the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient, includes the following steps:
[0306] S401: Determine a corresponding path in each decision tree of the random forest according to the classification value of the vector element of the current customer feature vector.
[0307] S402: Obtaining a leaf node corresponding to the current customer feature vector in the decision tree according to the path.
[0308] S403: Based on the historical churn labels corresponding to the leaf nodes corresponding to the current customer feature vector in each decision tree, determine the first number of decision trees to which the leaf nodes corresponding to the historical churn labels with the value of churned labels belong, and the second number of decision trees to which the leaf nodes corresponding to the historical churn labels with the value of not churned labels belong.
[0309] S404: Determine whether the first decision quantity is greater than the second decision quantity. If so, determine the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient.
[0310] Exemplarily, according to the classification value of the vector element of the current customer feature vector, a corresponding path is determined in each decision tree of the random forest. There are the following examples:
[0311] If the current customer feature vector B is (800000, 100000, 111111, 2, 52013, 1), 800000 represents the vector element in vector B whose element type is account balance (and the element value of the vector element is 800000), 100000 represents the vector element in vector B whose element type is loan balance (and the element value of the vector element is 100000), 111111 represents the vector element in vector B whose element type is customer docking information (and the element value of the vector element is 111111), 2 represents the vector element in vector B whose element type is customer level (and the element value of the vector element is 2), 52013 represents the vector element in vector B whose element type is recent transaction number (and the element value of the vector element is 52013), and 1 represents the vector element in vector B whose element type is gender (and the element value of the vector element is 1). It is further known that the classification value corresponding to the current customer feature vector can be expressed as (2, 100, 31, 2, 3, 1) (the classification values at corresponding positions correspond to the vector elements at corresponding positions in the feature vector B, for example, the first classification value 2 corresponds to the account balance vector element 800000, and the second classification value 100 corresponds to the loan balance vector element 100000).
[0312] The classification values corresponding to each element of the current customer feature vector B are input into a decision tree. If the root node attribute of the decision tree is account balance, then the path with the classification value of the root node attribute being 2 is followed to reach the first child node. If the sub-node attribute of the first child node is customer docking information, then the path with the classification value of the sub-node attribute being 31 is followed to reach the second child node. If the sub-node attribute of the second child node is loan balance, then the path with the classification value of the sub-node attribute being 100 is followed to reach the third child node. If the sub-node attribute of the third child node is account balance again, then the path with the classification value of the sub-node attribute being 2 is followed to reach the fourth child node. If the sub-node attribute of the fourth child node is gender, then the path with the classification value of the sub-node attribute being 1 is followed to reach the fifth child node. If the fifth child node is already a leaf node, then the corresponding path in the current decision tree can be determined to be: root node -> first child node -> second child node -> third child node -> fourth child node -> a leaf node. According to the same principle, the corresponding leaf nodes in other decision trees of the random forest of the current customer feature vector can be obtained. Among them, the current customer feature vector corresponds to only one leaf node in a decision tree.
[0313] It should be noted that determining the corresponding path in each decision tree of the random forest based on the classification value of the vector element of the current customer feature vector is a basic implementation method of existing classification using random forests. The specific content can be determined by those skilled in the art based on actual conditions. The above description is only an example and does not constitute a limitation to this.
[0314] Exemplarily, the historical churn label corresponding to the leaf node corresponding to the current customer feature vector in each decision tree determines the first number of decisions of the decision tree to which the leaf node corresponding to the historical churn label with the value of the churned label belongs, and the second number of decisions of the decision tree to which the leaf node corresponding to the historical churn label with the value of the not-churned label belongs. It can be, but is not limited to, first determining the corresponding leaf vector according to the leaf node determined in each decision tree, and obtaining the corresponding historical churn label based on the leaf vector (the historical churn label values corresponding to each leaf vector in a leaf node are consistent) as the historical churn label corresponding to the leaf node, and then counting the first number of decisions of the decision tree to which the leaf node corresponding to the historical churn label with the value of the churned label belongs and the second number of decisions of the decision tree to which the leaf node corresponding to the historical churn label with the value of the not-churned label belongs. For example, there are decision trees A, B, C, and D. For the current customer feature vector, the leaf node determined in decision tree A is A (the corresponding historical churn label is the churned label), the leaf node determined in decision tree B is B (the corresponding historical churn label is the churned label), the leaf node determined in decision tree C is C (the corresponding historical churn label is the churned label), and the leaf node determined in decision tree D is D (the corresponding historical churn label is the not-churned label). It can be seen that the number of first decisions is 3 and the number of second decisions is 1.
[0315] It should be noted that, for the historical churn labels corresponding to the leaf nodes corresponding to the current customer feature vector in each decision tree, the specific implementation method of determining the first number of decisions of the decision tree to which the leaf nodes corresponding to the historical churn labels with the value of the churned labels belong, and the second number of decisions of the decision tree to which the leaf nodes corresponding to the historical churn labels with the value of the non-churned labels belong, can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation to this.
[0316] Through the above steps, each decision tree in the random forest can be used in a standard way to predict whether the current customer, corresponding to the current customer feature vector, will churn in the future. This prediction is fast and highly accurate. Furthermore, the prediction results of multiple decision trees can be combined, and the majority vote can be implemented to determine whether the current customer will churn in the future. This reduces related errors and further improves prediction accuracy. Therefore, the above steps can improve the speed and accuracy of preliminary screening of current customer feature vectors corresponding to current customers who are about to churn, thereby improving the speed and accuracy of overall customer churn warning.
[0317] In an optional embodiment, if Figure 5As shown, the step of determining the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient includes the following steps:
[0318] S501: Substitute the element values of the vector elements of the current customer feature vector into the fitness function corresponding to each historical customer target vector, and obtain the current customer fitness value corresponding to the historical customer target vector based on the final power coefficient and the final multiplication coefficient corresponding to the historical customer target vector in the fitness function.
[0319] S502: Subtract the corresponding current customer fitness value from the churn value corresponding to the historical churn label of the historical customer target vector to obtain an initial proximity value, and take the absolute value of the initial proximity value to obtain a proximity difference value.
[0320] S503: Determine the churn type of the current customer according to the historical churn label corresponding to the historical customer target vector with the smallest proximity difference.
[0321] Exemplarily, the step of correspondingly substituting the element values of the vector elements of the current customer feature vector into the fitness function corresponding to each historical customer target vector may be, but is not limited to, replacing the element value of the corresponding vector element in each sub-fitness parameter in the fitness function with the element value of the vector element of the same element type in the current customer feature vector. Specific examples include the following:
[0322] For a historical customer target vector C, the corresponding fitness function is:
[0323]
[0324] It indicates that the element type of the historical customer target vector is the sub-fitness parameter of the vector element of the account balance, and "1000000" indicates the element value of the vector element. It indicates that the element type of the historical customer target vector is the sub-fitness parameter of the vector element of the fund balance, and "3000000" indicates the element value of the vector element. The sub-fitness parameter indicates that the element type of the historical customer target vector is a vector element of the recent average transaction amount, and "200000" indicates the element value of the vector element. There is a current customer feature vector Z(1100000, 3100000, 210000, 1, 0), where "1100000" indicates that the element type of the current customer feature vector is a vector element of the total asset balance (and the element value is 1100000), "3100000" indicates that the element type of the current customer feature vector is a vector element of the account balance (and the element value is 3100000), "210000" indicates that the element type of the current customer feature vector is a vector element of the fund balance (and the element value is 210000), "1" indicates that the element type of the current customer feature vector is a vector element of the customer grade (and the element value is 1), and "0" indicates that the element type of the current customer feature vector is a vector element of the gender (and the element value is 0). Since the historical customer target vector in this example does not include vector elements of gender and customer grade, and the fitness function does not have sub-fitness parameters corresponding to these two types of elements, the replacement does not need to consider the vector element "1" of customer grade and the vector element "0" of gender in the current customer feature vector Z. After the replacement, an intermediate function corresponding to vector C and vector Z is obtained:
[0325]
[0326] Since the final power coefficient and final multiple coefficient (corresponding to the final values of various e and k respectively) of the sub-fitness parameter of the vector element corresponding to the historical customer target vector corresponding to the intermediate function are known at this time, the calculated value of the intermediate function can be directly determined as the current customer fitness value corresponding to the historical customer target vector C.
[0327] It should be noted that the specific implementation method of substituting the element values of the vector elements of the current customer feature vector into the fitness function corresponding to each historical customer target vector, and obtaining the current customer fitness value corresponding to the historical customer target vector based on the final power coefficient and the final multiple coefficient corresponding to the historical customer target vector in the fitness function can be determined by those skilled in the art according to actual conditions. The above description is only an example and does not constitute a limitation to this.
[0328] For example, since each proximity difference corresponds to a historical customer target vector, and each historical customer target vector corresponds to a historical churn label, the churn type of the current customer can be directly determined based on the historical churn label corresponding to the historical customer target vector with the smallest proximity difference. Since the historical churn types corresponding to different churn values of the historical churn label are known, the historical churn type corresponding to the historical churn label corresponding to the historical customer target vector with the smallest proximity difference can be determined as the churn type of the current customer.
[0329] Since the value obtained by substituting the current customer feature vector into the fitness function of the corresponding historical customer target vector can fully reflect the characteristics of both the current customer feature vector and the corresponding historical customer target vector, the difference between the current customer fitness value and the churn value obtained after substitution can be highly consistent with the characteristic difference between the current customer feature vector and the historical customer target vector, so that the historical customer target vector with the smallest difference in proximity subsequently determined has the highest degree of conformity with the current customer feature vector and is closest in terms of characteristics. Therefore, the above steps can improve the accuracy of determining the churn type of the current customer, and the processing and calculation process of the above steps is simple, the computational complexity is not high, and the time consumption is short. Therefore, it can further improve the speed of determining the churn type of the current customer, and thus the above steps can improve the accuracy and speed of the overall customer churn warning.
[0330] In an optional embodiment, the step of correspondingly substituting the element values of the vector elements of the current customer feature vector into the fitness function corresponding to each historical customer target vector includes:
[0331] The element value of the vector element in the current customer feature vector is used to replace the element value in the sub-fitness parameter of the corresponding vector element in the fitness function.
[0332] Exemplarily, the specific implementation method of replacing the element value in the sub-fitness parameter of the corresponding vector element in the fitness function with the element value of the vector element in the current customer feature vector can refer to the above description of the step of substituting the element value of the vector element of the current customer feature vector into the fitness function corresponding to each historical customer target vector in the embodiment of the present invention, which will not be repeated here.
[0333] Through the above steps, the substitution process can be made more comprehensive and the error probability is lower, which is conducive to the accuracy of subsequent steps.
[0334] Based on the same principle, the embodiment of the present invention discloses a customer churn warning device 600, such as Figure 6 As shown, the customer churn warning device 600 includes:
[0335] The element mapping module 601 is used to classify the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector;
[0336] Fitness processing module 602 is configured to obtain weights of element types of vector elements based on a preset random forest, and determine a corresponding historical customer target vector based on the weights and a preset historical customer feature vector; construct a corresponding fitness function based on the historical customer target vector; and perform genetic iteration based on the fitness function to determine multiple final power coefficients and final multiplication coefficients of the corresponding historical customer target vector.
[0337] The early warning module 603 is used to determine whether the corresponding current customer is a customer who is about to churn based on the classification value of the random forest and the current customer feature vector. If so, the churn type of the current customer is determined based on the current customer feature vector, the final power coefficient and the final multiplication coefficient, and an early warning is issued based on the churn type.
[0338] In an optional embodiment, the method further includes a first vectorization module configured to:
[0339] The vector elements of the current customer feature vector are classified according to the corresponding element values, and before obtaining the classification value corresponding to each vector element in the current customer feature vector,
[0340] Based on multiple preset customer authentication codes, corresponding initial historical customer information is obtained respectively;
[0341] Performing data cleaning, data extraction, and data standardization on the initial historical customer information to obtain intermediate historical customer information;
[0342] The intermediate historical customer information is subjected to feature vector quantization processing to obtain the historical customer feature vector.
[0343] In an optional embodiment, the method further includes a second vectorization module configured to:
[0344] Before classifying the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector,
[0345] The preset current customer information is subjected to feature vectorization processing to obtain the current customer feature vector.
[0346] In an optional implementation, the element mapping module 601 is configured to:
[0347] Based on the element value of the current customer feature vector, the element type of the corresponding vector element, and a plurality of different element value intervals corresponding to the preset element type, determining the belonging interval corresponding to the element value of each vector element of the current customer feature vector from the element value intervals;
[0348] Based on the attribution interval, a classification value of a corresponding vector element in the current customer feature vector is obtained.
[0349] In an optional embodiment, the system further comprises a forest formation module for:
[0350] Before getting the weight of the element type of the vector element based on the preset random forest,
[0351] Classifying the vector elements of the historical customer feature vector according to corresponding element values to obtain a classification value corresponding to each vector element in the historical customer feature vector;
[0352] Segmenting and clustering all the historical customer feature vectors to obtain multiple historical sets;
[0353] Based on the plurality of historical customer feature vectors, the classification values of the historical customer feature vectors, and the corresponding historical churn labels in each of the historical sets, respectively constructing a decision tree corresponding to the historical set;
[0354] Based on the multiple decision trees, the random forest is formed.
[0355] In an optional embodiment, the forest formation module is used to:
[0356] Based on the element value of the historical customer feature vector, the element type of the corresponding vector element, and a plurality of different element value intervals corresponding to the preset element type, determining the belonging interval corresponding to the element value of each vector element of the historical customer feature vector from the element value interval;
[0357] Based on the attribution interval, a classification value of a corresponding vector element in the historical customer feature vector is obtained.
[0358] In an optional embodiment, the forest formation module is used to:
[0359] Obtaining the complete information entropy of the historical set according to all the historical customer feature vectors and corresponding historical churn labels in the historical set; wherein the value of the historical churn label is a churned label or a non-churned label;
[0360] Obtaining the root conditional entropy of each element type in the historical set according to the historical churn labels and classification values of the vector elements corresponding to all the historical customer feature vectors in the historical set;
[0361] According to the complete information entropy and the root conditional entropy, a root information gain entropy corresponding to the element type in the historical set is obtained, and the element type with the largest root information gain entropy is used as a root node attribute to establish a root node of a decision tree of the historical set; based on each possible classification value of the root node attribute, a child node corresponding to each classification value is established respectively;
[0362] Repeat the step of establishing child nodes until no child nodes can be established to complete the construction of the decision tree, wherein the step of establishing child nodes includes:
[0363] According to the sub-classification value corresponding to each of the sub-nodes, determining a plurality of historical customer feature vectors having vector elements corresponding to the sub-classification value in the history set as sub-vectors of the sub-node;
[0364] Determining whether the historical churn labels corresponding to the subvectors of each of the child nodes are the same, and if so, treating the child nodes as leaf nodes; and determining, based on the leaf classification value corresponding to each leaf node, multiple historical customer feature vectors in the historical set having vector elements corresponding to the leaf classification value as leaf vectors of the leaf node;
[0365] If not, obtaining the sub-conditional entropy of each element type in the child node according to the historical loss labels and classification values of the vector elements corresponding to all the sub-vectors;
[0366] According to the complete information entropy and the sub-conditional entropy, the sub-information gain entropy corresponding to the element type is obtained, and the element type with the largest sub-information gain entropy is used as the child node attribute; and the child node of the next layer of the child node is established based on each classification value that the child node attribute can take.
[0367] In an optional embodiment, the forest formation module is used to:
[0368] According to all the historical customer feature vectors and the corresponding historical churn labels in the historical set, a first number of historical customer feature vectors whose historical churn labels are values of churned labels and a second number of historical customer feature vectors whose historical churn labels are values of not churned labels are obtained;
[0369] Obtaining a churn rate based on the first number and the total number of all historical customer feature vectors in the historical set;
[0370] Obtaining a non-churn rate based on the second number and the total number of all historical customer feature vectors in the historical set;
[0371] Based on the churn rate and the non-churn rate, a complete information entropy is obtained.
[0372] In an optional embodiment, the forest formation module is used to:
[0373] According to the classification value of the vector element, respectively obtaining the number of divisions of the vector elements with different classification values in the element type in the historical set;
[0374] Obtaining a division rate according to the number of divisions and the total number of all historical customer feature vectors in the historical set;
[0375] Using historical customer feature vectors corresponding to different classification values of the element type in the historical set as corresponding partitioning vectors, and obtaining partitioning information entropies corresponding to different classification values based on the partitioning vectors corresponding to different classification values of the element type in the historical set and historical churn labels corresponding to the partitioning vectors;
[0376] Based on the partition rates and partition information entropies corresponding to different classification values that the element type in the history set can take, the root conditional entropy of the element type is obtained.
[0377] In an optional embodiment, the forest formation module is used to:
[0378] According to the classification values of the vector elements of the sub-vectors, respectively obtaining the number of sub-divisions of the vector elements with different classification values in the element type of the sub-vectors;
[0379] Obtaining a subdivision rate according to the subdivision quantity and the subvector quantity of the subvector;
[0380] Sub-vectors corresponding to different classification values in the element type are respectively used as corresponding sub-partition vectors, and based on the sub-partition vectors corresponding to different classification values in the element type and historical loss labels corresponding to the sub-partition vectors, sub-partition information entropy corresponding to the different classification values is obtained;
[0381] Based on the sub-division rates and sub-division information entropies corresponding to different classification values that the element type can take, the sub-conditional entropy of the element type is obtained.
[0382] In an optional embodiment, the fitness processing module 602 is configured to:
[0383] Based on the element type, determining the total number of nodes corresponding to child node attributes and root node attributes that are the same as the element type in each decision tree in the random forest;
[0384] The total number of nodes is used as the sub-weight of the decision tree corresponding to the element type, and the average of the sub-weights corresponding to all decision trees in the random forest is used as the weight of the element type.
[0385] In an optional embodiment, the fitness processing module 602 is configured to:
[0386] Based on the element type, determining the depth of a sub-node corresponding to a sub-node attribute having the same element type as that of each decision tree in the random forest;
[0387] Determine whether the root node attribute in the decision tree is the same as the element type; if not, obtain the sub-weight of the decision tree corresponding to the element type according to the depth; if so, obtain the sub-weight of the decision tree corresponding to the element type according to the depth, and add the sub-weight to the preset root weight to obtain the sub-weight of the decision tree corresponding to the element type;
[0388] The average value of the score weights corresponding to all decision trees in the random forest is used as the weight of the element type.
[0389] In an optional embodiment, the fitness processing module 602 is configured to:
[0390] Determine whether the historical churn label of the historical customer feature vector is a churn label, and if so, use the historical customer feature vector as a candidate vector;
[0391] Based on the weights, determining a plurality of element types with the largest weights and a preset number of reserved elements as standard types;
[0392] According to the vector elements corresponding to the standard type in each candidate vector, a historical customer target vector corresponding to the candidate vector is determined.
[0393] In an optional embodiment, the fitness processing module 602 is configured to:
[0394] respectively setting a corresponding power coefficient variable and a multiple coefficient variable for each vector element in each of the historical customer target vectors;
[0395] Obtaining a sub-fitness parameter corresponding to each vector element based on the power coefficient variable, the multiple coefficient variable, and the element value of the corresponding vector element;
[0396] According to the sub-fitness parameter corresponding to each vector element, the fitness function of the corresponding historical customer target vector is constructed.
[0397] In an optional embodiment, the fitness processing module 602 is configured to:
[0398] Randomly setting the initial power coefficient of each power coefficient variable and the initial multiple coefficient of each multiple coefficient variable in the fitness function, and repeatedly performing the genetic iteration step until all final power coefficients and final multiple coefficients of each fitness function are determined, the genetic iteration step comprising:
[0399] Based on all the fitness functions, obtaining the fitness of each corresponding historical customer target vector; based on the churn value corresponding to the historical churn label of the corresponding historical customer target vector and the fitness, obtaining a sub-fitting value corresponding to the historical customer target vector; and superimposing the sub-fitting values corresponding to all the historical customer target vectors to obtain a fitting value;
[0400] Determine whether the fitting value is less than or equal to a preset fitting threshold; if so, use the initial power coefficient of each power coefficient variable in the fitness function as the final power coefficient, and use the initial multiple coefficient of each multiple coefficient variable as the final multiple coefficient;
[0401] If not, repeat the crossover and mutation operations until all fitness functions are updated;
[0402] The crossover mutation operation includes:
[0403] Selecting an unupdated fitness function from all fitness functions as a current fitness function, and selecting multiple fitness functions from other fitness functions except the current fitness function as crossover operator functions;
[0404] According to the power coefficients of the corresponding power coefficient variables in the multiple crossover operator functions and a preset first random number, a power crossover operator of each corresponding power coefficient variable of the current fitness function is obtained; and according to the multiple coefficients of the corresponding multiple coefficient variables in the multiple crossover operator functions and the first random number, a multiple crossover operator of each corresponding multiple coefficient variable of the current fitness function is obtained;
[0405] According to the power crossover operator and the preset second random number, a corresponding power mutation operator is obtained; and according to the multiple crossover operator and the second random number, a corresponding multiple mutation operator is obtained;
[0406] The power mutation operator corresponding to each power coefficient variable of the current fitness function is used as the initial power coefficient of the power coefficient variable, and the multiple mutation operator corresponding to each multiple coefficient variable of the current fitness function is used as the initial multiple coefficient of the multiple coefficient variable to complete the update of the current fitness function.
[0407] In an optional embodiment, the fitness processing module 602 is configured to:
[0408] Subtracting the fitness from the loss value to obtain a fitness difference;
[0409] The square of the absolute value of the adaptation difference is taken as the sub-fitting value.
[0410] In an optional embodiment, the early warning module 603 is configured to:
[0411] Determining a corresponding path in each decision tree of the random forest according to the classification value of the vector element of the current customer feature vector;
[0412] According to the path, obtaining a leaf node corresponding to the current customer feature vector in the decision tree;
[0413] Based on the historical churn labels corresponding to the leaf nodes corresponding to the current customer feature vector in each decision tree, determining a first number of decision trees to which leaf nodes corresponding to the historical churn labels with a value of churned labels belong, and a second number of decision trees to which leaf nodes corresponding to the historical churn labels with a value of not churned labels belong;
[0414] Determine whether the first decision quantity is greater than the second decision quantity; if so, determine the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient.
[0415] In an optional embodiment, the early warning module 603 is configured to:
[0416] Substituting the element values of the vector elements of the current customer feature vector into the fitness function corresponding to each historical customer target vector, and obtaining the current customer fitness value corresponding to the historical customer target vector based on the final power coefficient and the final multiplication coefficient corresponding to the historical customer target vector in the fitness function;
[0417] Subtract the current customer fitness value from the churn value corresponding to the historical churn label of the historical customer target vector to obtain an initial closeness value, and take the absolute value of the initial closeness value to obtain a closeness difference value;
[0418] The churn type of the current customer is determined according to the historical churn label corresponding to the historical customer target vector with the smallest proximity difference.
[0419] In an optional embodiment, the early warning module 603 is configured to:
[0420] The element value of the vector element in the current customer feature vector is used to replace the element value in the sub-fitness parameter of the corresponding vector element in the fitness function.
[0421] Since the principle of solving the problem by the customer churn warning device 600 is similar to the above method, the implementation of the customer churn warning device 600 can refer to the implementation of the above method, which will not be described in detail here.
[0422] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer device. Specifically, the computer device may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0423] In a typical example, a computer device specifically includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method described above is implemented.
[0424] Reference below Figure 7 , which shows a schematic structural diagram of a computer device 700 suitable for implementing an embodiment of the present application.
[0425] like Figure 7 As shown, computer device 700 includes a central processing unit (CPU) 701, which can perform various appropriate tasks and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. Various programs and data required for the operation of system 700 are also stored in RAM 703. CPU 701, ROM 702, and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to bus 704.
[0426] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output section 707 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 708 including devices such as a hard disk; and a communication section 709 including a network interface card such as a LAN card or a modem. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. Removable media 711, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 710 as needed, so that computer programs read therefrom can be installed in the storage section 708 as needed.
[0427] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program including program code for executing the methods illustrated in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709 and / or installed from removable media 711.
[0428] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The 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 disc read-only memory (CD-ROM), digital versatile disc (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 transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0429] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0430] 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 flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, 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 flowcharts and / or block diagrams. 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.
[0431] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work 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 The function specified in one or more boxes.
[0432] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0433] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0434] 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 take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0435] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0436] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0437] The foregoing is merely 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 modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A customer churn early warning method, characterized in that: include: Classify the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector; Obtaining weights of element types of vector elements based on a preset random forest, and determining a corresponding historical customer target vector based on the weights and a preset historical customer feature vector; constructing a corresponding fitness function based on the historical customer target vector; and performing genetic iteration based on the fitness function to determine a plurality of final power coefficients and final multiple coefficients of the corresponding historical customer target vector; Determining whether the corresponding current customer is a customer about to churn based on the classification value of the random forest and the current customer feature vector; if so, determining the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient, and issuing an early warning based on the churn type; The classifying the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector includes: based on the element value of the current customer feature vector, the element type of the corresponding vector element, and a plurality of different element value intervals corresponding to the preset element types, determining from the element value intervals the belonging interval corresponding to the element value of each vector element of the current customer feature vector; and obtaining the classification value corresponding to the vector element in the current customer feature vector based on the belonging intervals; The weight of the element type of the vector element is obtained based on the preset random forest, including: Based on the element type, determining the total number of nodes corresponding to the child node attributes and root node attributes of each decision tree in the random forest that are the same as the element type; using the total number of nodes as the score weight of the decision tree corresponding to the element type, and taking the average of the score weights corresponding to all decision trees in the random forest as the weight of the element type; or Based on the element type, determine the depth of the sub-node corresponding to the sub-node attribute with the same element type in each decision tree in the random forest; judge whether the root node attribute in the decision tree is the same as the element type; if not, obtain the sub-weight of the decision tree corresponding to the element type according to the depth; if so, obtain the sub-weight of the decision tree corresponding to the element type according to the depth, add the sub-weight to the preset root weight to obtain the sub-weight of the decision tree corresponding to the element type; and take the average value of the sub-weights corresponding to all decision trees in the random forest as the weight of the element type.
2. The method according to claim 1, characterized in that include: The vector elements of the current customer feature vector are classified according to the corresponding element values, and before obtaining the classification value corresponding to each vector element in the current customer feature vector, Based on multiple preset customer authentication codes, corresponding initial historical customer information is obtained respectively; Performing data cleaning, data extraction, and data standardization on the initial historical customer information to obtain intermediate historical customer information; The intermediate historical customer information is subjected to feature vector quantization processing to obtain the historical customer feature vector.
3. The method according to claim 1, characterized in that include: Before classifying the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector, The preset current customer information is subjected to feature vectorization processing to obtain the current customer feature vector.
4. The method according to claim 1, wherein include: Before getting the weight of the element type of the vector element based on the preset random forest, Classifying the vector elements of the historical customer feature vector according to corresponding element values to obtain a classification value corresponding to each vector element in the historical customer feature vector; Segmenting and clustering all the historical customer feature vectors to obtain multiple historical sets; Based on the plurality of historical customer feature vectors, the classification values of the historical customer feature vectors, and the corresponding historical churn labels in each of the historical sets, respectively constructing a decision tree corresponding to the historical set; Based on the multiple decision trees, the random forest is formed.
5. The method according to claim 4, characterized in that The classifying the vector elements of the historical customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the historical customer feature vector includes: Based on the element value of the historical customer feature vector, the element type of the corresponding vector element, and a plurality of different element value intervals corresponding to the preset element type, determining the belonging interval corresponding to the element value of each vector element of the historical customer feature vector from the element value interval; Based on the attribution interval, a classification value of a corresponding vector element in the historical customer feature vector is obtained.
6. The method according to claim 4, characterized in that The step of constructing a decision tree corresponding to each of the historical sets based on the plurality of historical customer feature vectors, the classification values of the historical customer feature vectors, and the corresponding historical churn labels in each of the historical sets includes: Obtaining the complete information entropy of the historical set according to all the historical customer feature vectors and corresponding historical churn labels in the historical set; wherein the value of the historical churn label is a churned label or a non-churned label; Obtaining the root conditional entropy of each element type in the historical set according to the historical churn labels and classification values of the vector elements corresponding to all the historical customer feature vectors in the historical set; According to the complete information entropy and the root conditional entropy, a root information gain entropy corresponding to the element type in the historical set is obtained, and the element type with the largest root information gain entropy is used as a root node attribute to establish a root node of a decision tree of the historical set; based on each possible classification value of the root node attribute, a child node corresponding to each classification value is established respectively; Repeat the step of establishing child nodes until no child nodes can be established to complete the construction of the decision tree, wherein the step of establishing child nodes includes: According to the sub-classification value corresponding to each of the sub-nodes, determining a plurality of historical customer feature vectors having vector elements corresponding to the sub-classification value in the history set as sub-vectors of the sub-node; Determining whether the historical churn labels corresponding to the subvectors of each of the child nodes are the same, and if so, treating the child nodes as leaf nodes; and determining, based on the leaf classification value corresponding to each leaf node, multiple historical customer feature vectors in the historical set having vector elements corresponding to the leaf classification value as leaf vectors of the leaf node; If not, obtaining the sub-conditional entropy of each element type in the child node according to the historical loss labels and classification values of the vector elements corresponding to all the sub-vectors; According to the complete information entropy and the sub-conditional entropy, the sub-information gain entropy corresponding to the element type is obtained, and the element type with the largest sub-information gain entropy is used as the child node attribute; and the child node of the next layer of the child node is established based on each classification value that the child node attribute can take.
7. The method according to claim 6, characterized in that Obtaining the complete information entropy of the historical set based on all the historical customer feature vectors and corresponding historical churn labels in the historical set includes: According to all the historical customer feature vectors and the corresponding historical churn labels in the historical set, a first number of historical customer feature vectors whose historical churn labels are values of churned labels and a second number of historical customer feature vectors whose historical churn labels are values of not churned labels are obtained; Obtaining a churn rate based on the first number and the total number of all historical customer feature vectors in the historical set; Obtaining a non-churn rate based on the second number and the total number of all historical customer feature vectors in the historical set; Based on the churn rate and the non-churn rate, a complete information entropy is obtained.
8. The method according to claim 6, characterized in that Obtaining the root conditional entropy of each element type in the historical set according to the historical churn labels and classification values of the vector elements corresponding to all the historical customer feature vectors in the historical set includes: According to the classification value of the vector element, respectively obtaining the number of divisions of the vector elements with different classification values in the element type in the historical set; Obtaining a division rate according to the number of divisions and the total number of all historical customer feature vectors in the historical set; Using historical customer feature vectors corresponding to different classification values of the element type in the historical set as corresponding partitioning vectors, and obtaining partitioning information entropies corresponding to different classification values based on the partitioning vectors corresponding to different classification values of the element type in the historical set and historical churn labels corresponding to the partitioning vectors; Based on the partition rates and partition information entropies corresponding to different classification values that the element type in the history set can take, the root conditional entropy of the element type is obtained.
9. The method according to claim 6, characterized in that Obtaining the sub-conditional entropy of each element type in the child node according to the historical loss labels and classification values of the vector elements corresponding to all the sub-vectors includes: According to the classification values of the vector elements of the sub-vectors, respectively obtaining the number of sub-divisions of the vector elements with different classification values in the element type of the sub-vectors; Obtaining a subdivision rate according to the subdivision quantity and the subvector quantity of the subvector; Sub-vectors corresponding to different classification values in the element type are respectively used as corresponding sub-partition vectors, and based on the sub-partition vectors corresponding to different classification values in the element type and historical loss labels corresponding to the sub-partition vectors, sub-partition information entropy corresponding to the different classification values is obtained; Based on the sub-division rates and sub-division information entropies corresponding to different classification values that the element type can take, the sub-conditional entropy of the element type is obtained.
10. The method according to claim 1, characterized in that The determining of the corresponding historical customer target vector based on the weight and the preset historical customer feature vector includes: Determine whether the historical churn label of the historical customer feature vector is a churn label, and if so, use the historical customer feature vector as a candidate vector; Based on the weights, determining a plurality of element types with the largest weights and a preset number of reserved elements as standard types; According to the vector elements corresponding to the standard type in each candidate vector, a historical customer target vector corresponding to the candidate vector is determined.
11. The method according to claim 1, wherein The step of constructing a corresponding fitness function according to the historical customer target vector includes: respectively setting a corresponding power coefficient variable and a multiple coefficient variable for each vector element in each of the historical customer target vectors; Obtaining a sub-fitness parameter corresponding to each vector element based on the power coefficient variable, the multiple coefficient variable, and the element value of the corresponding vector element; According to the sub-fitness parameter corresponding to each vector element, the fitness function of the corresponding historical customer target vector is constructed.
12. The method according to claim 11, characterized in that The performing genetic iteration based on the fitness function to determine a plurality of final power coefficients and final multiple coefficients corresponding to the historical customer target vector includes: Randomly setting the initial power coefficient of each power coefficient variable and the initial multiple coefficient of each multiple coefficient variable in the fitness function, and repeatedly performing the genetic iteration step until all final power coefficients and final multiple coefficients of each fitness function are determined, the genetic iteration step comprising: Based on all the fitness functions, obtaining the fitness of each corresponding historical customer target vector; based on the churn value corresponding to the historical churn label of the corresponding historical customer target vector and the fitness, obtaining a sub-fitting value corresponding to the historical customer target vector; and superimposing the sub-fitting values corresponding to all the historical customer target vectors to obtain a fitting value; Determine whether the fitting value is less than or equal to a preset fitting threshold; if so, use the initial power coefficient of each power coefficient variable in the fitness function as the final power coefficient, and use the initial multiple coefficient of each multiple coefficient variable as the final multiple coefficient; If not, repeat the crossover and mutation operations until all fitness functions are updated; The crossover mutation operation includes: Selecting an unupdated fitness function from all fitness functions as a current fitness function, and selecting multiple fitness functions from other fitness functions except the current fitness function as crossover operator functions; According to the power coefficients of the corresponding power coefficient variables in the multiple crossover operator functions and a preset first random number, a power crossover operator of each corresponding power coefficient variable of the current fitness function is obtained; and according to the multiple coefficients of the corresponding multiple coefficient variables in the multiple crossover operator functions and the first random number, a multiple crossover operator of each corresponding multiple coefficient variable of the current fitness function is obtained; According to the power crossover operator and the preset second random number, a corresponding power mutation operator is obtained; and according to the multiple crossover operator and the second random number, a corresponding multiple mutation operator is obtained; The power mutation operator corresponding to each power coefficient variable of the current fitness function is used as the initial power coefficient of the power coefficient variable, and the multiple mutation operator corresponding to each multiple coefficient variable of the current fitness function is used as the initial multiple coefficient of the multiple coefficient variable to complete the update of the current fitness function.
13. The method according to claim 12, characterized in that The obtaining of a sub-fitting value corresponding to the historical customer target vector based on the churn value corresponding to the historical churn label of the corresponding historical customer target vector and the fitness includes: Subtracting the fitness from the loss value to obtain a fitness difference; The square of the absolute value of the adaptation difference is taken as the sub-fitting value.
14. The method according to claim 1, wherein The determining, based on the classification value of the random forest and the current customer feature vector, whether the corresponding current customer is a customer about to churn, and if so, determining the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient, includes: Determining a corresponding path in each decision tree of the random forest according to the classification value of the vector element of the current customer feature vector; According to the path, obtaining a leaf node corresponding to the current customer feature vector in the decision tree; Based on the historical churn labels corresponding to the leaf nodes corresponding to the current customer feature vector in each decision tree, determining a first number of decision trees to which leaf nodes corresponding to the historical churn labels with a value of churned labels belong, and a second number of decision trees to which leaf nodes corresponding to the historical churn labels with a value of not churned labels belong; Determine whether the first decision quantity is greater than the second decision quantity; if so, determine the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient.
15. The method according to claim 1, wherein The determining the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient includes: Substituting the element values of the vector elements of the current customer feature vector into the fitness function corresponding to each historical customer target vector, and obtaining the current customer fitness value corresponding to the historical customer target vector based on the final power coefficient and the final multiplication coefficient corresponding to the historical customer target vector in the fitness function; Subtract the current customer fitness value from the churn value corresponding to the historical churn label of the historical customer target vector to obtain an initial closeness value, and take the absolute value of the initial closeness value to obtain a closeness difference value; The churn type of the current customer is determined according to the historical churn label corresponding to the historical customer target vector with the smallest proximity difference.
16. The method according to claim 15, characterized in that Substituting the element values of the vector elements of the current customer feature vector into the fitness function corresponding to each historical customer target vector includes: The element value of the vector element in the current customer feature vector is used to replace the element value in the sub-fitness parameter of the corresponding vector element in the fitness function.
17. A customer churn warning device, characterized in that: include: An element mapping module is used to classify the vector elements of the current customer feature vector according to the corresponding element values to obtain the classification value corresponding to each vector element in the current customer feature vector; a fitness processing module configured to obtain weights of element types of vector elements based on a preset random forest, and determine a corresponding historical customer target vector based on the weights and a preset historical customer feature vector; construct a corresponding fitness function based on the historical customer target vector; and perform genetic iteration based on the fitness function to determine a plurality of final power coefficients and final multiple coefficients of the corresponding historical customer target vector; an early warning module, configured to determine whether the corresponding current customer is a customer about to churn based on the classification value of the random forest and the current customer feature vector; if so, determine the churn type of the current customer based on the current customer feature vector, the final power coefficient, and the final multiplication coefficient, and issue an early warning based on the churn type; The element mapping module is specifically configured to: determine, based on the element value of the current customer feature vector, the element type of the corresponding vector element, and a plurality of different element value intervals corresponding to the preset element type, the belonging interval corresponding to the element value of each vector element of the current customer feature vector; and obtain, based on the belonging interval, the classification value of the corresponding vector element in the current customer feature vector; The fitness processing module is specifically used to: Based on the element type, determining the total number of nodes corresponding to the child node attributes and root node attributes of each decision tree in the random forest that are the same as the element type; using the total number of nodes as the score weight of the decision tree corresponding to the element type, and taking the average of the score weights corresponding to all decision trees in the random forest as the weight of the element type; or Based on the element type, determine the depth of the sub-node corresponding to the sub-node attribute with the same element type in each decision tree in the random forest; judge whether the root node attribute in the decision tree is the same as the element type; if not, obtain the sub-weight of the decision tree corresponding to the element type according to the depth; if so, obtain the sub-weight of the decision tree corresponding to the element type according to the depth, add the sub-weight to the preset root weight to obtain the sub-weight of the decision tree corresponding to the element type; and take the average value of the sub-weights corresponding to all decision trees in the random forest as the weight of the element type.
18. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 16 is implemented.
19. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 16 is implemented.
Citation Information
Patent Citations
Civil aviation member passenger loss prediction method and device
CN112308319A
Feature expansion method, device, medium and computer program product
CN112529102A