Multi-relation chain age prediction method, device and equipment based on random walk
By building a relationship chain for each user behavior and using a random walk algorithm to process unknown age nodes, and combining the age prediction model for weighted summing, the problems of large calculation volume, low efficiency and poor adaptability in the prior art are solved, and efficient and accurate age prediction is achieved.
Patent Information
- Application Number
- CN202411599012.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-28
AI Technical Summary
The existing age prediction methods have large calculation volume and low calculation efficiency, and are poorly adaptable to business changes.
A multi-relational chain age prediction method based on random walk is used to analyze the user behavior log, a relationship chain is built for each user behavior, and a random walk algorithm is processed on unknown age nodes, the initial age prediction value is determined, and the age prediction model is input for weighted summing to obtain the final predicted age.
The calculation amount during age prediction is reduced, the calculation efficiency and adaptability to business changes are improved, and the accuracy of age prediction is improved.
Smart Images

Figure CN119539845A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a method, device and equipment for predicting age of multiple relationship chains based on random walk. Background Art
[0002] Age prediction is a very important variable in marketing or advertising, but in practical applications, this feature value is often missing. In order to solve this problem, it is necessary to predict the user's age. The most primitive way to deal with it is to fill it with the context average and median.
[0003] At present, there is another common method, which is to build a relationship chain based on various user behaviors, and then use a series of methods such as similarity weighting based on the first-degree and second-degree connections in the relationship chain to predict age. However, this method has the following disadvantages:
[0004] The amount of calculation is very large and the calculation time is long. When the number of users is over 100 million, the single relationship chain constructed will be very large. When calculating the first-degree and second-degree connections, it is impossible to calculate in parallel and the complexity is high. When adding a new relationship, the relationship chain needs to be reconstructed, which is a large workload and has poor adaptability to business changes. User behavior occurs every day, which means that the relationship chain changes every day, but the frequency of change is inconsistent. At this time, if it is updated at a fixed frequency, the browsed information will not be reflected in the chain in time, and the shared chain is relatively stable and does not need to be updated, resulting in repeated calculations. In summary, the current age prediction method has the problems of large amount of calculation, low calculation efficiency, and poor adaptability to business changes. Summary of the invention
[0005] The embodiments of the present invention provide a multi-relationship chain age prediction method, device and equipment based on random walk, which are used to reduce the amount of calculation during age prediction, improve calculation efficiency and adaptability to business changes.
[0006] In a first aspect, an embodiment of the present invention provides a multi-relationship chain age prediction method based on random walk, the method comprising:
[0007] Perform user analysis on the acquired user behavior logs and build a relationship chain for each user behavior;
[0008] For each relationship chain, the following process is performed for each node of unknown age in the relationship chain: first-degree connections and second-degree connections of the node of unknown age are screened in the relationship chain, and the first-degree connections and second-degree connections are all nodes with known ages; starting from the node of unknown age, a random walk algorithm is used to walk in the first-degree connections and second-degree connections, and the walked nodes with known ages are added to the traversal sequence until the termination condition is reached, so as to obtain the final traversal sequence of the node of unknown age; according to the age values of all nodes with known ages in the final traversal sequence, the initial predicted age value of the node of unknown age in the relationship chain is determined;
[0009] For each node with unknown age, the initial predicted age value of the node with unknown age in each relationship chain is input into the age prediction model for prediction to obtain the final predicted age of the node with unknown age.
[0010] Furthermore, starting from the node with unknown age, walking among the first-degree connections and the second-degree connections using a random walk algorithm, and adding the walked nodes with known age to the traversal sequence comprises:
[0011] Determine a plurality of adjacent edges of the node with unknown age according to the first-degree connections and the second-degree connections, wherein one of the adjacent edges includes at least one first-degree connection and one second-degree connection;
[0012] Starting from the node with unknown age, a random walk algorithm is used to select an untraversed adjacent edge for traversal, and the node with known age corresponding to the traversed adjacent edge is added to the traversal sequence.
[0013] Furthermore, determining the initial predicted age value of the node with unknown age in the relationship chain according to the age values of all nodes with known age in the final traversal sequence includes:
[0014] The average of the age values of all nodes with known ages in the final traversal sequence is determined as the initial predicted age value of the node with unknown age in the relationship chain.
[0015] Furthermore, the step of inputting the initial predicted age value of the unknown age node in each relationship chain into the age prediction model for prediction to obtain the final predicted age of the unknown age node includes:
[0016] Inputting the initial predicted age value of the unknown age node in each relationship chain into the age prediction model;
[0017] The weight value corresponding to each user behavior stored in the age prediction model and the initial predicted age value of the unknown age node in each relationship chain are used to perform weighted summation to obtain the final predicted age of the unknown age node;
[0018] The weight value corresponding to each user behavior stored in the age prediction model is obtained by training the machine learning model.
[0019] Furthermore, the training process of the age prediction model includes:
[0020] Obtaining sample user behavior logs, and constructing a relationship chain for each user behavior; the sample user behavior logs include sample nodes and the real age of the sample nodes;
[0021] For each relationship chain, assuming that the sample node is a node with unknown age, the first-degree sample connections and second-degree sample connections of the sample node are screened in the relationship chain, and the random walk algorithm is used to walk in the first-degree sample connections and second-degree sample connections, and the walked nodes with known age are added to the traversal sequence until the termination condition is reached, thereby obtaining the sample traversal sequence of the sample node; according to the age values of all nodes with known age in the sample traversal sequence, the initial predicted value of the sample age of the sample node in the relationship chain is determined;
[0022] Inputting the initial predicted value of the sample age of the sample node in each relationship chain and the real age into the machine learning model to be trained for iterative training to obtain the model parameters of each relationship chain;
[0023] The model parameters of each relationship chain are determined as weight values corresponding to each user behavior, and the machine learning model including the model parameters of each relationship chain is used as an age prediction model.
[0024] Furthermore, the machine learning model is an XGBoost model.
[0025] Furthermore, the user behaviors include browsing, clicking, donating, and sharing.
[0026] In a second aspect, an embodiment of the present invention provides a multi-relationship chain age prediction device based on random walk, the device comprising:
[0027] The relationship chain building module is used to perform user analysis on the acquired user behavior logs and build a relationship chain for each user behavior;
[0028] The random walk module is used to perform the following process for each unknown age node in each relationship chain: screening the first-degree connections and second-degree connections of the unknown age node in the relationship chain, wherein the first-degree connections and second-degree connections are all nodes with known ages; starting from the unknown age node, using a random walk algorithm to walk in the first-degree connections and second-degree connections, adding the walked nodes with known ages to a traversal sequence until a termination condition is reached, thereby obtaining a final traversal sequence of the unknown age node; determining an initial predicted age value of the unknown age node in the relationship chain according to the age values of all nodes with known ages in the final traversal sequence;
[0029] The age prediction module is used to input the initial predicted age value of each unknown age node in each relationship chain into the age prediction model for prediction to obtain the final predicted age of the unknown age node.
[0030] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to implement the steps of any of the above-mentioned multi-relationship chain age prediction methods based on random walks when executing the computer program stored in the memory.
[0031] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-mentioned multi-relationship chain age prediction method based on random walk.
[0032] Since the user behavior logs obtained in the embodiment of the present invention are analyzed by users, a relationship chain is constructed for each user behavior; for each relationship chain, the following process is performed for each unknown age node in the relationship chain: the first-degree connections and second-degree connections of the unknown age node are screened in the relationship chain, and the first-degree connections and second-degree connections are all nodes with known ages; starting from the unknown age node, a random walk algorithm is used to walk in the first-degree connections and second-degree connections, and the walked nodes with known ages are added to the traversal sequence until the termination condition is reached, so as to obtain the final traversal sequence of the unknown age node; according to the age values of all the known age nodes in the final traversal sequence, the initial predicted age value of the unknown age node in the relationship chain is determined; then, for each unknown age node, the initial predicted age value of the unknown age node in each relationship chain is input into the age prediction model for prediction, so as to obtain the final predicted age of the unknown age node. In this invention, a relationship chain is constructed for each user behavior. When a new user behavior relationship is added, only a separate relationship chain needs to be constructed for the new relationship. There is no need to reconstruct the existing relationship chain. This can better adapt to business changes, and the frequency of user behavior changes represented by each relationship chain is consistent. Therefore, the amount of calculation can be reduced and the calculation efficiency can be improved. By adopting a random walk strategy, the problem of node selection can be avoided and the accuracy of age prediction can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0034] Figure 1 A schematic diagram of a process of a multi-relationship chain age prediction method based on random walk provided by an embodiment of the present invention;
[0035] Figure 2 A schematic diagram of the structure of a multi-relationship chain age prediction device based on random walk provided by an embodiment of the present invention;
[0036] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] In order to reduce the amount of calculation during age prediction, improve calculation efficiency and adaptability to business changes, the embodiments of the present invention provide a multi-relationship chain age prediction method, device and equipment based on random walk.
[0039] Embodiment 1:
[0040] Figure 1 A schematic diagram of a process of a multi-relationship chain age prediction method based on random walk provided by an embodiment of the present invention, the process includes the following steps:
[0041] S101: Perform user analysis on the acquired user behavior logs and construct a relationship chain for each user behavior.
[0042] S102: For each relationship chain, the following process is performed for each node of unknown age in the relationship chain: the first-degree connections and second-degree connections of the node of unknown age are screened in the relationship chain, where the first-degree connections and second-degree connections are all nodes with known ages; starting from the node of unknown age, a random walk algorithm is used to walk through the first-degree connections and second-degree connections, and the walked nodes with known ages are added to the traversal sequence until the termination condition is reached, thereby obtaining the final traversal sequence of the node of unknown age; based on the age values of all nodes with known ages in the final traversal sequence, an initial predicted age value of the node of unknown age in the relationship chain is determined.
[0043] S103: For each node with unknown age, the initial predicted age value of the node with unknown age in each relationship chain is input into the age prediction model for prediction, so as to obtain the final predicted age of the node with unknown age.
[0044] Since a relationship chain is constructed for each user behavior in the embodiment of the present invention, when a new user behavior relationship is added, only a separate relationship chain needs to be constructed for the new relationship, and there is no need to reconstruct the existing relationship chain. This can better adapt to business changes, and the frequency of user behavior changes represented by each relationship chain is consistent, so the amount of calculation can be reduced and the calculation efficiency can be improved. In addition, by adopting a random walk strategy, the problem of node selection can be avoided, and the accuracy of age prediction can be improved.
[0045] The multi-relationship chain age prediction method based on random walk provided by the embodiment of the present invention is applied to electronic devices, which can be specifically smart terminals, PCs, tablet computers and other devices. In one possible scenario, a crowdfunding platform or an Internet hospital platform is installed in the electronic device, and the crowdfunding platform or the Internet hospital platform uses the method provided by the embodiment of the present invention to realize the function of age prediction. In addition to this scenario, the method provided by the embodiment of the present invention can also be used in other scenarios where age prediction is required.
[0046] In one possible implementation, in the above S101, all user behavior logs may be processed, behavior data of each user behavior may be extracted, and behavior data sets of each user behavior may be generated, and then a relationship chain may be constructed separately for each user behavior based on the behavior data sets of each user behavior. For example, user behaviors include browsing, clicking, donating, and sharing. Accordingly, in the above implementation, browsing, clicking, donating, and sharing behavior data may be extracted, and then a relationship chain may be constructed separately based on each data set of browsing, clicking, donating, and sharing.
[0047] When building a traditional relationship chain, all relationships are built into a complete and complex chain. For example, browsing, clicking, donating and sharing are built into a relationship chain. Different from the traditional relationship chain construction method, the embodiment of the present invention constructs a relationship chain for each user relationship (i.e., each user behavior), for example, a relationship chain is constructed based on each relationship of browsing, clicking, donating and sharing, and a total of 4 relationship chains are constructed. One relationship chain corresponds to one relationship and is a subset of the relationship chains constructed by all users. When building a relationship chain, the relationship chains can be calculated in parallel. When adding a new relationship, only the relationship chain corresponding to the relationship needs to be added, which can flexibly respond to business changes. And when updating the relationship chain, the corresponding update frequency can be set according to the number of behaviors. For example, the more behaviors, the higher the update frequency of the relationship chain, and the fewer behaviors, the lower the update frequency of the relationship chain. After experimental verification, the embodiment of the present invention is 9 times faster than the traditional method, the required resources are halved, and the resource utilization rate is increased by 5 times. The reason is that the complexity of traditional calculation of second-degree connections is an exponential growth, and the memory requirement is too large. Memory overflow occasionally occurs when building a large relationship chain.
[0048] The relationship chain can be represented in the form of a graph. When creating the relationship chain, for example, a tool such as Spark GraphX can be used to create it.
[0049] When predicting age traditionally, the first-degree and second-degree connections of each node are all added to the correlation calculation, but there are weak or even negative correlations between the age and the user in these nodes, which will affect the accuracy of age prediction. In the above S102, the random walk algorithm is used to randomly walk in each node to select similar node users, which can avoid the problem of node selection. And after experimental verification, in the case of large data volume, the effect of random walk is very small compared with the result of similarity calculation using the full amount of data, so it can avoid selecting nodes with weak or even negative correlation with the user, thereby improving the accuracy of age prediction. The specific experimental verification is as follows: by randomly sampling 100 predictions of each age group of 20-30, 30-40, 40-50, 50-60, 60-70, and 70 and above, the error between the predicted age and the real age is as follows: the error of 1 year accounts for 27%, the error of 2 years accounts for 35%, the error of 3 years accounts for 21, the error of 4 years accounts for 11%, and the error of 5 years and above accounts for 6%.
[0050] In one possible implementation, in the above S102, when screening the first-degree connections and second-degree connections of the node with unknown age in the relationship chain, the neighboring nodes of the node with unknown age can be screened as the first-degree connections among all the nodes with known age in the relationship chain, and then the neighboring nodes of the neighboring edges can be used as the second-degree connections, that is, the first-degree connections are the connections directly connected to the node with unknown age, and the second-degree connections are the connections indirectly connected to the node with unknown age through the first-degree connections.
[0051] Starting from the node with unknown age, a random walk algorithm is used to traverse the first-degree connections and the second-degree connections. When the traversed nodes with known age are added to the traversal sequence, multiple neighboring edges of the node with unknown age can be determined based on the first-degree connections and the second-degree connections. One neighboring edge includes at least one first-degree connection and one second-degree connection. Starting from the node with unknown age, a random walk algorithm is used to select a neighboring edge that has not been traversed for traversal, and the known-age node corresponding to the traversed neighboring edge is added to the traversal sequence.
[0052] The termination condition may be a preset number of steps, that is, when the number of steps reached the preset number, the termination condition is determined to be met, or it may be a specific state met, such as the number of adjacent edges reached a preset number.
[0053] In the above step 102, the first step starts from a node with unknown age, and uses a random walk strategy to select an adjacent edge from the first-degree connections and the second-degree connections to walk, and adds the walked nodes to the traversal sequence, and then continues to start from the node in the first step, selects an adjacent edge that has not been walked, and then adds the selected result to the traversal sequence until the termination condition is met, and the final traversal sequence of the node with unknown age can be obtained. And so on, until all the nodes with unknown age in the relationship chain and all the nodes with age in all relationship chains are traversed.
[0054] Let's take a specific implementation process to illustrate:
[0055] 1. Initialization, including determining the starting point and creating a new empty order traversal sequence. Determine the starting point: select a node with unknown age as the starting point; create a traversal sequence: This is an empty list used to store nodes that have been visited and have known ages.
[0056] 2. Build a set of neighboring edges. Determine all possible neighboring edges for the current node, each of which contains at least one first-degree connection and one second-degree connection; optionally, if a neighboring edge has only one first-degree connection or only two-degree connections, then this neighboring edge does not meet the requirements and should not be taken into consideration.
[0057] 3. Random walk process: randomly select one of the neighboring edges that have never been walked to walk; when visiting a new node, check whether the age of the node is known; if the age is known, add this node to the traversal sequence; if the age is unknown, proceed to the next step; mark the neighboring edge as walked to avoid repeated visits. For the new location (if it is a first-degree connection), repeat step 2 to update the set of optional neighboring edges. Continue this process until some termination condition is met, such as all neighboring edges have been visited, a certain step limit has been reached, or enough data has been collected.
[0058] 4. End conditions. Possible end conditions include, but are not limited to: all eligible adjacent edges have been visited, a preset number of nodes with known ages have been collected, a predetermined maximum number of steps has been reached, or other resource limitations have been met.
[0059] 5. Result analysis: Analyze the nodes with known ages in the traversal sequence and use statistical methods (such as mean, median, etc.) to estimate the ages of the original nodes with unknown ages.
[0060] For example, when determining the initial predicted age value of the unknown age node in the relationship chain based on the age values of all known age nodes in the final traversal sequence, the average age value of all known age nodes in the final traversal sequence is determined as the initial predicted age value of the unknown age node in the relationship chain.
[0061] In one implementation, in the above S103, when the initial predicted age value of the unknown age node in each relationship chain is input into the age prediction model for prediction, and the final predicted age of the unknown age node is obtained, the initial predicted age value of the unknown age node in each relationship chain can be input into the age prediction model; the weight value corresponding to each user behavior stored in the age prediction model and the initial predicted age value of the unknown age node in each relationship chain are weighted and summed to obtain the final predicted age of the unknown age node. Among them, the weight value corresponding to each user behavior stored in the age prediction model is obtained by training the machine learning model. In this implementation, the nodes between the relationship chains are weighted, and the weights of the nodes in each relationship chain are equal. The unknown age node corresponds to a user, and the above S102 has selected the age of the node / user by random walk on each relationship chain, and the final age of the user is predicted by hierarchical weighting in S103. Hierarchical weighting means that the weights between each relationship chain are different, and the weights of all nodes in each relationship chain are equal.
[0062] In one possible implementation, the training process of the age prediction model includes:
[0063] Obtain sample user behavior logs and build a relationship chain for each user behavior; the sample user behavior logs include sample nodes and the real age of the sample nodes;
[0064] For each relationship chain, assume that the sample node is a node with unknown age, screen the first-degree sample connections and second-degree sample connections of the sample node in the relationship chain, use the random walk algorithm to walk in the first-degree sample connections and second-degree sample connections, add the walked nodes with known age to the traversal sequence until the termination condition is reached, and obtain the sample traversal sequence of the sample node; according to the age values of all nodes with known age in the sample traversal sequence, determine the initial predicted value of the sample age of the sample node in the relationship chain;
[0065] Input the initial predicted value of the sample age of the sample node in each relationship chain and the actual age into the machine learning model to be trained for iterative training to obtain the model parameters of each relationship chain;
[0066] The model parameters of each relationship chain are determined as the weight value corresponding to each user behavior, and the machine learning model containing the model parameters of each relationship chain is used as the age prediction model.
[0067] For example, the machine learning model is an XGBoost model. Here, the real age of the sample node may include the age value of the node with known age, and may also include the age prediction value of the node with unknown age.
[0068] In this implementation, the initial predicted value of the sample age of the sample node in the relationship chain is used as a feature and input into the machine learning model to be trained for iterative training, so as to obtain the model parameters of each feature. The model parameters include the weight value corresponding to the user behavior, that is, the trained machine learning model / age prediction model includes the weight value of each relationship chain / each user behavior.
[0069] It can be seen from the embodiments of the present invention that the embodiments of the present invention construct a relationship chain for each user behavior, and then use a random walk algorithm to perform similarity weighted processing on the unknown age nodes in the relationship chain. The random walk algorithm traverses all the unknown age nodes in all the relationship chains, and can obtain the initial predicted age values of all the unknown age nodes in each relationship chain. Then, by performing weighted calculation on the same node between the relationship chains, the final predicted age of the unknown age node can be obtained.
[0070] Embodiment 2:
[0071] Based on the above embodiments, Figure 2 A schematic diagram of a multi-relationship chain age prediction device based on random walk provided by an embodiment of the present invention, the device includes:
[0072] A relationship chain building module 201 is used to perform user analysis on the acquired user behavior logs and build a relationship chain for each user behavior;
[0073] The random walk module 202 is used to perform the following process for each unknown age node in each relationship chain: screening the first-degree connections and second-degree connections of the unknown age node in the relationship chain, where the first-degree connections and second-degree connections are all nodes with known ages; starting from the unknown age node, using a random walk algorithm to walk in the first-degree connections and second-degree connections, adding the walked nodes with known ages to the traversal sequence until the termination condition is reached, and obtaining the final traversal sequence of the unknown age node; determining the initial predicted age value of the unknown age node in the relationship chain according to the age values of all the known age nodes in the final traversal sequence;
[0074] The age prediction module 203 is used to input the initial predicted age value of each unknown age node in each relationship chain into the age prediction model for prediction, so as to obtain the final predicted age of the unknown age node.
[0075] Furthermore, the random walk module 202 is specifically used to determine multiple neighboring edges of the unknown age node based on the first-degree connections and the second-degree connections, where one neighboring edge includes at least one first-degree connection and one second-degree connection; starting from the unknown age node, a random walk algorithm is used to select an untraversed neighboring edge for traversal, and the known age node corresponding to the traversed neighboring edge is added to the traversal sequence.
[0076] Furthermore, the random walk module 202 is specifically configured to determine the average age value of all the nodes with known ages in the final traversal sequence as the initial predicted age value of the node with unknown age in the relationship chain.
[0077] Furthermore, the age prediction module 203 is specifically used to input the initial predicted age value of the unknown age node in each relationship chain into the age prediction model; use the weight value corresponding to each user behavior stored in the age prediction model and the initial predicted age value of the unknown age node in each relationship chain to perform weighted summation to obtain the final predicted age of the unknown age node; wherein the weight value corresponding to each user behavior stored in the age prediction model is obtained by training the machine learning model.
[0078] Furthermore, it also includes:
[0079] A training module is used to obtain sample user behavior logs and build a relationship chain for each user behavior; the sample user behavior logs include sample nodes and the real age of the sample nodes; for each relationship chain, assuming that the sample node is a node with unknown age, the first-degree sample connections and second-degree sample connections of the sample node are screened in the relationship chain, and a random walk algorithm is used to walk in the first-degree sample connections and second-degree sample connections, and the nodes with known age that have been walked through are added to the traversal sequence until the termination condition is reached, thereby obtaining a sample traversal sequence of the sample node; according to the age values of all nodes with known age in the sample traversal sequence, the initial predicted value of the sample age of the sample node in the relationship chain is determined; the initial predicted value of the sample age of the sample node in each relationship chain and the real age are input into the machine learning model to be trained for iterative training to obtain the model parameters of each relationship chain; the model parameters of each relationship chain are determined as the weight values corresponding to each user behavior, and the machine learning model containing the model parameters of each relationship chain is used as the age prediction model.
[0080] Furthermore, the machine learning model is an XGBoost model.
[0081] Furthermore, user behaviors include browsing, clicking, donating, and sharing.
[0082] Embodiment 3:
[0083] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Based on the above embodiments, an electronic device is further provided in an embodiment of the present invention, including a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304;
[0084] The memory 303 stores a computer program. When the program is executed by the processor 301, the processor 301 executes the steps of implementing the multi-relationship chain age prediction method based on random walk in the above embodiment.
[0085] For the specific implementation process, please refer to the above embodiment, and the similarities are not repeated here.
[0086] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0087] The communication interface 302 is used for communication between the electronic device and other devices.
[0088] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0089] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital instruction processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0090] Embodiment 4:
[0091] Based on the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the steps of the multi-relationship chain age prediction method based on random walk in the above embodiments.
[0092] For the specific implementation process, please refer to the above embodiment, and the similarities are not repeated here.
[0093] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0094] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0095] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0097] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A multi-relationship chain age prediction method based on random walk, characterized in that: The method comprises: Perform user analysis on the acquired user behavior logs and build a relationship chain for each user behavior; For each relationship chain, the following process is performed for each node of unknown age in the relationship chain: first-degree connections and second-degree connections of the node of unknown age are screened in the relationship chain, and the first-degree connections and second-degree connections are all nodes with known ages; starting from the node of unknown age, a random walk algorithm is used to walk in the first-degree connections and second-degree connections, and the walked nodes with known ages are added to the traversal sequence until the termination condition is reached, so as to obtain the final traversal sequence of the node of unknown age; according to the age values of all nodes with known ages in the final traversal sequence, the initial predicted age value of the node of unknown age in the relationship chain is determined; For each node with unknown age, the initial predicted age value of the node with unknown age in each relationship chain is input into the age prediction model for prediction to obtain the final predicted age of the node with unknown age.
2. The method according to claim 1, characterized in that Starting from the node with unknown age, using a random walk algorithm to walk through the first-degree connections and the second-degree connections, and adding the walked nodes with known age to the traversal sequence comprises: Determine a plurality of adjacent edges of the node with unknown age according to the first-degree connections and the second-degree connections, wherein one of the adjacent edges includes at least one first-degree connection and one second-degree connection; Starting from the node with unknown age, a random walk algorithm is used to select an untraversed adjacent edge for traversal, and the node with known age corresponding to the traversed adjacent edge is added to the traversal sequence.
3. The method according to claim 1 or 2, characterized in that Determining the initial predicted age value of the node with unknown age in the relationship chain according to the age values of all nodes with known age in the final traversal sequence includes: The average of the age values of all nodes with known ages in the final traversal sequence is determined as the initial predicted age value of the node with unknown age in the relationship chain.
4. The method according to claim 1, characterized in that The step of inputting the initial predicted age value of the unknown age node in each relationship chain into the age prediction model for prediction to obtain the final predicted age of the unknown age node comprises: Inputting the initial predicted age value of the unknown age node in each relationship chain into the age prediction model; The weight value corresponding to each user behavior stored in the age prediction model and the initial predicted age value of the unknown age node in each relationship chain are used to perform weighted summation to obtain the final predicted age of the unknown age node; The weight value corresponding to each user behavior stored in the age prediction model is obtained by training the machine learning model.
5. The method according to claim 4, characterized in that The training process of the age prediction model includes: Obtaining sample user behavior logs, and constructing a relationship chain for each user behavior; the sample user behavior logs include sample nodes and the real age of the sample nodes; For each relationship chain, assuming that the sample node is a node with unknown age, the first-degree sample connections and second-degree sample connections of the sample node are screened in the relationship chain, and the random walk algorithm is used to walk in the first-degree sample connections and second-degree sample connections, and the walked nodes with known age are added to the traversal sequence until the termination condition is reached, thereby obtaining the sample traversal sequence of the sample node; according to the age values of all nodes with known age in the sample traversal sequence, the initial predicted value of the sample age of the sample node in the relationship chain is determined; Inputting the initial predicted value of the sample age of the sample node in each relationship chain and the real age into the machine learning model to be trained for iterative training to obtain the model parameters of each relationship chain; The model parameters of each relationship chain are determined as weight values corresponding to each user behavior, and the machine learning model including the model parameters of each relationship chain is used as an age prediction model.
6. The method according to claim 4 or 5, characterized in that The machine learning model is an XGBoost model.
7. The method according to claim 1, characterized in that The user behaviors include browsing, clicking, donating, and sharing.
8. A multi-relationship chain age prediction device based on random walk, characterized in that: The device comprises: The relationship chain building module is used to perform user analysis on the acquired user behavior logs and build a relationship chain for each user behavior; The random walk module is used to perform the following process for each unknown age node in each relationship chain: screening the first-degree connections and second-degree connections of the unknown age node in the relationship chain, wherein the first-degree connections and second-degree connections are all nodes with known ages; starting from the unknown age node, using a random walk algorithm to walk in the first-degree connections and second-degree connections, adding the walked nodes with known ages to a traversal sequence until a termination condition is reached, thereby obtaining a final traversal sequence of the unknown age node; determining an initial predicted age value of the unknown age node in the relationship chain according to the age values of all nodes with known ages in the final traversal sequence; The age prediction module is used to input the initial predicted age value of each unknown age node in each relationship chain into the age prediction model for prediction to obtain the final predicted age of the unknown age node.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory is used to store program instructions, and the processor is used to implement the steps of the multi-relationship chain age prediction method based on random walk as described in any one of claims 1-7 when executing the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the steps of the multi-relationship chain age prediction method based on random walk as described in any one of claims 1 to 7.