Retention prediction method, device, equipment and medium based on heterogeneous graph neural network
Through the method based on heterogeneous graph neural network, the problem of insufficient sample size and poor quality in the agent customer channel network is solved. By constructing the initial heterogeneous graph neural network and data enhancement, the training effect and prediction accuracy of the model are improved. .
Patent Information
- Application Number
- CN202210063850.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-01-20
AI Technical Summary
In the agent's customer channel network mining, the sample size is insufficient and the quality is poor, and the existing data augmentation method is not suitable for relationship networks, resulting in poor model training results.
The retention prediction method based on heterogeneous graph neural network is adopted. By extracting independent variables and dependent variables from the relationship graph, an initial heterogeneous graph neural network is constructed, the initial samples and enhanced samples are obtained, and the model is trained after fusion to improve sample size and quality.
It improves the training effect and generalization ability of the model, enhances the robustness of the model, and improves the prediction accuracy.
Smart Images

Figure CN114416823B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a retention prediction method, device, equipment and medium based on a heterogeneous graph neural network. Background Art
[0002] Currently, when mining an agent's customer channel network, it is usually necessary to use deep learning methods to train the model.
[0003] In deep learning, it is generally required that the amount of sample data is sufficient. The more samples there are, the better the trained model will be and the stronger the generalization ability of the model will be. However, in actual training, the number of samples is usually insufficient and the sample quality is usually poor. Therefore, it is necessary to perform data enhancement on the samples to improve the sample quality.
[0004] There are already a large number of data enhancement methods in the image field, including image flipping, image rotation, image cropping, etc. However, when mining the agent's customer channel network, the relational network is used, and the existing data enhancement methods are not applicable to the relational network. Summary of the invention
[0005] The embodiments of the present invention provide a retention prediction method, apparatus, device and medium based on a heterogeneous graph neural network, aiming to solve the problems of insufficient sample size and poor quality in retention prediction scenarios.
[0006] In a first aspect, an embodiment of the present invention provides a retention prediction method based on a heterogeneous graph neural network, which includes:
[0007] In response to a retention prediction instruction, obtaining a first independent variable and a first dependent variable corresponding to the retention prediction instruction, and obtaining a relationship graph corresponding to the first independent variable;
[0008] Extracting a second independent variable and a second dependent variable corresponding to the second independent variable from the relationship diagram according to the first independent variable and the first dependent variable, and extracting at least one third independent variable;
[0009] Constructing an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable;
[0010] Acquire data corresponding to the first independent variable and the first dependent variable from the relationship diagram as an initial sample;
[0011] Acquire data corresponding to the second independent variable and the second dependent variable from the relationship graph as enhanced samples;
[0012] Fusing the initial sample and the enhanced sample to obtain a fused sample, and using the fused sample to train the initial heterogeneous graph neural network to obtain a retention prediction model;
[0013] The data to be processed corresponding to the target user is obtained, and the retention prediction model is used to analyze the data to be processed to obtain a retention prediction result of the target user.
[0014] According to a preferred embodiment of the present invention, the second independent variable is in a heterogeneous relationship with the first independent variable, the second dependent variable is in a homogeneous relationship with the first dependent variable, and the third independent variable is associated with both the first independent variable and the second independent variable.
[0015] According to a preferred embodiment of the present invention, constructing an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable includes:
[0016] Configure the input layer, matching layer, relationship aggregation layer and output layer connected end to end;
[0017] Obtaining the dimension of each of the first independent variable, the second independent variable, and the at least one third independent variable;
[0018] Get the variable corresponding to the smallest dimension from the dimensions of each variable and use it as the target variable;
[0019] When 2 to the power of n is less than or equal to the dimension of the target variable, and n is a positive integer, calculate the maximum value of n;
[0020] The calculated maximum value of n is determined as N;
[0021] Calculate the Nth power of 2 as the dimension of the matching layer;
[0022] The dimension of the relationship aggregation layer is configured as a preset dimension to obtain the initial heterogeneous graph neural network.
[0023] According to a preferred embodiment of the present invention, the using the fusion sample to train the initial heterogeneous graph neural network to obtain a retention prediction model includes:
[0024] Get the correspondence between the pre-configured sample size and the number of learning times;
[0025] Obtaining the sample size of the fused sample, and querying in the corresponding relationship according to the sample size of the fused sample to obtain a target number of learning times;
[0026] Randomly initialize each parameter in the initial heterogeneous graph neural network;
[0027] Inputting the fused sample into the initial heterogeneous graph neural network, and obtaining the output probability of the initial heterogeneous graph neural network;
[0028] Calculating the cross entropy loss of the initial heterogeneous graph neural network according to the output probability of the initial heterogeneous graph neural network;
[0029] Based on the cross entropy loss, the gradient descent method is used to iterate each parameter in the initial heterogeneous graph neural network until the number of iterations reaches the target learning number, and the training is stopped to obtain the retention prediction model.
[0030] According to a preferred embodiment of the present invention, when analyzing the data to be processed using the retention prediction model, the method further includes:
[0031] For the matching layer, obtaining the dimension of the data to be processed and obtaining the dimension of the matching layer;
[0032] Constructing a transformation matrix of the matching layer according to the dimension of the data to be processed and the dimension of the matching layer;
[0033] The data to be processed is subjected to matrix transformation based on the conversion matrix to obtain matching layer vector features.
[0034] According to a preferred embodiment of the present invention, when analyzing the data to be processed using the retention prediction model, the method further includes:
[0035] For the relationship aggregation layer, obtaining the first layer of the relationship aggregation layer, and determining the matching layer vector features as the relationship vector features of the first layer;
[0036] For other layers in the relationship aggregation layer except the first layer, obtaining a relationship propagation matrix of the relationship aggregation layer;
[0037] For each category node in each other layer, obtain a neighbor node set corresponding to the category node, and obtain an embedding vector of each neighbor node in the neighbor node set, wherein each node in the neighbor node set is directly connected to the category node;
[0038] Calculate the average value of the embedding vector of each neighbor node and use it as the relationship vector feature of the category node;
[0039] Performing matrix transformation on the relationship vector features of the category nodes using the relationship propagation matrix to obtain the relationship vector features of the corresponding category nodes in the next level of the other layer;
[0040] After obtaining the relationship vector features of each layer in the relationship aggregation layer, obtaining a neighbor aggregation matrix of the relationship aggregation layer;
[0041] The product of the relationship vector feature of each layer in the relationship aggregation layer and the neighbor aggregation matrix is calculated and used as the aggregation vector feature of the next level of each layer.
[0042] According to a preferred embodiment of the present invention, when analyzing the data to be processed using the retention prediction model, the method further includes:
[0043] For the output layer, obtaining a transformation matrix of the output layer;
[0044] The aggregated vector features are transformed using the transformation matrix of the output layer to obtain a transformation vector;
[0045] The conversion vector is processed using a sigmoid function to obtain a retention prediction result of the target user.
[0046] In a second aspect, an embodiment of the present invention provides a retention prediction device based on a heterogeneous graph neural network, which includes:
[0047] In response to a retention prediction instruction, obtaining a first independent variable and a first dependent variable corresponding to the retention prediction instruction, and obtaining a relationship graph corresponding to the first independent variable;
[0048] an extraction unit, configured to extract a second independent variable and a second dependent variable corresponding to the second independent variable from the relationship diagram according to the first independent variable and the first dependent variable, and to extract at least one third independent variable;
[0049] A construction unit, configured to construct an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable;
[0050] an acquisition unit, configured to acquire data corresponding to the first independent variable and the first dependent variable from the relationship diagram as an initial sample;
[0051] The acquisition unit is further used to acquire data corresponding to the second independent variable and the second dependent variable from the relationship diagram as enhanced samples;
[0052] A training unit, configured to fuse the initial sample and the enhanced sample to obtain a fused sample, and use the fused sample to train the initial heterogeneous graph neural network to obtain a retention prediction model;
[0053] The analysis unit is used to obtain the to-be-processed data corresponding to the target user, and analyze the to-be-processed data using the retention prediction model to obtain the retention prediction result of the target user.
[0054] In the third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the retention prediction method based on the heterogeneous graph neural network described in the first aspect is implemented.
[0055] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the retention prediction method based on the heterogeneous graph neural network described in the first aspect above.
[0056] The embodiments of the present invention provide a retention prediction method, apparatus, device and medium based on a heterogeneous graph neural network, which can respond to a retention prediction instruction, obtain a first independent variable and a first dependent variable corresponding to the retention prediction instruction, and obtain a relationship graph corresponding to the first independent variable, extract a second independent variable and a second dependent variable corresponding to the second independent variable from the relationship graph according to the first independent variable and the first dependent variable, and extract at least one third independent variable, construct an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable, and construct the initial heterogeneous graph neural network in combination with an actual scenario, so that a model obtained by subsequent training can better meet actual needs, obtain data corresponding to the first independent variable and the first dependent variable from the relationship graph as an initial sample, Data corresponding to the second independent variable and the second dependent variable are obtained from the relationship graph as enhanced samples, the initial samples and the enhanced samples are fused to obtain fused samples, and the fused samples are used to train the initial heterogeneous graph neural network to obtain a retention prediction model. The retention prediction model is obtained by training the fused samples after data enhancement. Since the sample size is sufficient, the training effect of the model is better, the generalization ability of the model is improved, and since the noise data is added, the robustness of the model is improved, thereby improving the accuracy of the model prediction, the data to be processed corresponding to the target user is obtained, and the retention prediction model is used to analyze the data to be processed to obtain the retention prediction result of the target user, and then the heterogeneous graph neural network is combined to realize data enhancement, and further realize accurate prediction of retention. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0058] Figure 1A schematic diagram of a flow chart of a retention prediction method based on a heterogeneous graph neural network provided in an embodiment of the present invention;
[0059] Figure 2 A schematic block diagram of a retention prediction device based on a heterogeneous graph neural network provided by an embodiment of the present invention;
[0060] Figure 3 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 creative work are within the scope of protection of the present invention.
[0062] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0063] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0064] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0065] See also Figure 1 , which is a flow chart of a retention prediction method based on a heterogeneous graph neural network provided in an embodiment of the present invention.
[0066] S10, in response to a retention prediction instruction, obtaining a first independent variable and a first dependent variable corresponding to the retention prediction instruction, and obtaining a relationship diagram corresponding to the first independent variable.
[0067] In at least one embodiment of the present invention, the retention prediction instruction may be triggered by a relevant department manager, salesperson, etc., which is not limited by the present invention.
[0068] For example, in a scenario of mining a customer channel network of an insurance sales agent, the retention prediction instruction may be triggered by the relevant insurance sales agent to determine whether the customer can be successfully retained.
[0069] It is understandable that when the retention prediction instruction is triggered, the independent variables and dependent variables corresponding to the retention prediction instruction will be uploaded synchronously.
[0070] For example, in the above example, the corresponding first independent variable may be the prospective recruitment, and the first dependent variable may be whether the recruitment is retained.
[0071] Furthermore, the retention prediction instruction may be parsed to obtain a database storing corresponding data, and a relationship graph corresponding to the first independent variable may be obtained from the database.
[0072] For example: in the above example, after parsing the retention prediction instruction, a target database for storing data is obtained, connected to the target database, and a relationship graph corresponding to the prospective recruits is obtained from the target database, wherein the relationship graph may include a three-way relationship between insurance sales agents, prospective recruits and customers. The present invention does not impose any restrictions on the node composition in the relationship graph.
[0073] S11, extracting a second independent variable and a second dependent variable corresponding to the second independent variable from the relationship diagram according to the first independent variable and the first dependent variable, and extracting at least one third independent variable.
[0074] In at least one embodiment of the present invention, the second independent variable is in a heterogeneous relationship with the first independent variable, the second dependent variable is in a homogeneous relationship with the first dependent variable, and the third independent variable is associated with both the first independent variable and the second independent variable.
[0075] It should be noted that the relationship graph is a heterogeneous graph, which is also called a heterogeneous relationship network. A heterogeneous relationship network refers to a relationship network with more than one node type or edge type. For example, the heterogeneous graph may include a user-item network, a customer-policy-agent return visit relationship network, etc. Most relationship networks in life are heterogeneous relationship networks, and heterogeneous relationship networks have broad potential application prospects.
[0076] Continuing with the above example, the first independent variable is the prospective new recruit, and the corresponding first dependent variable is whether the recruit is retained. Through the above conditions, the relationship diagram is a three-sided relationship diagram involving insurance sales agents, prospective new recruits and customers. Furthermore, in the relationship diagram, the insurance sales agent is obtained as the second independent variable, and whether the recruit is retained is the corresponding second dependent variable. Furthermore, the customer can be determined as the third dependent variable.
[0077] Through the above implementation, on the basis of the original independent variables and dependent variables, the data is further expanded based on the homogeneous relationships and heterogeneous relationships in the relationship graph to achieve data enhancement, so that there are sufficient samples for model training and the training effect of the model is improved.
[0078] S12: construct an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable.
[0079] In at least one embodiment of the present invention, constructing an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable comprises:
[0080] Configure the input layer, matching layer, relationship aggregation layer and output layer connected end to end;
[0081] Obtaining the dimension of each of the first independent variable, the second independent variable, and the at least one third independent variable;
[0082] Get the variable corresponding to the smallest dimension from the dimensions of each variable and use it as the target variable;
[0083] When 2 to the power of n is less than or equal to the dimension of the target variable, and n is a positive integer, calculate the maximum value of n;
[0084] The calculated maximum value of n is determined as N;
[0085] Calculate the Nth power of 2 as the dimension of the matching layer;
[0086] The dimension of the relationship aggregation layer is configured as a preset dimension to obtain the initial heterogeneous graph neural network.
[0087] For example: Continuing with the above example, when the dimension of the insurance agent is 400, the dimension of the customer is 300, and the dimension of the prospective recruit is 200, then, by comparison, 200 is the smallest dimension, and the prospective recruit corresponding to the dimension 200 is the target variable. The nth power of 2 is calculated to be less than or equal to the dimension 200 of the prospective recruit, n is a positive integer, and the maximum value is taken, then N is equal to 7, and the seventh power of 2 is calculated to be 128, and the dimension of the matching layer can be configured as 128.
[0088] It should be noted that if the dimension is too small, network information cannot be effectively transmitted, and if the dimension is too large, it is easy to cause over-smoothing (that is, the outputs of all nodes tend to be consistent due to excessive propagation of information). Therefore, the preset dimension can be configured to 2 to 3 layers according to actual needs.
[0089] It should be noted that, usually, different types of objects cannot be trained with one model at the same time due to their different attributes, portraits, etc. However, by constructing a heterogeneous graph neural network, different types of data can be mapped to the same space for processing, thereby achieving data enhancement.
[0090] Through the above implementation, the initial heterogeneous graph neural network is constructed in combination with actual scenarios, so that the model obtained by subsequent training can better meet actual needs.
[0091] S13: Acquire data corresponding to the first independent variable and the first dependent variable from the relationship diagram as an initial sample.
[0092] In at least one embodiment of the present invention, the relationship graph stores the association relationship of each node and the relevant data of each node.
[0093] For example: Continuing with the above example, if the first independent variable is the prospective recruit, the corresponding data may include the user profile of the prospective recruit, including: gender, age, education level, etc.; if the first dependent variable is whether the recruit is retained, the corresponding data may include: retained or not retained.
[0094] S14: Acquire data corresponding to the second independent variable and the second dependent variable from the relationship diagram as enhanced samples.
[0095] Similarly, continuing with the above example, if the second independent variable is the insurance sales agent, the corresponding data may include the user profile of the insurance sales agent, including: gender, age, education level, etc.; if the second dependent variable is whether to retain, the corresponding data may include: retained or not retained.
[0096] S15, fusing the initial sample and the enhanced sample to obtain a fused sample, and using the fused sample to train the initial heterogeneous graph neural network to obtain a retention prediction model.
[0097] In at least one embodiment of the present invention, fusing the initial sample and the enhanced sample to obtain a fused sample comprises:
[0098] The initial sample and the enhanced sample are combined together to obtain the fused sample.
[0099] For example, given the portrait information of n types of objects and the relationship network between different objects (i.e., heterogeneous relationship network), we now perform Class A prediction on Class A objects. At this time, if there are Class B objects with homogeneous Class A prediction targets, then the samples of Class B objects can be used as data enhancement for Class A models, that is, Class B objects can be added to the training samples through heterogeneous graph neural networks to enhance the samples.
[0100] Through the above implementation, the data of the initial samples can be enhanced by using enhanced samples in a data fusion manner, so as to obtain sufficient samples for training the model, thereby ensuring the training effect of the model.
[0101] In at least one embodiment of the present invention, the using the fusion sample to train the initial heterogeneous graph neural network to obtain a retention prediction model includes:
[0102] Get the correspondence between the pre-configured sample size and the number of learning times;
[0103] Obtaining the sample size of the fused sample, and querying in the corresponding relationship according to the sample size of the fused sample to obtain a target number of learning times;
[0104] Randomly initialize each parameter in the initial heterogeneous graph neural network;
[0105] Inputting the fused sample into the initial heterogeneous graph neural network, and obtaining the output probability of the initial heterogeneous graph neural network;
[0106] Calculating the cross entropy loss of the initial heterogeneous graph neural network according to the output probability of the initial heterogeneous graph neural network;
[0107] Based on the cross entropy loss, the gradient descent method is used to iterate each parameter in the initial heterogeneous graph neural network until the number of iterations reaches the target learning number, and the training is stopped to obtain the retention prediction model.
[0108] In this embodiment, the correspondence between the sample size and the number of learning times can be configured according to historical data.
[0109] For example, when the sample size is in the millions, the number of learning times can be configured to be 2 or 3 times; when the sample size is in the hundreds of thousands, the number of learning times can be configured to be greater than or equal to 10 times.
[0110] In this embodiment, each parameter in the initial heterogeneous graph neural network may include a conversion matrix of the matching layer, a relationship propagation matrix, a neighbor aggregation matrix, and a conversion matrix of the output layer.
[0111] Furthermore, Xavier can be used to initialize each parameter in the initial heterogeneous graph neural network, and the present invention does not limit the initialization method.
[0112] In this embodiment, the difference between the predicted value and the actual value can be calculated through the cross entropy loss.
[0113] Through the cross entropy loss, each parameter in the initial heterogeneous graph neural network is continuously iterated and optimized during the training process until the target learning number is reached, and then the iteration can be stopped to obtain the retention prediction model.
[0114] It should be noted that, in the matching layer of the trained retention prediction model, each dependent variable corresponds to a sublayer.
[0115] For example, in the customer channel network mining scenario of insurance sales agents described in this embodiment, the initial sample corresponding to the first independent variable quasi-recruitment corresponds to a matching sublayer, and the enhanced sample corresponding to the second independent variable insurance sales agent corresponds to a matching sublayer.
[0116] In the above implementation, the retention prediction model is obtained based on the fusion sample training after data enhancement. Since the sample size is sufficient, the training effect of the model is better, the generalization ability of the model is improved, and the robustness of the model is improved by adding noise data, thereby improving the accuracy of the model prediction.
[0117] S16, obtaining the to-be-processed data corresponding to the target user, and using the retention prediction model to analyze the to-be-processed data to obtain a retention prediction result for the target user.
[0118] In this embodiment, the target user refers to a user for whom it is necessary to predict whether he or she can be retained, such as one of the prospective recruits.
[0119] In this embodiment, the data to be processed corresponding to the target user includes portrait data of the target user, such as the gender, age, education level, etc. of the target user.
[0120] Specifically, when analyzing the data to be processed by using the retention prediction model, the method further includes:
[0121] For the matching layer, obtaining the dimension of the data to be processed and obtaining the dimension of the matching layer;
[0122] Constructing a transformation matrix of the matching layer according to the dimension of the data to be processed and the dimension of the matching layer;
[0123] The data to be processed is subjected to matrix transformation based on the conversion matrix to obtain matching layer vector features.
[0124] For example: The transformation matrix HM of the matching layer is constructed i It can be expressed as (D i ,H m ), where D i represents the dimension of the data to be processed, H mrepresents the dimension of the matching layer.
[0125] Furthermore, by multiplying the data to be processed by the transformation matrix, the data to be processed can be mapped to the same dimension H m , and obtain the matching layer vector feature.
[0126] Furthermore, when analyzing the data to be processed using the retention prediction model, the method further includes:
[0127] For the relationship aggregation layer, obtaining the first layer of the relationship aggregation layer, and determining the matching layer vector features as the relationship vector features of the first layer;
[0128] For other layers in the relationship aggregation layer except the first layer, obtaining a relationship propagation matrix of the relationship aggregation layer;
[0129] For each category node in each other layer, obtain a neighbor node set corresponding to the category node, and obtain an embedding vector of each neighbor node in the neighbor node set, wherein each node in the neighbor node set is directly connected to the category node;
[0130] Calculate the average value of the embedding vector of each neighbor node and use it as the relationship vector feature of the category node;
[0131] Performing matrix transformation on the relationship vector features of the category nodes using the relationship propagation matrix to obtain the relationship vector features of the corresponding category nodes in the next level of the other layer;
[0132] After obtaining the relationship vector features of each layer in the relationship aggregation layer, obtaining a neighbor aggregation matrix of the relationship aggregation layer;
[0133] The product of the relationship vector feature of each layer in the relationship aggregation layer and the neighbor aggregation matrix is calculated and used as the aggregation vector feature of the next level of each layer.
[0134] For example, we aggregate neighbor nodes by type, and number the node types from 1 to n. For a node i, let its neighbor node set be Nei i (node), calculate Nei i (node) is the average value of the embedding vector of the tth layer in the relationship aggregation layer, and then a matrix transformation is performed (multiplied by the relationship propagation matrix Rt) to obtain the node-level relationship vector features of this type of neighbors in the t+1 layer to achieve node-level aggregation.
[0135] Furthermore, neighbor nodes of different types are aggregated, that is, the relationship vector features of the t-th layer node level are multiplied by the neighbor aggregation matrix Agg to obtain the aggregation vector features of the t+1-th layer, so as to achieve semantic level aggregation.
[0136] In the above implementation, node-level aggregation and semantic-level aggregation are respectively performed in the relationship aggregation layer.
[0137] Furthermore, when analyzing the data to be processed using the retention prediction model, the method further includes:
[0138] For the output layer, obtaining a transformation matrix of the output layer;
[0139] The aggregated vector features are transformed using the transformation matrix of the output layer to obtain a transformation vector;
[0140] The conversion vector is processed using a sigmoid function to obtain a retention prediction result of the target user.
[0141] For example: the transformation matrix H of the output layer o It can be expressed as (Rt,1).
[0142] Through the above implementation, the retention prediction result of the target user is obtained by analyzing and processing the data to be processed layer by layer based on the retention prediction model.
[0143] Furthermore, the output probability of the retention prediction model is obtained. When the output probability is greater than or equal to the configured probability, the prediction result is that the target user will be retained. Conversely, when the output probability is less than the configured probability, the prediction result is that the target user will not be retained.
[0144] The configuration probability may be custom configured, such as 95%.
[0145] Of course, this embodiment can also be used for preference analysis.
[0146] For example: during the training process of the initial heterogeneous graph neural network, the neighbor aggregation matrix Agg of different neighbors is learned, and this matrix can be used for preference analysis. For example, in the customer channel network mining scenario of insurance sales agents mentioned above, the three-way relationship among agents, prospective recruits, and customers is involved. The prediction target is the retention of prospective recruits, and the retention of insurance agents can be used to enhance the relationship data of the original prospective recruit samples. Then, a preference analysis is performed in this scenario. For example, if the Agg matrix is {prospective recruits themselves: 0.5, customers: 0.2, insurance sales agents / referrers: 0.3}, it means that in addition to their own reasons, the stability of the recommender also has a great impact on the retention confidence of prospective recruits themselves.
[0147] It should be noted that the method in this embodiment can also be used for analysis in other scenarios.
[0148] For example, in the complaint risk identification scenario, the goal is to predict whether a customer is a high-risk customer. The risk relationship network of customer-policy-agent and the corresponding portrait data are known. At this time, the risk identification of the policy can be used as the dependent variable of the policy data, and the policy samples can be added to the training samples for data enhancement, and trained through the heterogeneous graph neural network.
[0149] For example, in the sales forecasting scenario, the goal is to predict the sales of the item next month. Given the customer-item purchase situation and the customer-item portrait data, a network of regular customer purchases of items and customers can be established. At this time, the user's purchase amount next month can be used as the dependent variable of the user object and trained through a heterogeneous graph neural network. Since the sales of items are directly related to the purchasing power of regular customers, a regular customer relationship network is established for data enhancement.
[0150] Furthermore, when conducting a preference analysis, for example, in the customer risk prediction scenario, the Agg matrix is {self: 0.5, other customers: 0.1, policy: 0.3, agent: 0.1}, which means that in addition to its own reasons, the policy risk also has a relatively large impact on customer risk.
[0151] It should be noted that in order to further ensure the security of data and prevent data from being maliciously tampered with, the retention prediction model can be stored on the blockchain node.
[0152] It can be seen from the above technical solutions that the present invention responds to a retention prediction instruction, obtains a first independent variable and a first dependent variable corresponding to the retention prediction instruction, and obtains a relationship graph corresponding to the first independent variable, extracts a second independent variable and a second dependent variable corresponding to the second independent variable from the relationship graph according to the first independent variable and the first dependent variable, and extracts at least one third independent variable, constructs an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable, constructs the initial heterogeneous graph neural network in combination with an actual scenario, so that the model obtained by subsequent training can better meet actual needs, obtains data corresponding to the first independent variable and the first dependent variable from the relationship graph as an initial sample, obtains data corresponding to the first independent variable and the first dependent variable from the relationship graph as an initial sample, and obtains data corresponding to the first independent variable and the first dependent variable from the relationship graph. The data corresponding to the second independent variable and the second dependent variable are used as enhanced samples, and the initial samples and the enhanced samples are fused to obtain fused samples, and the fused samples are used to train the initial heterogeneous graph neural network to obtain a retention prediction model. The retention prediction model is obtained by training the fused samples after data enhancement. Since the sample size is sufficient, the training effect of the model is better, the generalization ability of the model is improved, and the robustness of the model is improved due to the addition of noise data, thereby improving the accuracy of the model prediction, obtaining the data to be processed corresponding to the target user, and using the retention prediction model to analyze the data to be processed to obtain the retention prediction result of the target user, and then combining the heterogeneous graph neural network to realize data enhancement, and further realize accurate prediction of retention.
[0153] The embodiment of the present invention further provides a retention prediction device based on a heterogeneous graph neural network, which is used to execute any embodiment of the aforementioned retention prediction method based on a heterogeneous graph neural network. Figure 2 , Figure 2 It is a schematic block diagram of a retention prediction device based on a heterogeneous graph neural network provided in an embodiment of the present invention.
[0154] like Figure 2 As shown, the retention prediction device 100 based on the heterogeneous graph neural network includes: an acquisition unit 101, an extraction unit 102, a construction unit 103, a training unit 104, and an analysis unit 105.
[0155] In response to the retention prediction instruction, the acquisition unit 101 acquires a first independent variable and a first dependent variable corresponding to the retention prediction instruction, and acquires a relationship diagram corresponding to the first independent variable.
[0156] In at least one embodiment of the present invention, the retention prediction instruction may be triggered by a relevant department manager, salesperson, etc., which is not limited by the present invention.
[0157] For example, in a scenario of mining a customer channel network of an insurance sales agent, the retention prediction instruction may be triggered by the relevant insurance sales agent to determine whether the customer can be successfully retained.
[0158] It is understandable that when the retention prediction instruction is triggered, the independent variables and dependent variables corresponding to the retention prediction instruction will be uploaded synchronously.
[0159] For example, in the above example, the corresponding first independent variable may be the prospective recruitment, and the first dependent variable may be whether the recruitment is retained.
[0160] Furthermore, the retention prediction instruction may be parsed to obtain a database storing corresponding data, and a relationship graph corresponding to the first independent variable may be obtained from the database.
[0161] For example: in the above example, after parsing the retention prediction instruction, a target database for storing data is obtained, connected to the target database, and a relationship graph corresponding to the prospective recruits is obtained from the target database, wherein the relationship graph may include a three-way relationship between insurance sales agents, prospective recruits and customers. The present invention does not impose any restrictions on the node composition in the relationship graph.
[0162] The extraction unit 102 extracts a second independent variable and a second dependent variable corresponding to the second independent variable from the relationship diagram according to the first independent variable and the first dependent variable, and extracts at least one third independent variable.
[0163] In at least one embodiment of the present invention, the second independent variable is in a heterogeneous relationship with the first independent variable, the second dependent variable is in a homogeneous relationship with the first dependent variable, and the third independent variable is associated with both the first independent variable and the second independent variable.
[0164] It should be noted that the relationship graph is a heterogeneous graph, which is also called a heterogeneous relationship network. A heterogeneous relationship network refers to a relationship network with more than one node type or edge type. For example, the heterogeneous graph may include a user-item network, a customer-policy-agent return visit relationship network, etc. Most relationship networks in life are heterogeneous relationship networks, and heterogeneous relationship networks have broad potential application prospects.
[0165] Continuing with the above example, the first independent variable is the prospective new recruit, and the corresponding first dependent variable is whether the recruit is retained. Through the above conditions, the relationship diagram is a three-sided relationship diagram involving insurance sales agents, prospective new recruits and customers. Furthermore, in the relationship diagram, the insurance sales agent is obtained as the second independent variable, and whether the recruit is retained is the corresponding second dependent variable. Furthermore, the customer can be determined as the third dependent variable.
[0166] Through the above implementation, on the basis of the original independent variables and dependent variables, the data is further expanded based on the homogeneous relationships and heterogeneous relationships in the relationship graph to achieve data enhancement, so that there are sufficient samples for model training and the training effect of the model is improved.
[0167] The construction unit 103 constructs an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable.
[0168] In at least one embodiment of the present invention, the construction unit 103 constructs an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable, including:
[0169] Configure the input layer, matching layer, relationship aggregation layer and output layer connected end to end;
[0170] Obtaining the dimension of each of the first independent variable, the second independent variable, and the at least one third independent variable;
[0171] Get the variable corresponding to the smallest dimension from the dimensions of each variable and use it as the target variable;
[0172] When 2 to the power of n is less than or equal to the dimension of the target variable, and n is a positive integer, calculate the maximum value of n;
[0173] The calculated maximum value of n is determined as N;
[0174] Calculate the Nth power of 2 as the dimension of the matching layer;
[0175] The dimension of the relationship aggregation layer is configured as a preset dimension to obtain the initial heterogeneous graph neural network.
[0176] For example: Continuing with the above example, when the dimension of the insurance agent is 400, the dimension of the customer is 300, and the dimension of the prospective recruit is 200, then, by comparison, 200 is the smallest dimension, and the prospective recruit corresponding to the dimension 200 is the target variable. The nth power of 2 is calculated to be less than or equal to the dimension 200 of the prospective recruit, n is a positive integer, and the maximum value is taken, then N is equal to 7, and the seventh power of 2 is calculated to be 128, and the dimension of the matching layer can be configured as 128.
[0177] It should be noted that if the dimension is too small, network information cannot be effectively transmitted, and if the dimension is too large, it is easy to cause over-smoothing (that is, the outputs of all nodes tend to be consistent due to excessive propagation of information). Therefore, the preset dimension can be configured to 2 to 3 layers according to actual needs.
[0178] It should be noted that, usually, different types of objects cannot be trained with one model at the same time due to their different attributes, portraits, etc. However, by constructing a heterogeneous graph neural network, different types of data can be mapped to the same space for processing, thereby achieving data enhancement.
[0179] Through the above implementation, the initial heterogeneous graph neural network is constructed in combination with actual scenarios, so that the model obtained by subsequent training can better meet actual needs.
[0180] The acquisition unit 101 acquires data corresponding to the first independent variable and the first dependent variable from the relationship diagram as an initial sample.
[0181] In at least one embodiment of the present invention, the relationship graph stores the association relationship of each node and the relevant data of each node.
[0182] For example: Continuing with the above example, if the first independent variable is the prospective recruit, the corresponding data may include the user profile of the prospective recruit, including: gender, age, education level, etc.; if the first dependent variable is whether the recruit is retained, the corresponding data may include: retained or not retained.
[0183] The acquisition unit 101 acquires data corresponding to the second independent variable and the second dependent variable from the relationship graph as enhanced samples.
[0184] Similarly, continuing with the above example, if the second independent variable is the insurance sales agent, the corresponding data may include the user profile of the insurance sales agent, including: gender, age, education level, etc.; if the second dependent variable is whether to retain, the corresponding data may include: retained or not retained.
[0185] The training unit 104 fuses the initial sample and the enhanced sample to obtain a fused sample, and uses the fused sample to train the initial heterogeneous graph neural network to obtain a retention prediction model.
[0186] In at least one embodiment of the present invention, the training unit 104 fuses the initial sample and the enhanced sample to obtain a fused sample including:
[0187] The initial sample and the enhanced sample are combined together to obtain the fused sample.
[0188] For example, given the portrait information of n types of objects and the relationship network between different objects (i.e., heterogeneous relationship network), we now perform Class A prediction on Class A objects. At this time, if there are Class B objects with homogeneous Class A prediction targets, then the samples of Class B objects can be used as data enhancement for Class A models, that is, Class B objects can be added to the training samples through heterogeneous graph neural networks to enhance the samples.
[0189] Through the above implementation, the data of the initial samples can be enhanced by using enhanced samples in a data fusion manner, so as to obtain sufficient samples for training the model, thereby ensuring the training effect of the model.
[0190] In at least one embodiment of the present invention, the training unit 104 trains the initial heterogeneous graph neural network using the fusion sample to obtain the retention prediction model, including:
[0191] Get the correspondence between the pre-configured sample size and the number of learning times;
[0192] Obtaining the sample size of the fused sample, and querying in the corresponding relationship according to the sample size of the fused sample to obtain a target number of learning times;
[0193] Randomly initialize each parameter in the initial heterogeneous graph neural network;
[0194] Inputting the fused sample into the initial heterogeneous graph neural network, and obtaining the output probability of the initial heterogeneous graph neural network;
[0195] Calculating the cross entropy loss of the initial heterogeneous graph neural network according to the output probability of the initial heterogeneous graph neural network;
[0196] Based on the cross entropy loss, the gradient descent method is used to iterate each parameter in the initial heterogeneous graph neural network until the number of iterations reaches the target learning number, and the training is stopped to obtain the retention prediction model.
[0197] In this embodiment, the correspondence between the sample size and the number of learning times can be configured according to historical data.
[0198] For example, when the sample size is in the millions, the number of learning times can be configured to be 2 or 3 times; when the sample size is in the hundreds of thousands, the number of learning times can be configured to be greater than or equal to 10 times.
[0199] In this embodiment, each parameter in the initial heterogeneous graph neural network may include a conversion matrix of the matching layer, a relationship propagation matrix, a neighbor aggregation matrix, and a conversion matrix of the output layer.
[0200] Furthermore, Xavier can be used to initialize each parameter in the initial heterogeneous graph neural network, and the present invention does not limit the initialization method.
[0201] In this embodiment, the difference between the predicted value and the actual value can be calculated through the cross entropy loss.
[0202] Through the cross entropy loss, each parameter in the initial heterogeneous graph neural network is continuously iterated and optimized during the training process until the target learning number is reached, and then the iteration can be stopped to obtain the retention prediction model.
[0203] It should be noted that, in the matching layer of the trained retention prediction model, each dependent variable corresponds to a sublayer.
[0204] For example, in the customer channel network mining scenario of insurance sales agents described in this embodiment, the initial sample corresponding to the first independent variable quasi-recruitment corresponds to a matching sublayer, and the enhanced sample corresponding to the second independent variable insurance sales agent corresponds to a matching sublayer.
[0205] In the above implementation, the retention prediction model is obtained based on the fusion sample training after data enhancement. Since the sample size is sufficient, the training effect of the model is better, the generalization ability of the model is improved, and the robustness of the model is improved by adding noise data, thereby improving the accuracy of the model prediction.
[0206] The acquisition unit 101 acquires the to-be-processed data corresponding to the target user, and uses the retention prediction model to analyze the to-be-processed data to obtain a retention prediction result of the target user.
[0207] In this embodiment, the target user refers to a user for whom it is necessary to predict whether he or she can be retained, such as one of the prospective recruits.
[0208] In this embodiment, the data to be processed corresponding to the target user includes portrait data of the target user, such as the gender, age, education level, etc. of the target user.
[0209] Specifically, when the data to be processed is analyzed using the retention prediction model, for the matching layer, the dimension of the data to be processed is obtained, and the dimension of the matching layer is obtained;
[0210] Constructing a transformation matrix of the matching layer according to the dimension of the data to be processed and the dimension of the matching layer;
[0211] The data to be processed is subjected to matrix transformation based on the conversion matrix to obtain matching layer vector features.
[0212] For example: The transformation matrix HM of the matching layer is constructed i It can be expressed as (D i ,H m ), where D i represents the dimension of the data to be processed, H m represents the dimension of the matching layer.
[0213] Furthermore, by multiplying the data to be processed by the transformation matrix, the data to be processed can be mapped to the same dimension H m , and obtain the matching layer vector feature.
[0214] Further, when the retention prediction model is used to analyze the data to be processed, for the relationship aggregation layer, the first layer of the relationship aggregation layer is obtained, and the matching layer vector features are determined as the relationship vector features of the first layer;
[0215] For other layers in the relationship aggregation layer except the first layer, obtaining a relationship propagation matrix of the relationship aggregation layer;
[0216] For each category node in each other layer, obtain a neighbor node set corresponding to the category node, and obtain an embedding vector of each neighbor node in the neighbor node set, wherein each node in the neighbor node set is directly connected to the category node;
[0217] Calculate the average value of the embedding vector of each neighbor node and use it as the relationship vector feature of the category node;
[0218] Performing matrix transformation on the relationship vector features of the category nodes using the relationship propagation matrix to obtain the relationship vector features of the corresponding category nodes in the next level of the other layer;
[0219] After obtaining the relationship vector features of each layer in the relationship aggregation layer, obtaining a neighbor aggregation matrix of the relationship aggregation layer;
[0220] The product of the relationship vector feature of each layer in the relationship aggregation layer and the neighbor aggregation matrix is calculated and used as the aggregation vector feature of the next level of each layer.
[0221] For example, we aggregate neighbor nodes by type, and number the node types from 1 to n. For a node i, let its neighbor node set be Nei i (node), calculate Nei i (node) is the average value of the embedding vector of the tth layer in the relationship aggregation layer, and then a matrix transformation is performed (multiplied by the relationship propagation matrix Rt) to obtain the node-level relationship vector features of this type of neighbors in the t+1 layer to achieve node-level aggregation.
[0222] Furthermore, neighbor nodes of different types are aggregated, that is, the relationship vector features of the t-th layer node level are multiplied by the neighbor aggregation matrix Agg to obtain the aggregation vector features of the t+1-th layer, so as to achieve semantic level aggregation.
[0223] In the above implementation, node-level aggregation and semantic-level aggregation are respectively performed in the relationship aggregation layer.
[0224] Further, when the retention prediction model is used to analyze the data to be processed, for the output layer, a transformation matrix of the output layer is obtained;
[0225] The aggregated vector features are transformed using the transformation matrix of the output layer to obtain a transformation vector;
[0226] The conversion vector is processed using a sigmoid function to obtain a retention prediction result of the target user.
[0227] For example: the transformation matrix H of the output layer o It can be expressed as (Rt,1).
[0228] Through the above implementation, the retention prediction result of the target user is obtained by analyzing and processing the data to be processed layer by layer based on the retention prediction model.
[0229] Furthermore, the output probability of the retention prediction model is obtained. When the output probability is greater than or equal to the configured probability, the prediction result is that the target user will be retained. Conversely, when the output probability is less than the configured probability, the prediction result is that the target user will not be retained.
[0230] The configuration probability may be custom configured, such as 95%.
[0231] Of course, this embodiment can also be used for preference analysis.
[0232] For example: during the training process of the initial heterogeneous graph neural network, the neighbor aggregation matrix Agg of different neighbors is learned, and this matrix can be used for preference analysis. For example, in the customer channel network mining scenario of insurance sales agents mentioned above, the three-way relationship among agents, prospective recruits, and customers is involved. The prediction target is the retention of prospective recruits, and the retention of insurance agents can be used to enhance the relationship data of the original prospective recruit samples. Then, a preference analysis is performed in this scenario. For example, if the Agg matrix is {prospective recruits themselves: 0.5, customers: 0.2, insurance sales agents / referrers: 0.3}, it means that in addition to their own reasons, the stability of the recommender also has a great impact on the retention confidence of prospective recruits themselves.
[0233] It should be noted that the method in this embodiment can also be used for analysis in other scenarios.
[0234] For example, in the complaint risk identification scenario, the goal is to predict whether a customer is a high-risk customer. The risk relationship network of customer-policy-agent and the corresponding portrait data are known. At this time, the risk identification of the policy can be used as the dependent variable of the policy data, and the policy samples can be added to the training samples for data enhancement, and trained through the heterogeneous graph neural network.
[0235] For example, in the sales forecasting scenario, the goal is to predict the sales of the item next month. Given the customer-item purchase situation and the customer-item portrait data, a network of regular customer purchases of items and customers can be established. At this time, the user's purchase amount next month can be used as the dependent variable of the user object and trained through a heterogeneous graph neural network. Since the sales of items are directly related to the purchasing power of regular customers, a regular customer relationship network is established for data enhancement.
[0236] Furthermore, when conducting a preference analysis, for example, in the customer risk prediction scenario, the Agg matrix is {self: 0.5, other customers: 0.1, policy: 0.3, agent: 0.1}, which means that in addition to its own reasons, the policy risk also has a relatively large impact on customer risk.
[0237] It should be noted that in order to further ensure the security of data and prevent data from being maliciously tampered with, the retention prediction model can be stored on the blockchain node.
[0238] It can be seen from the above technical solutions that the present invention can respond to a retention prediction instruction, obtain a first independent variable and a first dependent variable corresponding to the retention prediction instruction, and obtain a relationship graph corresponding to the first independent variable, extract a second independent variable and a second dependent variable corresponding to the second independent variable from the relationship graph according to the first independent variable and the first dependent variable, and extract at least one third independent variable, construct an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable, and construct the initial heterogeneous graph neural network in combination with actual scenarios, so that the model obtained by subsequent training can better meet actual needs, obtain data corresponding to the first independent variable and the first dependent variable from the relationship graph as an initial sample, and obtain data corresponding to the first independent variable and the first dependent variable from the relationship graph as an initial sample. The data corresponding to the second independent variable and the second dependent variable are used as enhanced samples, the initial samples and the enhanced samples are fused to obtain fused samples, and the fused samples are used to train the initial heterogeneous graph neural network to obtain a retention prediction model. The retention prediction model is obtained by training the fused samples after data enhancement. Since the sample size is sufficient, the training effect of the model is better, the generalization ability of the model is improved, and the robustness of the model is improved due to the addition of noise data, thereby improving the accuracy of the model prediction, obtaining the data to be processed corresponding to the target user, and using the retention prediction model to analyze the data to be processed to obtain the retention prediction result of the target user, and then combining the heterogeneous graph neural network to realize data enhancement, and further realize accurate prediction of retention.
[0239] The above-mentioned retention prediction device based on heterogeneous graph neural network can be implemented in the form of a computer program, and the computer program can be used in Figure 3 Runs on the computer device shown.
[0240] See also Figure 3 , Figure 3 5 is a schematic block diagram of a computer device provided in an embodiment of the present invention. The computer device 500 is a server, which can be an independent server or a server cluster composed of multiple servers. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0241] Among them, Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0242] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0243] See also Figure 3 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a storage medium 503 and an internal memory 504 .
[0244] The storage medium 503 may store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 may execute a retention prediction method based on a heterogeneous graph neural network.
[0245] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0246] The internal memory 504 provides an environment for the operation of the computer program 5032 in the storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute the retention prediction method based on the heterogeneous graph neural network.
[0247] The network interface 505 is used for network communication, such as providing data information transmission, etc. Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 500 to which the solution of the present invention is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0248] The processor 502 is used to run a computer program 5032 stored in a memory to implement the retention prediction method based on a heterogeneous graph neural network disclosed in an embodiment of the present invention.
[0249] Those skilled in the art will understand that Figure 3 The embodiments of the computer device shown in the figure do not constitute a limitation on the specific composition of the computer device. In other embodiments, the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, in some embodiments, the computer device may only include a memory and a processor. In such embodiments, the structure and function of the memory and the processor are the same as those of the embodiment of the present invention. Figure 3The embodiments shown are consistent and will not be described again here.
[0250] It should be understood that in the embodiment of the present invention, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0251] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the retention prediction method based on a heterogeneous graph neural network disclosed in an embodiment of the present invention is implemented.
[0252] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0253] It should be noted that the data involved in this case were all obtained legally.
[0254] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment, devices and units can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel 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 the present invention.
[0255] In the several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. Units with the same function may also be combined into one unit. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be an electrical, mechanical or other form of connection.
[0256] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0257] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can 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 invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0258] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0259] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), disk or optical disk and other media that can store program codes.
[0260] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A retention prediction method based on heterogeneous graph neural network, characterized in that: include: In response to a retention prediction instruction, obtaining a first independent variable and a first dependent variable corresponding to the retention prediction instruction, and obtaining a relationship graph corresponding to the first independent variable; Extracting a second independent variable and a second dependent variable corresponding to the second independent variable from the relationship diagram according to the first independent variable and the first dependent variable, and extracting at least one third independent variable; Constructing an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable; Acquire data corresponding to the first independent variable and the first dependent variable from the relationship diagram as an initial sample; Acquire data corresponding to the second independent variable and the second dependent variable from the relationship graph as enhanced samples; Fusing the initial sample and the enhanced sample to obtain a fused sample, and using the fused sample to train the initial heterogeneous graph neural network to obtain a retention prediction model; Acquire the to-be-processed data corresponding to the target user, and analyze the to-be-processed data using the retention prediction model to obtain a retention prediction result for the target user; The constructing of an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable comprises: Configure the input layer, matching layer, relationship aggregation layer and output layer connected end to end; Obtaining the dimension of each of the first independent variable, the second independent variable, and the at least one third independent variable; Get the variable corresponding to the smallest dimension from the dimensions of each variable and use it as the target variable; When 2 to the power of n is less than or equal to the dimension of the target variable, and n is a positive integer, calculate the maximum value of n; The calculated maximum value of n is determined as N; Calculate the Nth power of 2 as the dimension of the matching layer; Configuring the dimension of the relationship aggregation layer to be a preset dimension to obtain the initial heterogeneous graph neural network; When analyzing the data to be processed by using the retention prediction model, the method further includes: For the relationship aggregation layer, obtaining the first layer of the relationship aggregation layer, and determining the matching layer vector features as the relationship vector features of the first layer; For other layers in the relationship aggregation layer except the first layer, obtaining a relationship propagation matrix of the relationship aggregation layer; For each category node in each other layer, obtain a neighbor node set corresponding to the category node, and obtain an embedding vector of each neighbor node in the neighbor node set, wherein each node in the neighbor node set is directly connected to the category node; Calculate the average value of the embedding vector of each neighbor node and use it as the relationship vector feature of the category node; Performing matrix transformation on the relationship vector features of the category nodes using the relationship propagation matrix to obtain the relationship vector features of the corresponding category nodes in the next level of the other layer; After obtaining the relationship vector features of each layer in the relationship aggregation layer, obtaining a neighbor aggregation matrix of the relationship aggregation layer; Calculate the product of the relationship vector feature of each layer in the relationship aggregation layer and the neighbor aggregation matrix, and use it as the aggregation vector feature of the next level of each layer; Among them, the first independent variable is the prospective recruit, the first dependent variable is whether to retain, the second independent variable is the insurance sales agent, the second dependent variable is whether to retain, and the third independent variable is the customer.
2. The retention prediction method based on heterogeneous graph neural network according to claim 1 is characterized in that: The second independent variable is in a heterogeneous relationship with the first independent variable, the second dependent variable is in a homogeneous relationship with the first dependent variable, and the third independent variable is associated with both the first independent variable and the second independent variable.
3. The retention prediction method based on heterogeneous graph neural network according to claim 1 is characterized in that: The using the fusion sample to train the initial heterogeneous graph neural network to obtain a retention prediction model includes: Get the correspondence between the pre-configured sample size and the number of learning times; Obtaining the sample size of the fused sample, and querying in the corresponding relationship according to the sample size of the fused sample to obtain a target number of learning times; Randomly initialize each parameter in the initial heterogeneous graph neural network; Inputting the fused sample into the initial heterogeneous graph neural network, and obtaining the output probability of the initial heterogeneous graph neural network; Calculating the cross entropy loss of the initial heterogeneous graph neural network according to the output probability of the initial heterogeneous graph neural network; Based on the cross entropy loss, the gradient descent method is used to iterate each parameter in the initial heterogeneous graph neural network until the number of iterations reaches the target learning number, and the training is stopped to obtain the retention prediction model.
4. The retention prediction method based on heterogeneous graph neural network according to claim 1 is characterized in that: When analyzing the data to be processed by using the retention prediction model, the method further includes: For the matching layer, obtaining the dimension of the data to be processed and obtaining the dimension of the matching layer; Constructing a transformation matrix of the matching layer according to the dimension of the data to be processed and the dimension of the matching layer; The data to be processed is subjected to matrix transformation based on the conversion matrix to obtain matching layer vector features.
5. The retention prediction method based on heterogeneous graph neural network according to claim 1 is characterized in that: When analyzing the data to be processed by using the retention prediction model, the method further includes: For the output layer, obtaining a transformation matrix of the output layer; The aggregated vector features are transformed using the transformation matrix of the output layer to obtain a transformation vector; The conversion vector is processed using a sigmoid function to obtain a retention prediction result of the target user.
6. A retention prediction device based on heterogeneous graph neural network, characterized in that: include: an acquisition unit, configured to, in response to a retention prediction instruction, acquire a first independent variable and a first dependent variable corresponding to the retention prediction instruction, and acquire a relationship graph corresponding to the first independent variable; an extraction unit, configured to extract a second independent variable and a second dependent variable corresponding to the second independent variable from the relationship diagram according to the first independent variable and the first dependent variable, and to extract at least one third independent variable; A construction unit, configured to construct an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable; The acquisition unit is further used to acquire data corresponding to the first independent variable and the first dependent variable from the relationship diagram as an initial sample; The acquisition unit is further used to acquire data corresponding to the second independent variable and the second dependent variable from the relationship diagram as enhanced samples; A training unit, configured to fuse the initial sample and the enhanced sample to obtain a fused sample, and use the fused sample to train the initial heterogeneous graph neural network to obtain a retention prediction model; An analysis unit, configured to obtain the to-be-processed data corresponding to the target user, and analyze the to-be-processed data using the retention prediction model to obtain a retention prediction result for the target user; The constructing of an initial heterogeneous graph neural network according to the first independent variable, the second independent variable and the at least one third independent variable comprises: Configure the input layer, matching layer, relationship aggregation layer and output layer connected end to end; Obtaining the dimension of each of the first independent variable, the second independent variable, and the at least one third independent variable; Get the variable corresponding to the smallest dimension from the dimensions of each variable and use it as the target variable; When 2 to the power of n is less than or equal to the dimension of the target variable, and n is a positive integer, calculate the maximum value of n; The calculated maximum value of n is determined as N; Calculate the Nth power of 2 as the dimension of the matching layer; Configuring the dimension of the relationship aggregation layer to be a preset dimension to obtain the initial heterogeneous graph neural network; When analyzing the data to be processed by using the retention prediction model, the device further includes: For the relationship aggregation layer, obtaining the first layer of the relationship aggregation layer, and determining the matching layer vector features as the relationship vector features of the first layer; For other layers in the relationship aggregation layer except the first layer, obtaining a relationship propagation matrix of the relationship aggregation layer; For each category node in each other layer, obtain a neighbor node set corresponding to the category node, and obtain an embedding vector of each neighbor node in the neighbor node set, wherein each node in the neighbor node set is directly connected to the category node; Calculate the average value of the embedding vector of each neighbor node and use it as the relationship vector feature of the category node; Performing matrix transformation on the relationship vector features of the category nodes using the relationship propagation matrix to obtain the relationship vector features of the corresponding category nodes in the next level of the other layer; After obtaining the relationship vector features of each layer in the relationship aggregation layer, obtaining a neighbor aggregation matrix of the relationship aggregation layer; Calculate the product of the relationship vector feature of each layer in the relationship aggregation layer and the neighbor aggregation matrix, and use it as the aggregation vector feature of the next level of each layer; Among them, the first independent variable is the prospective recruit, the first dependent variable is whether to retain, the second independent variable is the insurance sales agent, the second dependent variable is whether to retain, and the third independent variable is the customer.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the retention prediction method based on the heterogeneous graph neural network as described in any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to execute the retention prediction method based on a heterogeneous graph neural network as described in any one of claims 1 to 5.
