Customer loss prediction method and device in financial scene, equipment and medium

By building a target graph structure containing customer nodes and market nodes, and using graph neural network and gated loop units to optimize the customer churn prediction model, the problem of insufficient prediction of single indicators in the existing technology is solved, and more accurate customer churn prediction and churn rate reduction is achieved.

CN120278757AInactive Publication Date: 2025-07-08CAIXIN SECURITIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510468519.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing models rely on a single indicator when predicting customer churn, and do not fully consider dynamic factors such as market conditions, making it difficult to effectively capture hidden churn behavior.

Method used

By standardizing customer data, a target graph structure containing customer nodes and market nodes is constructed, and an initial customer churn prediction model is constructed using graph neural network and gated loop unit. Combining the full connection layer and backpropagation algorithm to optimize the model parameters, the target customer churn prediction model is obtained.

Benefits of technology

It improves the accuracy of customer churn forecasts, and can take targeted marketing measures in a timely manner to reduce customer churn rates and improve customer satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120278757A_ABST
    Figure CN120278757A_ABST
Patent Text Reader

Abstract

The invention discloses a customer loss prediction method and device in a financial scene, equipment and a medium, and relates to the technical field of computers, and the method comprises the steps: building a target graph structure through employing a graph neural network based on the Beta coefficient of customer assets and market return rates in customer data and processed data obtained through the standardization processing of the customer data; constructing an initial customer loss prediction model by utilizing the target graph structure and a gating circulation unit, and performing state updating by utilizing a gating mechanism based on weighted neighbor information, processed data and an initial hidden state in the target graph structure; determining the gradient of a preset loss function relative to the target model parameter based on the initial customer loss probability determined by the target hidden state and the full connection layer and a back propagation algorithm; and updating the target model parameters based on gradient and gradient descent algorithms, and predicting the customer loss probability by using the target customer loss prediction model to obtain a prediction result. The accuracy of a customer loss prediction result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and particularly relates to a method, device, equipment and medium for predicting customer churn in a financial scenario. Background Art

[0002] Currently, when existing models predict customer churn, they mainly rely on a single indicator, such as the number of transactions, and do not fully consider dynamic factors such as market conditions. Moreover, traditional churn warning systems mainly focus on explicit behaviors, such as account closure, which clearly indicate customer churn. Implicit churn, such as a decrease in transaction frequency and a reduction in positions, is difficult to be effectively captured due to the lack of integrated analysis of multi-dimensional data.

[0003] As can be seen from the above, how to improve the accuracy of customer churn prediction results is an urgent problem to be solved at present. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for predicting customer churn in a financial scenario, which can improve the accuracy of customer churn prediction results. The specific solutions are as follows:

[0005] In a first aspect, the present application provides a method for predicting customer churn in a financial scenario, including:

[0006] Performing standardization processing on the collected customer data to obtain processed data, and determining the Beta coefficient between the customer assets and the market return rate in the customer data. Based on the Beta coefficient and the processed data, a target graph structure including customer nodes and market nodes is constructed using a graph neural network;

[0007] An initial customer churn prediction model is constructed using the target graph structure and a gated recurrent unit. State update is performed using the gating mechanism of the gated recurrent unit based on the weighted neighbor information in the target graph structure, the processed data, and the initial hidden state to obtain a target hidden state; the initial hidden state is a hidden state determined based on the customer type in the customer data;

[0008] The initial customer churn probability is determined using the fully connected layer in the initial customer churn prediction model and the target hidden state, and the gradient of the preset loss function with respect to the target model parameters in the initial customer churn prediction model is determined based on the backpropagation algorithm and the initial customer churn probability;

[0009] The target model parameters are updated based on the gradient and the gradient descent algorithm to obtain a target customer churn prediction model, and the customer churn probability is predicted using the target customer churn prediction model to obtain a prediction result.

[0010] Optionally, standardizing the collected customer data to obtain processed data, and determining the Beta coefficient of the customer assets and the market return rate in the customer data. Based on the Beta coefficient and the processed data, a target graph structure including customer nodes and market nodes is constructed using a graph neural network, including:

[0011] Cleaning, standardizing, and performing feature engineering on the collected customer data to obtain processed data, and determining the Beta coefficient based on the first return rate corresponding to the customer assets in the customer data and the second return rate corresponding to the target financial indicator;

[0012] Constructing a preset graph structure based on a graph neural network, then generating customer nodes using the processed data and the Beta coefficient, and generating market nodes based on the target financial indicator, the volatility corresponding to the target investment index, and the Beta coefficient;

[0013] Determining the corrected cosine similarity between the current customer and other customers using the processed data, and determining the target number of customers with the highest similarity as the target neighbors;

[0014] Determining the Beta coefficient as the edge weight between the customer and the market, constructing an adjacency matrix based on the target neighbors, and then obtaining the target graph structure using the customer nodes, the market nodes, the edge weight, and the adjacency matrix.

[0015] Optionally, constructing an initial customer churn prediction model using the target graph structure and a gated recurrent unit, and updating the state based on the weighted neighbor information, the processed data, and the initial hidden state in the target graph structure using the gating mechanism of the gated recurrent unit to obtain the target hidden state, including:

[0016] Determining the initial hidden state based on the initial state determined by the customer type in the customer data, and constructing an initial customer churn prediction model using the target graph structure and a gated recurrent unit;

[0017] Performing weighted summation on the key features corresponding to the target neighbors in the target graph structure to obtain weighted neighbor information, and concatenating the weighted neighbor information, the processed data, and the initial hidden state to obtain an input vector;

[0018] Inputting the input vector into the gated recurrent unit of the initial customer churn prediction model, and updating the state of the initial hidden state using the update gate and the reset gate in the gated recurrent unit to obtain the target hidden state.

[0019] Optionally, inputting the input vector into the gated recurrent unit of the initial customer churn prediction model, and using the update gate and reset gate in the gated recurrent unit to update the state of the initial hidden state to obtain a target hidden state, including:

[0020] Input the input vector into the gated recurrent unit of the initial customer churn prediction model, and then determine a first column matrix based on the input vector and by using the update gate, the first weight matrix, the first Sigmoid activation function, and the first bias term in the gated recurrent unit;

[0021] Determine a second column matrix based on the input vector and by using the reset gate, the second weight matrix, the second Sigmoid activation function, and the second bias term in the gated recurrent unit;

[0022] Use the second column matrix, the input vector, the third weight matrix, the hyperbolic tangent activation function, and the third bias term to determine a candidate hidden state;

[0023] Based on the first column matrix, the initial hidden state, and the candidate hidden state, determine the current hidden state at the current time step in the input vector, and determine the current hidden state as the initial hidden state at the next time step in the input vector, and then jump to the step of concatenating the weighted neighbor information, the processed data, and the initial hidden state to obtain an input vector until the number of state update times reaches the target state update threshold to obtain a target hidden state.

[0024] Optionally, based on the weighted neighbor information, the processed data, and the initial hidden state in the target graph structure and using the gating mechanism of the gated recurrent unit to update the state to obtain a target hidden state, including:

[0025] If the customer type in the customer data is a new customer, linearly interpolate the all-zero vector using the behavior data of the new customer to obtain an initial hidden state;

[0026] If the customer type in the customer data is an existing customer, determine the initial hidden state based on the processed data corresponding to the existing customer;

[0027] If the customer type in the customer data is a target customer with target similar customers, determine the cosine similarity between the target customer and the target similar customers, and determine whether the cosine similarity is greater than a preset similarity threshold;

[0028] If the cosine similarity is greater than the preset similarity threshold, use the initial hidden state of the target similar customers and the cosine similarity to determine the initial hidden state of the target customer.

[0029] Optionally, determining an initial customer churn probability by using a fully connected layer in the initial customer churn prediction model and the target hidden state, and determining a gradient of a preset loss function with respect to target model parameters in the initial customer churn prediction model based on a backpropagation algorithm and the initial customer churn probability includes:

[0030] Determining an output result of the fully connected layer based on the target hidden state and by using a fourth weight matrix and a fourth bias term of the fully connected layer in the initial customer churn prediction model, and determining the initial customer churn probability by using a third Sigmoid activation function and the output result of the fully connected layer;

[0031] Determining a difference between the initial customer churn probability and an actual customer churn probability by using a binary cross-entropy loss function to obtain a loss value, and determining whether the loss value is less than a preset loss threshold;

[0032] If the loss value is not less than the preset loss threshold, determining a first derivative of the binary cross-entropy loss function with respect to the initial customer churn probability, determining a second derivative of the initial customer churn probability with respect to the output result of the fully connected layer, and then determining a third derivative of the output result of the fully connected layer with respect to the fourth weight matrix;

[0033] Determining a first gradient of the binary cross-entropy loss function with respect to the fourth weight matrix based on the first derivative, the second derivative, and the third derivative and by using the chain rule;

[0034] Determining a fourth derivative of the output result of the fully connected layer with respect to the fourth bias term, and determining a second gradient of the binary cross-entropy loss function with respect to the fourth bias term based on the first derivative, the second derivative, and the fourth derivative.

[0035] Optionally, updating the target model parameters based on the gradient and a gradient descent algorithm to obtain a target customer churn prediction model includes:

[0036] Updating the fourth weight matrix and the fourth bias term respectively based on the first gradient and the second gradient and by using the gradient descent algorithm to obtain a new fourth weight matrix and a new fourth bias term, and jumping to the step of determining an output result of the fully connected layer based on the target hidden state and by using the fourth weight matrix and the fourth bias term of the fully connected layer in the initial customer churn prediction model, until the obtained loss value is less than the preset loss threshold or a target update threshold is reached, so as to obtain a target customer churn prediction model.

[0037] In a second aspect, the present application provides a customer churn prediction device in a financial scenario, including:

[0038] A target graph structure construction module, which is used to perform standardization processing on the collected customer data to obtain processed data, and determine the Beta coefficient between the customer assets and the market return rate in the customer data. Based on the Beta coefficient and the processed data, a target graph structure including customer nodes and market nodes is constructed using a graph neural network;

[0039] A target hidden state determination module, which is used to construct an initial customer churn prediction model using the target graph structure and a gated recurrent unit. Based on the weighted neighbor information in the target graph structure, the processed data, and the initial hidden state, and using the gating mechanism of the gated recurrent unit for state update to obtain a target hidden state; the initial hidden state is a hidden state determined based on the customer type in the customer data;

[0040] A gradient determination module, which is used to determine an initial customer churn probability using the fully connected layer in the initial customer churn prediction model and the target hidden state, and determine the gradient of the preset loss function with respect to the target model parameters in the initial customer churn prediction model based on the backpropagation algorithm and the initial customer churn probability;

[0041] A model parameter update module, which is used to update the target model parameters based on the gradient and the gradient descent algorithm to obtain a target customer churn prediction model, and use the target customer churn prediction model to predict the customer churn probability to obtain a prediction result.

[0042] In a third aspect, the present application provides an electronic device, including:

[0043] A memory, which is used to store a computer program;

[0044] A processor, which is used to execute the computer program to implement the aforementioned customer churn prediction method in a financial scenario.

[0045] In a fourth aspect, the present application provides a computer-readable storage medium, which is used to store a computer program, wherein the computer program, when executed by a processor, implements the aforementioned customer churn prediction method in a financial scenario.

[0046] This application performs standardized processing on the collected customer data to obtain processed data, and determines the Beta coefficient of the customer assets and the market return rate in the customer data. Based on the Beta coefficient and the processed data, a target graph structure including customer nodes and market nodes is constructed using a graph neural network; an initial customer churn prediction model is constructed using the target graph structure and a gated recurrent unit. Based on the weighted neighbor information in the target graph structure, the processed data, and the initial hidden state, the state is updated using the gating mechanism of the gated recurrent unit to obtain a target hidden state; the initial hidden state is a hidden state determined based on the customer type in the customer data; the initial customer churn probability is determined using the fully connected layer in the initial customer churn prediction model and the target hidden state, and based on the backpropagation algorithm and the initial customer churn probability, the gradient of the preset loss function with respect to the target model parameters in the initial customer churn prediction model is determined; based on the gradient and the gradient descent algorithm, the target model parameters are updated to obtain a target customer churn prediction model, and the target customer churn prediction model is used to predict the customer churn probability to obtain a prediction result.

[0047] As can be seen from the above, this application first performs standardized processing on customer data to ensure data diversity, constructs a target graph structure based on the Beta coefficient that can reflect the risk level of customer assets relative to the market, constructs an initial customer churn prediction model using the target graph structure and a gated recurrent unit, determines the target hidden state through the gating mechanism of the gated recurrent unit, and uses the fully connected layer of the initial customer churn prediction model to comprehensively consider all input data and the target hidden state to obtain the initial customer churn probability. Then, the backpropagation algorithm can efficiently calculate the gradient of the preset loss function with respect to the target model parameters, so as to continuously optimize the initial customer churn prediction model based on the gradient to obtain the target customer churn prediction model. In this way, using the target customer churn prediction model to predict the customer churn probability makes the prediction result more accurate, and targeted marketing measures can be taken based on the customer churn probability output by the model, thereby reducing the customer churn rate and improving customer satisfaction. Description of the Drawings

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0049] Figure 1 It is a flowchart of a customer churn prediction method in a financial scenario disclosed in this application;

[0050] Figure 2 A schematic diagram of processed data provided for this application;

[0051] Figure 3 A schematic structural diagram of a customer churn prediction device in a financial scenario disclosed in this application;

[0052] Figure 4 A structural diagram of an electronic device disclosed in this application. Detailed implementation manners

[0053] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0054] Currently, existing models rely on a single indicator, such as the number of transactions, when predicting customer churn, and do not fully consider dynamic factors such as market conditions. Moreover, traditional churn warning systems mainly focus on behaviors that clearly indicate customer churn. For example, a decrease in trading frequency, a reduction in positions held, etc., are difficult to be effectively captured due to the lack of integrated analysis of multi-dimensional data. Therefore, this application provides a customer churn prediction method in a financial scenario, which uses the target customer churn prediction model to predict the customer churn probability, making the prediction result more accurate, and can also take targeted marketing measures based on the customer churn probability output by the model, thereby reducing the customer churn rate and improving customer satisfaction.

[0055] See Figure 1 As shown, an embodiment of the present invention discloses a customer churn prediction method in a financial scenario, including:

[0056] Step S11: Standardize the collected customer data to obtain processed data, and determine the Beta coefficient of the customer assets and the market return rate in the customer data. Based on the Beta coefficient and the processed data, use a graph neural network to construct a target graph structure including customer nodes and market nodes.

[0057] In this embodiment, the collected customer data is cleaned, standardized, and feature engineered to obtain processed data; the customer data includes customer account data, customer behavior data, and customer static data. The customer account data includes changes in positions held and trading frequency. The customer behavior data includes page stay duration and product click heatmap. The customer static data includes academic qualification verification and credit score. In a specific implementation manner, Figure 2A schematic diagram of processed data provided in this embodiment. If the original value of the customer assets collected is 1125, then based on the original value, the mean and standard deviation of the customer assets are determined, and based on the mean and the standard deviation, the standardized value corresponding to the customer assets is determined to be 2.08, so as to obtain the processed data corresponding to the customer assets. The formula corresponding to the standardized value is:

[0058] ;

[0059] where, is the standardized value of the th customer data; is the original value corresponding to the th customer data; is the mean of the th customer data; is the standard deviation of the th customer data.

[0060] It can be understood that after obtaining the processed data, the Beta coefficient is determined based on the first rate of return corresponding to the customer assets in the customer data and the second rate of return corresponding to the target financial indicator. The calculation formula corresponding to the Beta coefficient is as follows:

[0061] ;

[0062] where, is the Beta coefficient of the rate of return of the customer assets in the customer data and the market rate of return within a preset time period; is the first sequence corresponding to the first rate of return of the customer assets in the customer data within a preset time period; is the second sequence corresponding to the second rate of return of the target financial indicator within a preset time period; is the covariance between the customer asset rate of return sequence and the market rate of return sequence; is the variance between the customer asset rate of return sequence and the market rate of return sequence. It should be noted that the market rate of return is the rate of return that can represent the overall market volatility, and no specific limitation is made here.

[0063] In this embodiment, after obtaining the Beta coefficient, a preset graph structure is constructed based on a graph neural network. In the preset graph structure, weighted summation is performed based on the processed data corresponding to the neighbor nodes connected to each customer node corresponding to each customer and the corresponding weights to obtain the neighbor weighted features corresponding to each customer. Then, the processed data, the Beta coefficient, and the neighbor weighted features are integrated, and the obtained 12-dimensional vector is determined as the customer node in the preset graph structure. The target financial indicator, the volatility corresponding to the target investment index, and the Beta coefficient are integrated, and the obtained 3-dimensional vector is determined as the market node in the preset graph structure. Wherein, the target investment index is an investment index that can characterize market fluctuations, and no specific limitation is made here.

[0064] Further, after obtaining the customer node and the market node, the Beta coefficient is determined as the edge weight between the customer and the market. Then, the corrected cosine similarity between the current customer and other customers is determined using the processed data, and the top 3 customers with the highest similarity are determined as the target neighbors of the current customer. The current customer is connected to the target neighbors, and the other connections are set to 0 to obtain an adjacency matrix. The target graph structure is obtained using the customer node, the market node, the edge weight, and the adjacency matrix. In a specific implementation manner, if the corrected cosine similarity between customer A and customer B is calculated, the corresponding formula is as follows:

[0065] ;

[0066] Wherein, is the corrected cosine similarity between customer A and customer B, that is, the edge weight between customer A and customer B; is the mean of 8 attributes corresponding to the customer, and the 8 attributes are as Figure 2 shown; are the 8 attributes corresponding to the customer.

[0067] Specifically, the standardized processing of the collected customer data is performed to obtain processed data, and the Beta coefficient of the customer assets and the market return rate in the customer data is determined. Based on the Beta coefficient and the processed data, a target graph structure including customer nodes and market nodes is constructed using a graph neural network, which includes: cleaning, standardizing, and performing feature engineering on the collected customer data to obtain processed data, and determining the Beta coefficient based on the first return rate corresponding to the customer assets in the customer data and the second return rate corresponding to the target financial indicator; constructing a preset graph structure based on the graph neural network, then generating customer nodes using the processed data and the Beta coefficient, and generating market nodes based on the target financial indicator, the volatility of the target investment index, and the Beta coefficient; determining the corrected cosine similarity between the current customer and other customers using the processed data, and determining the target number of customers with the highest similarity as the target neighbors; determining the Beta coefficient as the edge weight between the customer and the market, constructing an adjacency matrix based on the target neighbors, and then obtaining the target graph structure using the customer nodes, the market nodes, the edge weight, and the adjacency matrix.

[0068] Step S12: Construct an initial customer churn prediction model using the target graph structure and a gated recurrent unit, and perform state update on the basis of the weighted neighbor information, the processed data, and the initial hidden state in the target graph structure using the gating mechanism of the gated recurrent unit to obtain a target hidden state; the initial hidden state is a hidden state determined based on the customer type in the customer data.

[0069] In this embodiment, after obtaining the target graph structure, an initial customer churn prediction model is constructed based on the target graph structure and a gated recurrent unit, and the initial hidden state is determined using the initial state determined by the customer type in the customer data. Then, the key features corresponding to the target neighbors in the target graph structure are weighted and summed to obtain weighted neighbor information. In a specific implementation manner, 3 features corresponding to the target neighbors are determined as key features based on the processed data. After obtaining the weighted neighbor information, the weighted neighbor information, the processed data, and the initial hidden state are concatenated to obtain a 15-dimensional input vector, and the input vector is input into the gated recurrent unit (GRU, i.e., Gated Recurrent Unit) of the initial customer churn prediction model, and the update gate and reset gate in the gated recurrent unit are used to perform state update on the initial hidden state to obtain a target hidden state.

[0070] Specifically, the initial customer churn prediction model is constructed by using the target graph structure and the gated recurrent unit. State update is performed based on the weighted neighbor information in the target graph structure, the processed data, and the initial hidden state, and by using the gating mechanism of the gated recurrent unit to obtain the target hidden state, including: determining the initial hidden state based on the initial state determined by the customer type in the customer data, and constructing the initial customer churn prediction model by using the target graph structure and the gated recurrent unit; performing weighted summation on the key features corresponding to the target neighbors in the target graph structure to obtain the weighted neighbor information, and concatenating the weighted neighbor information, the processed data, and the initial hidden state to obtain the input vector; inputting the input vector into the gated recurrent unit of the initial customer churn prediction model, and using the update gate and reset gate in the gated recurrent unit to perform state update on the initial hidden state to obtain the target hidden state.

[0071] It can be understood that after inputting the input vector into the gated recurrent unit of the initial customer churn prediction model, a first column matrix is determined based on the input vector and by using the update gate, the first weight matrix, the first Sigmoid (i.e., an S-shaped function, also known as the S-shaped growth curve) activation function, and the first bias term in the gated recurrent unit. In a specific implementation, a parameter matrix of 3 rows and 15 columns is defined by using the normal distribution to obtain the first weight matrix, and the first weight matrix can be:

[0072] ;

[0073] After obtaining the first weight matrix, a first column matrix is determined based on the input vector and by using the update gate, the first weight matrix, the first Sigmoid activation function, and the first bias term in the gated recurrent unit. The formula corresponding to the first column matrix is as follows:

[0074] ;

[0075] where, is the first column matrix; is the first Sigmoid activation function; is the first weight matrix; is the input vector, is the first bias term corresponding to the update gate. The finally obtained first column matrix can be:

[0076] ;

[0077] where, the superscript It is indicated that the obtained matrix is a vertical column matrix. The role of the update gate in the gated recurrent unit is to control the retention ratio of the historical state and determine how much of the current hidden state comes from the previous hidden state.

[0078] In this embodiment, after obtaining the first vertical column matrix, a second vertical column matrix is determined. Similar to the update gate, a parameter matrix of 3 rows and 15 columns is first defined using the normal distribution to obtain the second weight matrix. , and based on the input vector, the second vertical column matrix is determined by using the reset gate, the second weight matrix, the second Sigmoid activation function, and the second bias term in the gated recurrent unit. The formula corresponding to the second vertical column matrix is as follows:

[0079] ;

[0080] Where is the second vertical column matrix; is the second Sigmoid activation function; is the first weight matrix; is the input vector, is the second bias term corresponding to the reset gate. The role of the reset gate is to filter the historical information useful for the current hidden state and determine which parts of the previous hidden state need to be filtered to filter out noise, so as to timely capture the change of the customer's risk preference and avoid relying on outdated historical data.

[0081] Furthermore, after obtaining the second vertical column matrix, the candidate hidden state is determined by using the second vertical column matrix, the input vector, the third weight matrix, the hyperbolic tangent activation function, and the third bias term. The formula for the candidate hidden state is:

[0082] ;

[0083] Where is the candidate hidden state; is the hyperbolic tangent activation function; is the third weight matrix defined using the normal distribution with 3 rows and 15 columns; is the second vertical column matrix; is the previous hidden state, that is, the initial hidden state; is the Hadamard product, that is, the multiplication of the corresponding elements of the matrices; is the processed data; is the third bias term.

[0084] It can be further understood that after obtaining the candidate hidden state, the current hidden state at the current time step in the input vector is determined based on the first column matrix, the initial hidden state, and the candidate hidden state. The formula corresponding to the current hidden state is:

[0085] ;

[0086] where is the current hidden state; is the initial hidden state; is the first column matrix. After obtaining the current hidden state, the current hidden state is determined as the initial hidden state at the next time step in the input vector, and then it jumps to the step of concatenating the weighted neighbor information, the processed data, and the initial hidden state to obtain the input vector until the number of state updates reaches the target state update threshold to obtain the target hidden state. It is worth mentioning that the number of state updates and the target state update threshold can be specifically defined according to the actual situation.

[0087] Specifically, inputting the input vector into the gated recurrent unit of the initial customer churn prediction model and using the update gate and reset gate in the gated recurrent unit to update the state of the initial hidden state to obtain the target hidden state includes: inputting the input vector into the gated recurrent unit of the initial customer churn prediction model, and then determining the first column matrix based on the input vector and using the update gate, the first weight matrix, the first Sigmoid activation function, and the first bias term in the gated recurrent unit; determining the second column matrix based on the input vector and using the reset gate, the second weight matrix, the second Sigmoid activation function, and the second bias term in the gated recurrent unit; using the second column matrix, the input vector, the third weight matrix, the hyperbolic tangent activation function, and the third bias term to determine the candidate hidden state; determining the current hidden state at the current time step in the input vector based on the first column matrix, the initial hidden state, and the candidate hidden state, and determining the current hidden state as the initial hidden state at the next time step in the input vector, and then jumping to the step of concatenating the weighted neighbor information, the processed data, and the initial hidden state to obtain the input vector until the number of state updates reaches the target state update threshold to obtain the target hidden state.

[0088] In this embodiment, the initial hidden state is determined based on the customer type in the customer data. Specifically, if the customer type in the customer data is a new customer, linear interpolation compensation is performed on a zero vector based on a preset time step and using the behavior data of the new customer to obtain the initial hidden state. In a specific implementation, when the customer type in the customer data is a new customer, a zero vector is used for initialization, and linear interpolation compensation is performed in the first 3 time steps (45 minutes). The corresponding formula is as follows:

[0089] ;

[0090] where, is the initial hidden state obtained by compensation; is the corresponding hidden state at time step ; is the preset time step, which takes values of 1, 2, and 3 here; is the initial full vector.

[0091] It can be understood that if the customer type in the customer data is an existing customer, the initial hidden state is determined based on a linear transformation and a preset activation function and using the processed data corresponding to the existing customer. The formula for determining the initial hidden state of the existing customer is as follows:

[0092] ;

[0093] where, is the ReLU activation function, i.e., max(0, z); is a 3-row and 9-column weight matrix initialized using a normal distribution; is the customer static data corresponding to the existing customer in the processed data.

[0094] Furthermore, if the customer type in the customer data is a target customer with target similar customers, the cosine similarity between the target customer and the target similar customers is determined, and it is judged whether the cosine similarity is greater than a preset similarity threshold; if the cosine similarity is greater than the preset similarity threshold, the initial hidden state of the target customer is determined using the initial hidden state of the target similar customer and the cosine similarity. In a specific implementation, the preset similarity threshold is 0.65, and the target customer has 3 target similar customers. Then the formula corresponding to the initial hidden state of the target customer is:

[0095] ;

[0096] where, is the hidden state of the target similar customer at the most recent moment; is the cosine similarity between the target similar customer and the target customer. It is worth mentioning that the preset similarity threshold can be adjusted accordingly according to the actual situation.

[0097] It can be understood that by dynamically allocating weights, a new customer can rely more on the hidden state of the target similar customer to determine the initial hidden state, and the existing customer can also determine the initial hidden state by increasing the weight of its own features. The formula for dynamic weight allocation is:

[0098] ;

[0099] where, is the weight allocation coefficient; is the customer static data corresponding to the target similar customer in the processed data; is the initial hidden state determined by the target customer through the target similar customer. The formula corresponding to the weight allocation coefficient is as follows:

[0100] ;

[0101] where, the larger the number of months of customer existence, is closer to 1, indicating that the existing customer pays more attention to its own features; the smaller the number of months of customer existence, is closer to 0, indicating that the new customer pays more attention to neighbor conduction.

[0102] Specifically, the state is updated based on the weighted neighbor information in the target graph structure, the processed data, and the initial hidden state, and using the gating mechanism of the gated recurrent unit to obtain the target hidden state, including: if the customer type in the customer data is a new customer, linearly interpolate the all-zero vector using the behavior data of the new customer to obtain the initial hidden state; if the customer type in the customer data is an existing customer, determine the initial hidden state based on the processed data corresponding to the existing customer; if the customer type in the customer data is a target customer with a target similar customer, determine the cosine similarity between the target customer and the target similar customer, and judge whether the cosine similarity is greater than the preset similarity threshold; if the cosine similarity is greater than the preset similarity threshold, use the initial hidden state of the target similar customer and the cosine similarity to determine the initial hidden state of the target customer.

[0103] Step S13: Use the fully connected layer in the initial customer churn prediction model and the target hidden state to determine the initial customer churn probability, and based on the backpropagation algorithm and the initial customer churn probability, determine the gradient of the preset loss function with respect to the target model parameters in the initial customer churn prediction model.

[0104] In this embodiment, after obtaining the target hidden state, the output result of the fully connected layer is determined based on the target hidden state and by using the fourth weight matrix and the fourth bias term of the fully connected layer in the initial customer churn prediction model, and the initial customer churn probability is determined by using the third Sigmoid activation function and the output result of the fully connected layer. The formula corresponding to the initial customer churn probability is as follows:

[0105] ;

[0106] where, is the initial customer churn probability; is the third Sigmoid activation function; is the fourth weight matrix of the fully connected layer in the initial customer churn prediction model; is the currently hidden state finally output, that is, the target hidden state; is the fourth bias term corresponding to the fully connected layer.

[0107] It can be understood that after obtaining the initial customer churn probability, the binary cross-entropy loss function is used to determine the difference between the initial customer churn probability and the actual customer churn probability to obtain a loss value, where the formula of the binary cross-entropy loss function is as follows:

[0108] ;

[0109] where, is the loss value; is the total number of customers in the customer data; is the actual customer churn situation of the th customer, 1 indicates customer churn, and 0 indicates that the customer has not churned; is the probability that the th customer is predicted to have churned. In a specific implementation, for customer , if , , then the corresponding loss value can be simplified to:

[0110] ;

[0111] If the obtained loss value is less than 1, it means that the obtained initial customer churn probability is 0.7, while the actual customer has not churned. Therefore, the initial customer churn prediction model needs to be optimized.

[0112] In this embodiment, if the obtained loss value is not less than the preset loss threshold, the first derivative of the binary cross-entropy loss function with respect to the initial customer churn probability is determined, the second derivative of the initial customer churn probability with respect to the output result of the fully connected layer is determined, and the third derivative of the output result of the fully connected layer with respect to the fourth weight matrix is determined. Then, based on the first derivative, the second derivative, and the third derivative and using the chain rule, the first gradient of the binary cross-entropy loss function with respect to the fourth weight matrix is determined. The formula corresponding to the first gradient is as follows:

[0113] ;

[0114] where, is the first derivative of the binary cross-entropy loss function with respect to the initial customer churn probability; is the second derivative of the initial customer churn probability with respect to the output result of the fully connected layer, is the output result of the fully connected layer, is the fourth weight matrix of the fully connected layer in the initial customer churn prediction model; is the th target hidden state finally obtained for the customer; is the fourth bias term corresponding to the fully connected layer; is to determine the third derivative of the output result of the fully connected layer with respect to the fourth weight matrix. After obtaining the first gradient, the second gradient is obtained in the same way. Specifically, the fourth derivative of the output result of the fully connected layer with respect to the fourth bias term is determined, and the second gradient of the binary cross-entropy loss function with respect to the fourth bias term is determined based on the product of the first derivative, the second derivative, and the fourth derivative.

[0115] Specifically, determining the initial customer churn probability by using the fully connected layer in the initial customer churn prediction model and the target hidden state, and determining the gradient of the preset loss function with respect to the target model parameters in the initial customer churn prediction model based on the backpropagation algorithm and the initial customer churn probability includes: determining the output result of the fully connected layer based on the target hidden state and by using the fourth weight matrix and the fourth bias term of the fully connected layer in the initial customer churn prediction model, and determining the initial customer churn probability by using the third Sigmoid activation function and the output result of the fully connected layer; determining the difference between the initial customer churn probability and the actual customer churn probability by using the binary cross-entropy loss function to obtain a loss value, and determining whether the loss value is less than a preset loss threshold; if the loss value is not less than the preset loss threshold, determining the first derivative of the binary cross-entropy loss function with respect to the initial customer churn probability, and determining the second derivative of the initial customer churn probability with respect to the output result of the fully connected layer, and then determining the third derivative of the output result of the fully connected layer with respect to the fourth weight matrix; determining the first gradient of the binary cross-entropy loss function with respect to the fourth weight matrix based on the first derivative, the second derivative, and the third derivative and by using the chain rule; determining the fourth derivative of the output result of the fully connected layer with respect to the fourth bias term, and determining the second gradient of the binary cross-entropy loss function with respect to the fourth bias term based on the first derivative, the second derivative, and the fourth derivative.

[0116] Step S14: Update the target model parameters based on the gradient and the gradient descent algorithm to obtain a target customer churn prediction model, and use the target customer churn prediction model to predict the customer churn probability to obtain a prediction result.

[0117] In this embodiment, after obtaining the first gradient and the second gradient, update the fourth weight matrix and the fourth bias term respectively based on the first gradient and the second gradient and by using the gradient descent algorithm to obtain a new fourth weight matrix and a new fourth bias term, and jump to the step of determining the output result of the fully connected layer based on the target hidden state and by using the fourth weight matrix and the fourth bias term of the fully connected layer in the initial customer churn prediction model until the obtained loss value is less than the preset loss threshold or reaches the target update threshold to obtain a target customer churn prediction model. It should be noted that the preset loss threshold and the target update threshold can be defined according to actual situations and will not be elaborated here. The formula corresponding to the gradient descent algorithm is as follows:

[0118] ;

[0119] ;

[0120] Among them, is the new fourth weight matrix; is the fourth weight matrix before update; is the learning rate; is the first gradient; is the new fourth bias term; is the fourth bias term before update; is the second gradient.

[0121] Specifically, updating the target model parameters based on the gradient and the gradient descent algorithm to obtain a target customer churn prediction model includes: updating the fourth weight matrix and the fourth bias term respectively based on the first gradient and the second gradient and using the gradient descent algorithm to obtain a new fourth weight matrix and a fourth bias term, and jumping to the step of determining the output result of the fully connected layer based on the target hidden state and the fourth weight matrix and the fourth bias term in the initial customer churn prediction model, until the obtained loss value is less than a preset loss threshold or reaches a target update threshold to obtain a target customer churn prediction model.

[0122] In this embodiment, in addition to being able to update the fourth weight matrix and the fourth bias term of the fully connected layer respectively based on the first gradient and the second gradient and using the gradient descent algorithm, it is also possible to determine a third gradient based on the fifth derivative of the target hidden state, the sixth derivative of the target hidden state with respect to the first column matrix output by the update gate, and the seventh derivative of the first column matrix with respect to the weight matrix of the binary cross-entropy loss function, so as to update the parameters in the gated recurrent unit based on the third gradient. In a specific implementation manner, if updating the first weight matrix in the gated recurrent unit, first determine the fifth derivative of the binary cross-entropy loss function with respect to the target hidden state, and the formula corresponding to the fifth derivative is as follows:

[0123] ;

[0124] Among them, is the current hidden state; is the actual customer churn situation of the th customer, 1 indicates customer churn, and 0 indicates no customer churn; is the probability that the th customer is predicted to have customer churn. After obtaining the fifth derivative, determine the sixth derivative of the target hidden state with respect to the first column matrix output by the update gate, and the formula corresponding to the sixth derivative is:

[0125] ;

[0126] Wherein, is the first column matrix output by the update gate; is the current hidden state; is the initial hidden state. After obtaining the sixth derivative, determine the seventh derivative of the first column matrix with respect to the weight matrix. The formula corresponding to the seventh derivative is:

[0127] ;

[0128] Wherein, is the first column matrix output by the update gate; is the first weight matrix; is the input vector. After obtaining the fifth derivative, the sixth derivative, and the seventh derivative, based on the fifth derivative, the sixth derivative, and the seventh derivative, and using the chain rule to determine the third gradient of the binary cross-entropy loss function with respect to the first weight matrix. The formula corresponding to the third gradient is as follows:

[0129] ;

[0130] Wherein, is the fifth derivative; is the sixth derivative; is the seventh derivative. Based on the three gradients and using the gradient descent algorithm to update the first weight matrix respectively, the corresponding update formula is:

[0131] ;

[0132] Wherein, is the new first weight matrix; is the first weight matrix before update; is the learning rate; is the third gradient. Therefore, if you want to update other parameters, you can also update them according to the above method.

[0133] As can be seen from the above, in this application, the customer data is first standardized to ensure data diversity. A target graph structure is constructed based on the Beta coefficient that can reflect the risk level of the customer's assets relative to the market. An initial customer churn prediction model is constructed using the target graph structure and a gated recurrent unit. The gated mechanism of the gated recurrent unit is used to determine the target hidden state, and the fully connected layer of the initial customer churn prediction model is used to comprehensively consider all the input data and the target hidden state to obtain the initial customer churn probability. Then, the backpropagation algorithm can efficiently calculate the gradient of the preset loss function with respect to the target model parameters, and the initial customer churn prediction model is continuously optimized based on the gradient to obtain the target customer churn prediction model. In this way, using the target customer churn prediction model to predict the customer churn probability makes the prediction result more accurate, and targeted marketing measures can be taken based on the customer churn probability output by the model, thereby reducing the customer churn rate and improving customer satisfaction.

[0134] Correspondingly, referring to Figure 3 as shown, this application also provides a customer churn prediction device in a financial scenario, including:

[0135] A target graph structure construction module 11, configured to standardize the collected customer data to obtain processed data, determine the Beta coefficient between the customer assets and the market return rate in the customer data, and construct a target graph structure including customer nodes and market nodes based on the Beta coefficient, the processed data, and using a graph neural network;

[0136] A target hidden state determination module 12, configured to construct an initial customer churn prediction model using the target graph structure and a gated recurrent unit, update the state based on the weighted neighbor information in the target graph structure, the processed data, and the initial hidden state, and using the gated mechanism of the gated recurrent unit to obtain the target hidden state; the initial hidden state is a hidden state determined based on the customer type in the customer data;

[0137] A gradient determination module 13, configured to determine the initial customer churn probability using the fully connected layer in the initial customer churn prediction model and the target hidden state, and determine the gradient of the preset loss function with respect to the target model parameters in the initial customer churn prediction model based on the backpropagation algorithm and the initial customer churn probability;

[0138] A model parameter update module 14, configured to update the target model parameters based on the gradient and the gradient descent algorithm to obtain a target customer churn prediction model, and use the target customer churn prediction model to predict the customer churn probability to obtain a prediction result.

[0139] As can be seen from the above, the present application first standardizes customer data to ensure data diversity, constructs a target graph structure based on the Beta coefficient that can reflect the risk level of customer assets relative to the market, constructs an initial customer churn prediction model using the target graph structure and a gated recurrent unit, determines the target hidden state through the gating mechanism of the gated recurrent unit, and comprehensively considers all input data and the target hidden state using the fully connected layer of the initial customer churn prediction model to obtain an initial customer churn probability. Then, the backpropagation algorithm can efficiently calculate the gradient of a preset loss function with respect to the target model parameters, and continuously optimize the initial customer churn prediction model based on the gradient to obtain a target customer churn prediction model. In this way, using the target customer churn prediction model to predict the customer churn probability makes the prediction result more accurate, and targeted marketing measures can also be taken based on the customer churn probability output by the model, thereby reducing the customer churn rate and improving customer satisfaction.

[0140] In some specific embodiments, the target graph structure construction module 11 may specifically include:

[0141] A customer data processing unit, configured to clean, standardize, and perform feature engineering on the collected customer data to obtain processed data, and determine the Beta coefficient based on the first return rate corresponding to the customer assets in the customer data and the second return rate corresponding to the target financial indicator;

[0142] A node generation unit, configured to construct a preset graph structure based on a graph neural network, then generate customer nodes using the processed data and the Beta coefficient, and generate market nodes based on the target financial indicator, the volatility corresponding to the target investment index, and the Beta coefficient;

[0143] A target neighbor determination unit, configured to determine the modified cosine similarity between the current customer and other customers using the processed data, and determine the target number of customers with the highest similarity as target neighbors;

[0144] An adjacency matrix construction unit, configured to determine the Beta coefficient as the edge weight between the customer and the market, construct an adjacency matrix based on the target neighbors, and then obtain the target graph structure using the customer nodes, the market nodes, the edge weight, and the adjacency matrix.

[0145] In some specific embodiments, the target hidden state determination module 12 may specifically include:

[0146] An initial hidden state determination unit, configured to determine an initial hidden state based on the initial state determined by the customer type in the customer data, and construct an initial customer churn prediction model using the target graph structure and a gated recurrent unit;

[0147] An input vector determination unit, configured to perform weighted summation using key features corresponding to the target neighbors in the target graph structure to obtain weighted neighbor information, and concatenate the weighted neighbor information, the processed data, and the initial hidden state to obtain an input vector;

[0148] A state update unit, configured to input the input vector into a gated recurrent unit of the initial customer churn prediction model, and use an update gate and a reset gate in the gated recurrent unit to update the state of the initial hidden state to obtain a target hidden state.

[0149] In some specific embodiments, the target hidden state determination module 12 may specifically include:

[0150] A first column matrix determination unit, configured to input the input vector into a gated recurrent unit of the initial customer churn prediction model, and then determine a first column matrix based on the input vector and using an update gate, a first weight matrix, a first Sigmoid activation function, and a first bias term in the gated recurrent unit;

[0151] A second column matrix determination unit, configured to determine a second column matrix based on the input vector and using a reset gate, a second weight matrix, a second Sigmoid activation function, and a second bias term in the gated recurrent unit;

[0152] A candidate hidden state determination unit, configured to determine a candidate hidden state using the second column matrix, the input vector, a third weight matrix, a hyperbolic tangent activation function, and a third bias term;

[0153] A target state determination unit, configured to determine a current hidden state of the current time step in the input vector based on the first column matrix, the initial hidden state, and the candidate hidden state, and determine the current hidden state as the initial hidden state of the next time step in the input vector, and then jump to the step of concatenating the weighted neighbor information, the processed data, and the initial hidden state to obtain an input vector until the number of state updates reaches a target state update threshold to obtain a target hidden state.

[0154] In some specific embodiments, the target hidden state determination module 12 may specifically include:

[0155] A first customer type determination unit, configured to, if the customer type in the customer data is a new customer, perform linear interpolation on a zero vector using the behavior data of the new customer to obtain an initial hidden state;

[0156] A second customer type determination unit, configured to, if the customer type in the customer data is a stock customer, determine an initial hidden state based on the processed data corresponding to the stock customer;

[0157] A third customer type determination unit, configured to, if the customer type in the customer data is a target customer with target similar customers, determine the cosine similarity between the target customer and the target similar customers, and determine whether the cosine similarity is greater than a preset similarity threshold;

[0158] A similarity judgment unit, configured to, if the cosine similarity is greater than the preset similarity threshold, determine the initial hidden state of the target customer by using the initial hidden state of the target similar customers and the cosine similarity.

[0159] In some specific embodiments, the gradient determination module 13 may specifically include:

[0160] An initial churn probability determination unit, configured to determine an output result of a fully connected layer based on the target hidden state and by using a fourth weight matrix and a fourth bias term in the initial customer churn prediction model, and determine an initial customer churn probability by using a third Sigmoid activation function and the output result of the fully connected layer;

[0161] A loss value determination unit, configured to use a binary cross-entropy loss function to determine the difference between the initial customer churn probability and the actual customer churn probability to obtain a loss value, and determine whether the loss value is less than a preset loss threshold;

[0162] A derivative determination unit, configured to, if the loss value is not less than the preset loss threshold, determine a first derivative of the binary cross-entropy loss function with respect to the initial customer churn probability, determine a second derivative of the initial customer churn probability with respect to the output result of the fully connected layer, and then determine a third derivative of the output result of the fully connected layer with respect to the fourth weight matrix;

[0163] A first gradient determination unit, configured to determine a first gradient of the binary cross-entropy loss function with respect to the fourth weight matrix based on the first derivative, the second derivative, and the third derivative and by using the chain rule;

[0164] A second gradient determination unit, configured to determine a fourth derivative of the output result of the fully connected layer with respect to the fourth bias term, and determine a second gradient of the binary cross-entropy loss function with respect to the fourth bias term based on the first derivative, the second derivative, and the fourth derivative.

[0165] In some specific embodiments, the model parameter update module 14 may specifically include:

[0166] A target prediction model determination unit is configured to update the fourth weight matrix and the fourth bias term respectively based on the first gradient and the second gradient and by using the gradient descent algorithm, so as to obtain a new fourth weight matrix and a new fourth bias term, and jump to the step of determining the output result of the fully connected layer based on the target hidden state and by using the fourth weight matrix and the fourth bias term in the fully connected layer of the initial customer churn prediction model, until the obtained loss value is less than a preset loss threshold or reaches a target update threshold, so as to obtain a target customer churn prediction model.

[0167] Further, an embodiment of the present application also discloses an electronic device. Figure 4 FIG. 20 is a structural diagram of an electronic device 20 shown according to an exemplary embodiment. The content in the figure should not be construed as any limitation on the scope of use of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the customer churn prediction method in the financial scenario disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0168] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and specific limitations are not imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application requirements, and no specific limitations are made here.

[0169] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be short-term storage or permanent storage.

[0170] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20, and it may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the customer churn prediction method in the financial scenario executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks.

[0171] Further, the present application also discloses a computer-readable storage medium for storing a computer program. When the computer program is executed by a processor, it implements the customer churn prediction method in the financial scenario disclosed above. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.

[0172] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and reference can be made to the description of the method part for the relevant parts.

[0173] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0174] The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, a software module executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0175] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.

[0176] The above has introduced the technical solution provided by this application in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A method for predicting customer churn in a financial scenario, characterized in that, Including: Performing standardized processing on the collected customer data to obtain processed data, and determining the Beta coefficient of the customer assets and the market return rate in the customer data. Based on the Beta coefficient and the processed data, a target graph structure including customer nodes and market nodes is constructed using a graph neural network; Constructing an initial customer churn prediction model using the target graph structure and a gated recurrent unit. Based on the weighted neighbor information in the target graph structure, the processed data, and the initial hidden state, the state is updated using the gating mechanism of the gated recurrent unit to obtain a target hidden state; the initial hidden state is a hidden state determined based on the customer type in the customer data; Determining an initial customer churn probability using the fully connected layer in the initial customer churn prediction model and the target hidden state, and determining the gradient of the preset loss function with respect to the target model parameters in the initial customer churn prediction model based on the backpropagation algorithm and the initial customer churn probability; Updating the target model parameters based on the gradient and the gradient descent algorithm to obtain a target customer churn prediction model, and predicting the customer churn probability using the target customer churn prediction model to obtain a prediction result.

2. The customer churn prediction method in the financial scenario according to claim 1, wherein The performing standardized processing on the collected customer data to obtain processed data, and determining the Beta coefficient of the customer assets and the market return rate in the customer data. Based on the Beta coefficient and the processed data, a target graph structure including customer nodes and market nodes is constructed using a graph neural network, includes: Performing cleaning, standardization, and feature engineering processing on the collected customer data to obtain processed data, and determining the Beta coefficient based on the first return rate corresponding to the customer assets in the customer data and the second return rate corresponding to the target financial indicator; Constructing a preset graph structure based on a graph neural network, then generating customer nodes using the processed data and the Beta coefficient, and generating market nodes based on the target financial indicator, the volatility corresponding to the target investment index, and the Beta coefficient; Determining the modified cosine similarity between the current customer and other customers using the processed data, and determining the target number of customers with the highest similarity as target neighbors; Determining the Beta coefficient as the edge weight between the customer and the market, constructing an adjacency matrix based on the target neighbors, and then obtaining the target graph structure using the customer nodes, the market nodes, the edge weight, and the adjacency matrix.

3. The customer churn prediction method in a financial scenario according to claim 2, wherein The constructing an initial customer churn prediction model using the target graph structure and a gated recurrent unit. Based on the weighted neighbor information in the target graph structure, the processed data, and the initial hidden state, the state is updated using the gating mechanism of the gated recurrent unit to obtain a target hidden state, includes: Determining an initial hidden state based on the initial state determined based on the customer type in the customer data, and constructing an initial customer churn prediction model using the target graph structure and a gated recurrent unit; Perform weighted summation using the key features corresponding to the target neighbors in the target graph structure to obtain weighted neighbor information, and concatenate the weighted neighbor information, the processed data, and the initial hidden state to obtain an input vector; Input the input vector into the gated recurrent unit of the initial customer churn prediction model, and use the update gate and reset gate in the gated recurrent unit to update the state of the initial hidden state to obtain a target hidden state.

4. The method for predicting customer churn in a financial scenario according to claim 3, wherein The step of inputting the input vector into the gated recurrent unit of the initial customer churn prediction model and using the update gate and reset gate in the gated recurrent unit to update the state of the initial hidden state to obtain a target hidden state includes: Input the input vector into the gated recurrent unit of the initial customer churn prediction model, and then determine a first column matrix based on the input vector and using the update gate, the first weight matrix, the first Sigmoid activation function, and the first bias term in the gated recurrent unit; Determine a second column matrix based on the input vector and using the reset gate, the second weight matrix, the second Sigmoid activation function, and the second bias term in the gated recurrent unit; Use the second column matrix, the input vector, the third weight matrix, the hyperbolic tangent activation function, and the third bias term to determine a candidate hidden state; Determine the current hidden state at the current time step in the input vector based on the first column matrix, the initial hidden state, and the candidate hidden state, and determine the current hidden state as the initial hidden state at the next time step in the input vector, and then jump to the step of concatenating the weighted neighbor information, the processed data, and the initial hidden state to obtain an input vector until the number of state updates reaches the target state update threshold to obtain a target hidden state.

5. The customer churn prediction method in the financial scenario according to any one of claims 1 to 4, characterized in that The step of updating the state based on the weighted neighbor information, the processed data, and the initial hidden state in the target graph structure and using the gating mechanism of the gated recurrent unit to obtain a target hidden state includes: If the customer type in the customer data is a new customer, linearly interpolate the all-zero vector using the behavior data of the new customer to obtain an initial hidden state; If the customer type in the customer data is an existing customer, determine the initial hidden state based on the processed data corresponding to the existing customer; If the customer type in the customer data is a target customer with target similar customers, determine the cosine similarity between the target customer and the target similar customers, and determine whether the cosine similarity is greater than a preset similarity threshold; If the cosine similarity is greater than the preset similarity threshold, determine the initial hidden state of the target customer using the initial hidden state of the target similar customer and the cosine similarity.

6. The customer churn prediction method in the financial scenario according to claim 4, wherein Determining an initial customer churn probability by using the fully connected layer in the initial customer churn prediction model and the target hidden state, and determining the gradient of a preset loss function with respect to the target model parameters in the initial customer churn prediction model based on the backpropagation algorithm and the initial customer churn probability, includes: Determining the output result of the fully connected layer based on the target hidden state, using the fourth weight matrix and the fourth bias term of the fully connected layer in the initial customer churn prediction model, and determining the initial customer churn probability by using the third Sigmoid activation function and the output result of the fully connected layer; Using the binary cross-entropy loss function to determine the difference between the initial customer churn probability and the actual customer churn probability to obtain a loss value, and determining whether the loss value is less than a preset loss threshold; If the loss value is not less than the preset loss threshold, determining the first derivative of the binary cross-entropy loss function with respect to the initial customer churn probability, determining the second derivative of the initial customer churn probability with respect to the output result of the fully connected layer, and then determining the third derivative of the output result of the fully connected layer with respect to the fourth weight matrix; Determining the first gradient of the binary cross-entropy loss function with respect to the fourth weight matrix based on the first derivative, the second derivative, and the third derivative and using the chain rule; Determining the fourth derivative of the output result of the fully connected layer with respect to the fourth bias term, and determining the second gradient of the binary cross-entropy loss function with respect to the fourth bias term based on the first derivative, the second derivative, and the fourth derivative.

7. The customer churn prediction method in the financial scenario according to claim 6, characterized in that, Updating the target model parameters based on the gradient and the gradient descent algorithm to obtain a target customer churn prediction model, includes: Updating the fourth weight matrix and the fourth bias term respectively based on the first gradient and the second gradient and using the gradient descent algorithm to obtain a new fourth weight matrix and a new fourth bias term, and jumping to the step of determining the output result of the fully connected layer based on the target hidden state and using the fourth weight matrix and the fourth bias term of the fully connected layer in the initial customer churn prediction model, until the obtained loss value is less than the preset loss threshold or reaches the target update threshold, to obtain the target customer churn prediction model.

8. A customer churn prediction device in a financial scenario, characterized in that, Includes: A target graph structure construction module, configured to perform normalization processing on the collected customer data to obtain processed data, and determine the Beta coefficient of the customer assets and the market return rate in the customer data, and construct a target graph structure including customer nodes and market nodes by using a graph neural network based on the Beta coefficient and the processed data; A target hidden state determination module, configured to construct an initial customer churn prediction model by using the target graph structure and a gated recurrent unit, and update the state based on the weighted neighbor information in the target graph structure, the processed data, and the initial hidden state and using the gating mechanism of the gated recurrent unit to obtain a target hidden state; the initial hidden state is a hidden state determined based on the customer type in the customer data. A gradient determination module, configured to determine an initial customer churn probability by using a fully connected layer in the initial customer churn prediction model and the target hidden state, and determine a gradient of a preset loss function with respect to target model parameters in the initial customer churn prediction model based on a backpropagation algorithm and the initial customer churn probability; A model parameter update module, configured to update the target model parameters based on the gradient and a gradient descent algorithm to obtain a target customer churn prediction model, and predict a customer churn probability by using the target customer churn prediction model to obtain a prediction result.

9. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the customer churn prediction method in a financial scenario according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, For storing a computer program, wherein when the computer program is executed by a processor, the customer churn prediction method in a financial scenario according to any one of claims 1 to 7 is implemented.