User score prediction device and method based on adaptive hidden feature analysis and optimization
By adopting adaptive hidden feature analysis and optimization methods in the recommendation system, and using genetic algorithms to optimize the learning rate and feature matrix, the limitations of learning rate fixed and gradient descent methods in the existing recommendation algorithm are solved, and user score prediction is improved accuracy and model performance.
Patent Information
- Application Number
- CN202411529509.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-30
AI Technical Summary
In the existing recommendation algorithm, the fixed learning rate is difficult to adapt to different stages of the training process, resulting in poor model training efficiency and performance. The stochastic gradient descent method cannot guarantee the optimization of the final solution when adjusting the feature matrix, which reduces the accuracy of user scores. sex.
The user rating prediction device and method based on adaptive hidden feature analysis and optimization is adopted, and the hidden feature analysis module and output module are adjusted through adaptive parameters, and the learning rate and feature matrix are optimized by genetic algorithms to improve the accuracy of user rating prediction.
It improves the training efficiency and final performance of the recommended model, enhances the accuracy of user score prediction, and has strong versatility, and is suitable for matrix problems of other optimized objects.
Smart Images

Figure CN119477061A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a user rating prediction device and method based on adaptive latent feature analysis and optimization. Background Art
[0002] In the Internet age, with the rapid increase in the amount of information, users often find it difficult to find the content they are really interested in when faced with massive amounts of information. This information overload can cause user fatigue and reduce user experience. Recommendation systems have emerged to help users filter and recommend personalized content and products by analyzing users' historical ratings of some items, effectively alleviating the problem of information overload and enabling users to more easily obtain valuable information.
[0003] Matrix decomposition and latent feature analysis are the two core technologies of the recommendation system. These two technologies reveal the latent features of users and items through the known binary relationship between users and items, and use this implicit connection to predict the missing values in the binary relationship between users and items, so as to make personalized recommendations for different users.
[0004] The existing recommendation algorithms are able to achieve the effect of recommendation, but due to the complexity of the algorithm, there are many parameters in the model that need to be adjusted, including the important parameter of learning rate, which directly affects the training efficiency and final performance of the model. Although the method of using a fixed learning rate is simple, the fixed learning rate is often difficult to adapt to different stages of the training process, so that the algorithm cannot achieve the ideal training effect; another problem is that when using the stochastic gradient descent method to adjust the feature matrix, due to the limitation of gradient information, it cannot guarantee that there is no better value in the neighborhood of the final solution, which will reduce the accuracy of user ratings and thus affect the accuracy of recommendations. Summary of the invention
[0005] In view of the problem of low accuracy of user ratings in the prior art, the present invention proposes a user rating prediction device and method based on adaptive latent feature analysis and optimization.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] The user rating prediction device based on adaptive latent feature analysis and optimization specifically includes a data receiving module 110, a data storage module 120, an adaptive parameter adjustment latent feature analysis module 130 and an output module 140;
[0008] The data receiving module 110 is used to receive historical data of user ratings of items;
[0009] The data storage module 120 is used to store the historical rating data sent by the data receiving module 110 and the user rating prediction data output by the output module 140;
[0010] The adaptive parameter adjustment latent feature analysis module 130 is used to adaptively learn and optimize the user latent features and the project latent features according to the scoring history data, and output a first user latent feature matrix and a first project latent feature matrix;
[0011] The output module 140 is used to optimize the first user implicit feature matrix and the first project implicit feature matrix to obtain the second user implicit feature matrix and the second project implicit feature matrix, thereby outputting user rating prediction data.
[0012] Preferably, the data storage module 120 includes a first storage unit 1201 and a second storage unit 1202; the first storage unit 1201 is used to store the rating history data sent by the data receiving module 110; the second storage unit 1202 is used to store the first user implicit feature matrix and the first project implicit feature matrix output by the adaptive parameter adjustment implicit feature analysis module 130, and the user rating prediction data output by the output module 140.
[0013] Preferably, the adaptive parameter adjustment latent feature analysis module 130 includes a first initialization unit 1301, a first iteration unit 1302, a first optimization unit 1303 and a first iteration result output unit 1304;
[0014] A first initialization unit 1301 is used to initialize a first process parameter;
[0015] The first iteration unit 1302 is used to perform latent feature analysis according to the scoring history data and the first process parameter to obtain a first user latent feature and a first item latent feature;
[0016] A first optimization unit 1303 is used to optimize and update the learning rate using a genetic algorithm;
[0017] The first iteration result output unit 1304 is used to output the first user implicit feature matrix and the first item implicit feature matrix.
[0018] Preferably, the output module 140 includes a second initialization unit 1401, a second iteration unit 1402, and a second iteration result output unit 1403;
[0019] A second initialization unit 1401 is used to initialize a second process parameter in the optimization process;
[0020] The second iteration unit 1402 is used to use a genetic algorithm to perform row-by-row iterative optimization on the first user latent feature matrix and the first project latent feature matrix to obtain a second user latent feature matrix and a second project latent feature matrix;
[0021] The second iteration result output unit 1403 is used to output user rating prediction data according to the second user latent feature matrix and the second item latent feature matrix.
[0022] The present invention also provides a user rating prediction method based on adaptive latent feature analysis and optimization, which specifically comprises the following steps:
[0023] S1: Obtain user rating history data and prediction instructions from the server;
[0024] S2: Initialize the first process parameter;
[0025] S3: constructing a first objective function according to the first process parameter and the scoring history data, and outputting a first user latent feature matrix and a first item latent feature matrix;
[0026] S4: Initialize the second process parameter;
[0027] S5: construct a second objective function according to the second process parameter, and use a genetic algorithm to optimize the first user implicit feature matrix and the first project implicit feature matrix to obtain the second user implicit feature matrix and the second project implicit feature matrix, thereby outputting user rating prediction data.
[0028] Preferably, in S2, the first process parameters include: user potential feature matrix P, project potential feature matrix Q matrix, linear bias terms b, c, genetic algorithm population size N, genetic algorithm initial solution individuals for learning rate, genetic algorithm mutation operator execution probability r, matrix update iteration control variable L, matrix update iteration number is up to L max , regularization penalty factor λ, iterative convergence termination threshold τ, learning rate η range [η min ,η max ].
[0029] Preferably, S3 includes:
[0030] S3-1: Construct the first objective function ε based on the difference between the real rating data and the historical rating data:
[0031]
[0032] In formula (1), P represents the first user implicit feature matrix; Q represents the first project implicit feature matrix; b, c represent linear bias terms; r u,i Represents the rating matrix R ΛThe value of the uth row and the ith column in R Λ represents a known rating matrix; represents the predicted rating of user u for item i; p u,k represents the value of the k-th dimension of the hidden feature vector of the u-th user in the first user's hidden feature matrix P; q k,i represents the value of the kth dimension of the latent feature vector of the i-th item in the latent feature matrix Q of the first item; b u represents the bias term corresponding to the vector of user u, c u represents the bias term corresponding to the vector of item i; λ represents the regularization constant; It is part of the regularization term, which is used to limit the value of the feature matrix to prevent the model from overfitting. It represents the complexity of the user vector and feature vector.
[0033] S3-2: According to the first objective function ε, iteratively update the P and Q matrices to minimize the objective function value. The training iteration formula is as follows:
[0034]
[0035] In formula (2), represents the updated value of the u-th row, k-th column, τ-th iteration in the first user's implicit feature matrix P; represents the updated value of the u-th row, k-th column, τ-1th iteration in the first user's implicit feature matrix P; η τ-1 represents the learning rate obtained by S3-5 during the τth generation update; λ represents the regularization penalty factor; Represents the true score r u,i and predicted values difference; represents the updated value of the k-th row, i-th column, τ-th generation in the latent feature matrix Q of the first item; represents the updated value of the k-th row, i-th column, and τ-1th time in the latent feature matrix Q of the first item; Represents the updated value of the bias term corresponding to the vector of user u at the τth generation; Represents the updated value of the bias term of the τth generation corresponding to the vector of item i;
[0036] S3-3: Use genetic algorithm to find the learning rate η suitable for the next round of matrix update τ :Initialize the learning rate search population with a population size of N to the initial parent population P η {P1,…,P N}, where each particle represents a learning rate η; traverse the parent population, each parent individual as parent1, and then select any other parent individual as parent2, and generate a new learning rate as the child population P according to the learning rate information in the parent populationηkid {kid1,…kid N}, the algorithm is as follows:
[0037] Crossover operator: kid i =0.8*parent1+0.2*parent2 (3)
[0038] Mutation operator: kid i =rand(η min ,η max ) if rand(0,1) <r (4)
[0039] In formulas (3) and (4), kid i represents the i-th offspring individual, parent1 represents the first parent individual, parent2 represents the second parent individual, rand(0,1) represents the generation of random numbers in the range (0,1); r represents the probability of executing the mutation operator;
[0040] If the random number is less than the probability r of the mutation operator execution, then kid i Assign a value to any value within the range of learning rate;
[0041]
[0042] In formula (5), F RMSE (η j ) represents the first objective function value corresponding to the parent individual and the offspring individual, that is, the mean square error between the true value and the predicted value is calculated on the validation set Ω; |Ω| represents the total number of samples contained in the validation set Ω;
[0043] S3-4: Iteratively optimize the first objective function according to the updated learning rate, and determine whether the iterative control variable L has reached the upper limit L max ; If yes, terminate the iteration, if no, continue the iteration;
[0044] S3-5: Determine whether the iteration process of the first objective function converges, if so, terminate the iteration, if not, continue the iteration;
[0045] S3-6: When the first objective function is iterated to the end and the first objective function reaches the minimum value, the first user implicit feature matrix P and the first project implicit feature matrix Q are output.
[0046] Preferably, in S4, the second process parameters include: the first user invisible feature matrix P, the first project invisible feature matrix Q matrix, the genetic algorithm population size N, the disturbance amplitude β of generating new vector individuals based on the optimized vector, the initial solution individuals generated when optimizing each row vector, the probability r of executing the genetic algorithm mutation operator, the matrix update iteration control variable L, and the maximum number of matrix update iterations L. max , a single vector updates the iterative control variable T, and the maximum number of iterations for a single vector is T max , regularization penalty factor λ, iterative convergence termination threshold τ.
[0047] Preferably, the S5 includes:
[0048] S5-1: Constructing a corresponding second objective function according to the second process parameter and the first user implicit feature matrix P and the first project implicit feature matrix Q or
[0049]
[0050] In formula (6), P represents the first user implicit feature matrix; Q represents the first project implicit feature matrix; b, c represent linear bias terms; R Λ represents the known rating matrix; r u,i Represents the known rating matrix R Λ The value of the u-th row and the i-th column in is the rating of user u on item i; u,k represents the value of the uth row and the kth column in the first user's implicit feature matrix P; q k,i represents the value of the kth row and ith column in the latent feature matrix Q of the first item;
[0051] Represents the predicted rating of user u for item i b u represents the bias term corresponding to the vector of user u, c u Represents the bias term corresponding to the vector of item i; λ represents the regularization constant to prevent overfitting during training;
[0052] S5-2: Use a genetic algorithm to optimize the first user implicit feature matrix P and the first project implicit feature matrix Q row by row:
[0053] First, optimize the first user's implicit feature matrix P, and then optimize the first project's implicit feature matrix Q; optimize the feature matrix row by row, randomly perturb the traversed row vectors, and generate N new vectors as the parent population P of the genetic algorithm. vector {P1,…,P N}, used to search for a better row vector; calculate the fitness value corresponding to each parent individual according to formula (6), and record the individual with the smallest fitness value as gbest;
[0054] Then select the gbest individual as parent1 and any other parent individual as parent2 to generate the offspring population P vctorkid {kid1,…,kid N};
[0055] Crossover operator: kid i =0.8*parent1+0.2*parent2 (7)
[0056] Mutation operator: kid i,e =rand(a,d)if rand(0,1) <r (8)
[0057] In formulas (7) and (8), kid i represents the i-th offspring individual, parent1 represents the first parent individual, parent2 represents the second parent individual, rand(a,d) represents any value in the range (a,d); r represents the probability of executing the mutation operator; e represents the i-th offspring individual kid i The e-th dimension of the vector; rand(0,1) means generating a random number in the range (0,1); if the random number is less than the probability r of the mutation operator execution, kid i The e-th dimension of the vector is assigned an arbitrary value within the vector's value range;
[0058] According to formula (6), the second objective function values corresponding to the parent individuals and the offspring individuals are calculated, the second objective function values are arranged from small to large, and the individuals corresponding to the first M second objective function values are selected as the parent individuals of the next generation of the genetic algorithm. Finally, after the genetic algorithm iteration is completed, the optimal vector individual is selected to replace the original vector;
[0059] S5-3: When the second objective function iteration is terminated, the second user implicit feature matrix P is obtained by optimizing the second objective function to reach the minimum value. * 、Second project implicit feature matrix Q * , calculate the user rating prediction data:
[0060]
[0061] Formula (7), F prediction represents the rating prediction data of user u for item i; f represents the dimension of latent feature space; Represents the second user's implicit feature matrix P * The value of row u and column k in ; Represents the implicit feature matrix Q of the second project * The value of the kth row and ith column in .
[0062] In summary, due to the adoption of the above technical solution, compared with the prior art, the present invention has at least the following beneficial effects:
[0063] The adaptive adjustment of the learning rate and the further optimization of the feature matrix in this patent make the recommendation model more efficient and accurate, and improve the accuracy of user rating prediction; and it has strong versatility and can be applied to other problems where the optimization object is a matrix. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 Schematic diagram of a user rating prediction device based on adaptive latent feature analysis and optimization according to an exemplary embodiment of the present invention.
[0065] Figure 2 FIG. 4 is a schematic diagram of the structure of a data storage module according to an exemplary embodiment of the present invention.
[0066] Figure 3 Schematic diagram of the structure of a latent feature analysis module for adaptive parameter adjustment according to an exemplary embodiment of the present invention.
[0067] Figure 4 FIG. 4 is a schematic diagram of the structure of an output module according to an exemplary embodiment of the present invention.
[0068] Figure 5 Schematic diagram of a user rating prediction method based on adaptive latent feature analysis and optimization according to an exemplary embodiment of the present invention.
[0069] Figure 6 It is a schematic diagram of comparing the accuracy of user rating prediction according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0070] The present invention is further described in detail below in conjunction with the examples and specific implementation methods. However, this should not be understood as the scope of the above subject matter of the present invention being limited to the following examples, and all technologies realized based on the content of the present invention belong to the scope of the present invention.
[0071] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0072] like Figure 1 As shown, the present invention provides a user rating prediction device based on adaptive latent feature analysis and optimization, which specifically includes a data receiving module 110, a data storage module 120, an adaptive parameter adjustment latent feature analysis module 130 and an output module 140; the output end of the data receiving module 110 is connected to the first input end of the data storage module 120, the output end of the data storage module 120 is connected to the input end of the adaptive parameter adjustment latent feature analysis module 130, the output end of the adaptive parameter adjustment latent feature analysis module 130 is connected to the input end of the output module 140, and the output end of the output module 140 is connected to the second input end of the data storage module 120.
[0073] In this embodiment, the data receiving module 110 is used to receive historical data of user ratings of items and transmit the rating data to the data storage module 120 for storage.
[0074] In this embodiment, the data storage module 120 is used to store the rating history data sent by the data receiving module 110 and the user rating prediction data output by the output module 140 .
[0075] Among them, Figure 2 As shown, the data storage module 120 includes a first storage unit 1201 and a second storage unit 1202; the first storage unit 1201 is used to store the rating history data sent by the data receiving module 110; the second storage unit 1202 is used to store the first user implicit feature matrix and the first project implicit feature matrix output by the adaptive parameter adjustment implicit feature analysis module 130, and the user rating prediction data output by the output module 140.
[0076] In this embodiment, the adaptive parameter adjustment latent feature analysis module 130 is used to adaptively learn and optimize the user latent features and the project latent features according to the rating history data, and output a first user latent feature matrix and a first project latent feature matrix.
[0077] Among them, Figure 3 As shown, the adaptive parameter adjustment latent feature analysis module 130 includes a first initialization unit 1301, a first iteration unit 1302, a first optimization unit 1303 and a first iteration result output unit 1304;
[0078] A first initialization unit 1301 is used to initialize a first process parameter;
[0079] The first iteration unit 1302 is used to perform latent feature analysis according to the scoring history data and the first process parameter to obtain a first user latent feature and a first item latent feature;
[0080] A first optimization unit 1303 is used to optimize and update the learning rate;
[0081] The first iteration result output unit 1304 is used to output the first user implicit feature matrix and the first item implicit feature matrix.
[0082] In this embodiment, the output module 140 is used to optimize the first user implicit feature matrix and the first project implicit feature matrix, so as to output user rating prediction data.
[0083] Among them, Figure 4 As shown, the output module 140 includes a second initialization unit 1401, a second iteration unit 1402, and a second iteration result output unit 1403;
[0084] A second initialization unit 1401 is used to initialize a second process parameter in the optimization process;
[0085] The second iteration unit 1402 is used to perform row-by-row iterative optimization on the first user latent feature matrix and the first item latent feature matrix to obtain a second user latent feature matrix and a second item latent feature matrix;
[0086] The second iteration result output unit 1403 is used to output user rating prediction data according to the second user latent feature matrix and the second item latent feature matrix.
[0087] like Figure 5 As shown, based on the above-mentioned user rating prediction device based on adaptive latent feature analysis and optimization, the present invention also provides a user rating method based on adaptive latent feature analysis and optimization, which specifically includes the following steps:
[0088] S1: Obtain user rating history data and prediction instructions from the server.
[0089] In this embodiment, the server may send instructions to the device by sending instructions to extract latent features from known rating data to the device periodically, or based on notification from the device, or based on notification from a server.
[0090] S2: Initialize the first process parameter.
[0091] In this embodiment, the first process parameters include: user potential feature matrix P, project potential feature matrix Q matrix (each row of P and Q represents the features of user u and project i respectively, and the spatial dimension of each row is f), linear bias terms b and c, genetic algorithm population size N, probability r of genetic algorithm mutation operator execution, matrix update iteration control variable L, and the maximum number of matrix update iterations is L max , the regularization penalty factor is λ, and the iterative convergence termination threshold is τ.
[0092] in:
[0093] The latent feature space dimension f is a fixed integer of the output latent feature dimension, and its initial value is a positive integer, such as 10 or 20.
[0094] The user implicit feature matrix P is a matrix with M rows and f columns established according to the number of users M and f in the rating matrix R. Each row represents a user f-dimensional feature vector, and each element parameter is initialized to a random number in the open interval (0, 0.05).
[0095] The item latent feature matrix Q is a matrix with V rows and f columns established according to the number of items V and f in the rating matrix R. Each row represents an f-dimensional feature vector of an item, and each element parameter is initialized to a random number in the open interval (0, 0.05).
[0096] The linear bias term b is an M-dimensional vector established according to the number of users M in the rating matrix R, where each element parameter is initialized to a random number in the open interval (0, 0.05).
[0097] The linear bias term c is a V-dimensional vector established according to the number V of items in the rating matrix R, where each element parameter is initialized to a random number in the open interval (0, 0.05).
[0098] The genetic algorithm population size N controls the number of particles participating in the genetic algorithm search for the solution space. The parameter is initialized to a fixed integer, such as 10.
[0099] The probability r of executing the genetic algorithm mutation operator is initialized as a decimal less than 1, generally less than or equal to 0.1.
[0100] Parameter initialization iteration control variable L is the variable that controls the extraction iteration process, and its parameter is initialized to 1.
[0101] Iteration upper limit L max It is a variable that controls the upper limit of the number of iterations during the extraction iteration process. The parameter is initialized to a positive integer, such as 100.
[0102] The regularization penalty factor λ is a constant that controls the regularization effect of the regularization term corresponding to the P and Q related elements during the extraction iteration process. The parameter is initialized to a positive number less than 0.1, such as 0.03.
[0103] The iterative convergence termination threshold τ is a threshold parameter for judging whether the extraction iterative process has converged. The parameter is initialized to a very small positive number, such as 0.004.
[0104] S3: Construct a first loss function ε according to the first process parameters and the scoring history data, and output first scoring prediction data.
[0105] S3-1: Construct the first objective function ε based on the difference between the real rating data and the historical rating data:
[0106]
[0107] In machine learning, training data often contains some noise data. In order to improve the generalization ability of the model, Tikhonov regularization is usually used to avoid overfitting the training data. In addition, in order to prevent the influence of user preferences and project characteristics on the prediction, the bias term is introduced to further improve the accuracy of the rating prediction. The objective function is improved as follows:
[0108]
[0109] In formulas (1) and (2), P represents the first user implicit feature matrix; Q represents the first project implicit feature matrix; b and c represent linear bias terms; r u,i Represents the known rating matrix R Λ The value of the u-th row and the i-th column in ; It represents the predicted rating of user u for item i, and its value is p u ·q i T ;p u,k represents the value of the uth row and kth column in the user's implicit feature matrix P; q k,i represents the value of the kth row and ith column in the latent feature matrix Q of the project; b u represents the bias term corresponding to the vector of user u; c i Represents the bias term corresponding to the vector of item i; λ represents the regularization penalty factor; It is part of the regularization term, which is used to limit the value of the feature matrix to prevent the model from overfitting. It represents the complexity of the user vector and feature vector. Λ Represents a known rating matrix.
[0110] In this embodiment, a regularization penalty factor λ is used to constrain the optimization process; linear bias terms b and c are added to help the model adjust the prediction to reflect the specific characteristics of individual users and items.
[0111] S3-2: The device calculates the objective function value corresponding to the learning rate individual initialized by the genetic algorithm, selects the learning rate corresponding to the optimal result and adjusts the latent feature matrix in combination with the gradient descent method to minimize the corresponding ε value. The training iteration formula is as follows:
[0112]
[0113] In formula (3), represents the updated value of the u-th row, k-th column, τ-th iteration in the user's implicit feature matrix P; represents the updated value of the u-th row, k-th column, τ-1th iteration in the user's implicit feature matrix P; η τ-1 represents the learning rate obtained by S3-5 during the τth generation update; λ represents the regularization penalty factor; Represents the true score r u,i and predicted values difference; Represents the updated value of the k-th row, i-th column, τ-th generation in the project's latent feature matrix Q; Represents the updated value of the k-th row, i-th column, and τ-1th time in the project's latent feature matrix Q; Represents the updated value of the bias term corresponding to the vector of user u at the τth generation; Represents the updated value of the bias term of the τth generation corresponding to the vector of item i.
[0114] S3-3: Use genetic algorithm to find the learning rate η suitable for the next round of matrix update τ :Initialize the learning rate search population with a population size of N to the initial parent population P η {P1,…,P N}, where each particle represents a learning rate η. The individual traverses the parent population and each parent individual is used as parent1, and then selects any other parent individual as parent2, and generates a new learning rate as the offspring population P according to the learning rate information in the parent population. ηkid {kid1,…kid N}, the algorithm is as follows:
[0115] Crossover operator: kid i =0.8*parent1+0.2*parent2 (4)
[0116] Mutation operator: kid i =rand(η min ,η max )if rand0,1) <r (5)
[0117] In formulas (4) and (5), kid i represents the i-th offspring individual, parent1 represents the first parent individual, parent2 represents the second parent individual, rand(0,1) represents the generation of random numbers in the range (0,1); r represents the probability of executing the mutation operator; η min Represents the lower bound of the empirical value of the learning rate; η max Represents the upper bound of the empirical value of the learning rate.
[0118] If the random number is less than the probability r of the mutation operator execution, then kid iAssign a value within the range of learning rate to increase the diversity of the search population and prevent the search for learning rate from falling into the local optimal solution;
[0119]
[0120] In formula (6), F RMSE (η j ) represents the first objective function value corresponding to the parent individual and the offspring individual, that is, the mean square error between the true value and the predicted value is calculated on the validation set Ω; |Ω| represents the total number of samples contained in the validation set Ω; the smaller the objective function value, the smaller the prediction error and the better the prediction effect.
[0121] Select the individual with the smallest first objective function value as the learning rate η for updating the P and Q matrices in this round, and arrange the first objective function values from small to large. Select the individuals corresponding to the first N first objective function values as the parent individuals of the next generation of the genetic algorithm to continue searching for the optimal learning rate suitable for the next round of updating the feature matrix;
[0122] S3-4: Iteratively optimize the first objective function according to the updated learning rate, and determine whether the iterative control variable L has reached the upper limit L max .
[0123] In this step, the device first adds 1 to the extraction iteration control variable L, and then determines whether the extraction iteration control variable L is greater than the extraction iteration upper limit L max ; If yes, stop the iteration, otherwise continue the iteration until the iteration control variable L reaches the upper limit L max .
[0124] S3-5: Determine whether the iteration process of the first objective function ε converges, if so, terminate the iteration, if not, continue the iteration.
[0125] In this step, the iteration termination condition is: before the start of this round of iteration, whether the difference between the prediction errors of two adjacent iterations is less than the convergence judgment threshold τ; if yes, it is determined to have converged and the iteration is terminated; if not, it is determined to have not converged and the iteration continues.
[0126] S3-6: When the iteration of the first objective function stops, the first user implicit feature matrix P, the first project implicit feature matrix Q, and the corresponding first user implicit feature matrix bias vector b and first project implicit feature matrix bias vector c are obtained by training when the first objective function reaches the minimum value.
[0127] S4: Initialize the second process parameter.
[0128] The second process parameters include: the first user implicit feature matrix P, the first project implicit feature matrix Q matrix, the genetic algorithm population size N, the disturbance amplitude β of the genetic algorithm to generate new vector individuals based on the optimized vector, the probability r of the genetic algorithm mutation operator execution, the matrix update iteration control variable L, and the maximum number of matrix update iterations L max , a single vector updates the iterative control variable T, and the maximum number of iterations for a single vector is T max , regularization penalty factor λ, iterative convergence termination threshold τ;
[0129] in:
[0130] The first user latent feature matrix P and the first project latent feature matrix Q are obtained by adjusting the latent feature analysis module through adaptive parameters.
[0131] The disturbance amplitude β of the genetic algorithm to generate new vector individuals based on the optimized vector should not be too large, otherwise the search solution space will be too large, affecting the efficiency of the algorithm. It is generally taken as a decimal less than 0.1, such as 0.04.
[0132] Single vector update iteration The control variable T is the variable of the control vector optimization process, and its initial value is 1.
[0133] T max It is a variable that controls the upper limit of the number of iterations during the optimization iteration process. The parameter is initialized to a positive integer, such as 100.
[0134] The remaining variables all adopt the values of the first process parameters.
[0135] S5: constructing a second objective function according to the second process parameter and the first rating prediction data, optimizing the first rating prediction data, and outputting second rating prediction data.
[0136] S5-1: Constructing a corresponding second loss function according to the second process parameter and the first user implicit feature matrix P and the first project implicit feature matrix Q Or the third loss function
[0137]
[0138] In formulas (7) and (8), P represents the first user implicit feature matrix; Q represents the first project implicit feature matrix; b, c represent linear bias terms; R Λ represents the known rating matrix; r u,i Represents the known rating matrix R Λ The value of the u-th row and i-th column in is the known rating of user u on item i; p u,k represents the value of the uth row and the kth column in the first user's implicit feature matrix P; q k,irepresents the value of the kth row and ith column in the latent feature matrix Q of the first item; Represents the predicted rating of user u for item i b u represents the bias term corresponding to the vector of user u, c i Represents the bias term corresponding to the vector of item i; λ represents the regularization constant to prevent overfitting during training;
[0139] S5-2: Use a genetic algorithm to optimize the first user implicit feature matrix P and the first project implicit feature matrix Q row by row:
[0140] First, optimize the first user's implicit feature matrix P and then optimize the first project's implicit feature matrix Q. Traverse and optimize the feature matrix row by row, and randomly perturb the traversed row vectors within a certain range to generate N new vectors as the parent population P of the genetic algorithm. vector {P1,…,P N}, used to search for a better row vector.
[0141] The initial population P generated when the genetic algorithm optimizes each row vector vector {P1,…,P N}Based on the optimized vector h u 、h i Produce (h u 、h i It consists of the optimized user and item vectors and their corresponding bias terms, where u represents the user number and i represents the item number. Now, the user vector h u Take optimization as an example:
[0142]
[0143] In formula (9), P i represents the i-th initial solution individual; U represents a uniformly distributed random number generation function, indicating that the initial vector particle is based on h u Make disturbances, and take random values within the disturbance range; N represents the population size of the genetic algorithm.
[0144] According to formula (7) or (8) (formula (7) is used to optimize the user feature matrix, and formula (8) is used to optimize the project feature matrix), the fitness value corresponding to each parent individual is calculated, and the individual with the smallest fitness value is recorded as gbest; the gbest individual is used as parent1 and any other parent individual is used as parent2 to generate the offspring population P vctorkid {kid1,…,kid N}:
[0145] Crossover operator: kid i=0.8*parent1+0.2*parent2 (10)
[0146] Mutation operator: kid i,e =rand(a,d)if rand(0,1) <r (11)
[0147] In formulas (10) and (11), kid i represents the i-th offspring individual; parent1 represents the first parent individual; parent2 represents the second parent individual; rand(a,d) represents any value within the vector value range, r represents the probability of the mutation operator execution; e represents the i-th offspring individual kid i The e-th dimension of the vector; rand(0,1) means generating a random number in the range (0,1). If the random number is less than the probability r of the mutation operator execution, kid i The e-th dimension of the vector is assigned an arbitrary value within the range of the vector value to increase the diversity of the search population and prevent the search for the vector from falling into a local optimal solution;
[0148] According to formula (7) or (8), the second objective function value corresponding to the parent individual and the child individual is calculated (the user feature matrix is optimized using formula (7), and the project feature matrix is optimized using formula (8)). The smaller the second objective function value is, the more accurate the feature vector representation is. The second objective function values are arranged from small to large, and the individuals corresponding to the first M second objective function values are selected as the parent individuals of the next generation of the genetic algorithm. Finally, after the genetic algorithm iteration is completed, the optimal vector individual is selected to replace the original vector;
[0149] The number of updates of the entire genetic algorithm is controlled by the variable T, and the upper limit T max Then stop and continue to traverse the next vector to be optimized.
[0150] S5-3: When the second objective function is iterated, the second user implicit feature matrix P is obtained by optimizing the second objective function to reach the minimum value. * 、Second project implicit feature matrix Q * , and the corresponding second user implicit feature matrix bias vector b * 、The second project implicit feature matrix bias vector c * , calculate the second rating prediction data, that is, the user rating prediction data:
[0151]
[0152] Formula (12), F prediction represents the rating prediction data of user u for item i; f represents the dimension of latent feature space; Represents the second user's implicit feature matrix P *The value of row u and column k in ; Represents the implicit feature matrix Q of the second project * The value of the kth row and ith column in .
[0153] In order to verify the performance of the above-mentioned adaptive latent feature analysis and further optimize the latent feature device and method, the device was installed on a server (configuration: Intel Xeon E5-2630 v4, 2.2GHz processor, 256G memory), and a simulation experiment was run to perform an example analysis. In the example analysis, the scoring data used comes from a classic data set publicly available on the Internet. The example analysis uses the mean square error RMSE as an evaluation indicator of the accuracy of latent feature extraction from the scoring data. The lower the RMSE, the higher the accuracy of the latent feature.
[0154]
[0155] Formula (13), r u,i Represents the known rating matrix R Λ The value of the u-th row and the i-th column in ; represents the predicted score of user u for item i; |S| represents the total number of samples contained in the test set S. RMSE The smaller the value, the smaller the prediction error and the better the prediction effect.
[0156] Figure 6 The accuracy of latent feature extraction of scoring data is compared before and after the application of the embodiment of the present invention. Figure 6 After applying the embodiment of the present invention, when extracting latent features of scoring data, the adaptive adjustment of the learning rate and the further optimization of latent features will bring good optimization effects on the extraction accuracy. The first case represents the hidden feature extraction result under the adaptive fixed learning rate, and the second case represents the best hidden feature extraction result after applying the present invention.
[0157] It can be seen from the above technical solutions that the present invention is specifically applied to recommendation systems, and can extract effective and highly accurate latent features for existing ratings, and can solve the problems existing in modern recommendation systems to a certain extent.
[0158] The present invention also provides an electronic device, comprising a processor, wherein the processor is used to run a computer program stored in a memory so that the electronic device implements the steps of the user scoring method based on adaptive latent feature analysis and optimization in the above embodiment.
[0159] The present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed on a processor, the steps of the user scoring method based on adaptive latent feature analysis and optimization in the above embodiment are implemented.
[0160] A computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer readable media may include at least: any entity or device capable of carrying computer program code to an electronic device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer readable media cannot be electric carrier signals and telecommunication signals.
[0161] Those skilled in the art will appreciate that the above-mentioned embodiments are specific examples for implementing the present invention, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A user rating prediction device based on adaptive latent feature analysis and optimization, characterized in that: Specifically, it comprises a data receiving module (110), a data storage module (120), an adaptive parameter adjustment latent feature analysis module (130) and an output module (140); The data receiving module (110) is used to receive historical data of user ratings of items; The data storage module (120) is used to store the historical rating data sent by the data receiving module (110) and the user rating prediction data output by the output module (140); The adaptive parameter adjustment latent feature analysis module (130) is used to adaptively learn and optimize the user latent features and the project latent features according to the scoring history data, and output a first user latent feature matrix and a first project latent feature matrix; The output module (140) is used to optimize the first user implicit feature matrix and the first project implicit feature matrix to obtain the second user implicit feature matrix and the second project implicit feature matrix, thereby outputting user rating prediction data.
2. The user rating prediction device based on adaptive latent feature analysis and optimization according to claim 1, characterized in that: The data storage module (120) comprises a first storage unit (1201) and a second storage unit (1202); the first storage unit (1201) is used to store the rating history data sent by the data receiving module (110); the second storage unit (1202) is used to store the first user latent feature matrix and the first project latent feature matrix output by the adaptive parameter adjustment latent feature analysis module (130), and the user rating prediction data output by the output module (140).
3. The user rating prediction device based on adaptive latent feature analysis and optimization according to claim 1, characterized in that: The adaptive parameter adjustment latent feature analysis module (130) comprises a first initialization unit (1301), a first iteration unit (1302), a first optimization unit (1303) and a first iteration result output unit (1304); A first initialization unit (1301), used for initializing a first process parameter; A first iteration unit (1302) is used to perform latent feature analysis according to the scoring history data and the first process parameter to obtain a first user latent feature and a first item latent feature; A first optimization unit (1303), configured to optimize and update the learning rate using a genetic algorithm; The first iteration result output unit (1304) is used to output the first user implicit feature matrix and the first project implicit feature matrix.
4. The user rating prediction device based on adaptive latent feature analysis and optimization according to claim 1, characterized in that: The output module (140) includes a second initialization unit (1401), a second iteration unit (1402), and a second iteration result output unit (1403); A second initialization unit (1401), used for initializing a second process parameter in the optimization process; A second iteration unit (1402) is used to use a genetic algorithm to perform row-by-row iterative optimization on the first user latent feature matrix and the first project latent feature matrix to obtain a second user latent feature matrix and a second project latent feature matrix; The second iteration result output unit (1403) is used to output user rating prediction data according to the second user latent feature matrix and the second item latent feature matrix.
5. The user rating prediction method based on adaptive latent feature analysis and optimization according to any one of claims 1 to 4, characterized in that: The specific steps include: S1: Obtain user rating history data and prediction instructions from the server; S2: Initialize the first process parameter; S3: constructing a first objective function according to the first process parameter and the scoring history data, and outputting a first user latent feature matrix and a first item latent feature matrix; S4: Initialize the second process parameter; S5: construct a second objective function according to the second process parameter, and use a genetic algorithm to optimize the first user implicit feature matrix and the first project implicit feature matrix to obtain the second user implicit feature matrix and the second project implicit feature matrix, thereby outputting user rating prediction data.
6. The user rating prediction method based on adaptive latent feature analysis and optimization according to claim 5, characterized in that: In S2, the first process parameters include: user potential feature matrix P, project potential feature matrix Q matrix, linear bias terms b, c, genetic algorithm population size N, genetic algorithm initial solution individual for learning rate, genetic algorithm mutation operator execution probability r, matrix update iteration control variable L, matrix update iteration number is up to L max , regularization penalty factor λ, iterative convergence termination threshold τ, learning rate η range [η min ,η max ].
7. The user rating prediction method based on adaptive latent feature analysis and optimization according to claim 5, characterized in that: The S3 includes: S3-1: Construct the first objective function ε based on the difference between the real rating data and the historical rating data: In formula (1), P represents the first user implicit feature matrix; Q represents the first project implicit feature matrix; b, c represent linear bias terms; r u,i Represents the rating matrix R Λ The value of the uth row and the ith column in R Λ represents a known rating matrix; represents the predicted rating of user u for item i; p u,k represents the value of the k-th dimension of the hidden feature vector of the u-th user in the first user's hidden feature matrix P; q k,i represents the value of the kth dimension of the latent feature vector of the i-th item in the first item latent feature matrix Q; b u represents the bias term corresponding to the vector of user u, c u represents the bias term corresponding to the vector of item i; λ represents the regularization constant; It is part of the regularization term, which is used to limit the value of the feature matrix to prevent the model from overfitting and represents the complexity of the user vector and feature vector; S3-2: According to the first objective function ε, iteratively update the P and Q matrices to minimize the objective function value. The training iteration formula is as follows: In formula (2), represents the updated value of the u-th row, k-th column, τ-th iteration in the first user's implicit feature matrix P; represents the updated value of the u-th row, k-th column, τ-1th iteration in the first user's implicit feature matrix P; η τ-1 represents the learning rate obtained by S3-5 during the τth generation update; λ represents the regularization penalty factor; Represents the true score r u,i and predicted values difference; represents the updated value of the k-th row, i-th column, τ-th generation in the latent feature matrix Q of the first item; represents the updated value of the k-th row, i-th column, and τ-1th time in the latent feature matrix Q of the first item; Represents the updated value of the bias term corresponding to the vector of user u at the τth generation; Represents the updated value of the bias term of the τth generation corresponding to the vector of item i; S3-3: Use genetic algorithm to find the learning rate η suitable for the next round of matrix update τ :Initialize the learning rate search population with a population size of N to the initial parent population P η {P1,…,P N }, where each particle represents a learning rate η; traverse the parent population, each parent individual as parent1, and then select any other parent individual as parent2, and generate a new learning rate as the child population P according to the learning rate information in the parent population ηkid {kid1,…kid N }, the algorithm is as follows: Crossover operator: kid i =0.8*parent1+0.2*parent2 (3) Mutation operator: kid i =rand(η min ,η max ) if rand(0,1) <r (4) In formulas (3) and (4), kid i represents the i-th offspring individual, parent1 represents the first parent individual, parent2 represents the second parent individual, rand(0,1) represents the generation of random numbers in the range (0,1); r represents the probability of executing the mutation operator; If the random number is less than the probability r of the mutation operator execution, then kid i Assign a value to any value within the range of learning rate; In formula (5), F RMSE (η j ) represents the first objective function value corresponding to the parent individual and the offspring individual, that is, the mean square error between the true value and the predicted value is calculated on the validation set Ω; |Ω| represents the total number of samples contained in the validation set Ω; S3-4: Iteratively optimize the first objective function according to the updated learning rate, and determine whether the iterative control variable L has reached the upper limit L max ; If yes, terminate the iteration, if no, continue the iteration; S3-5: Determine whether the iteration process of the first objective function converges, if so, terminate the iteration, if not, continue the iteration; S3-6: When the first objective function is iterated to the end and the first objective function reaches the minimum value, the first user implicit feature matrix P and the first project implicit feature matrix Q are output.
8. The user rating prediction method based on adaptive latent feature analysis and optimization according to claim 5, characterized in that: In S4, the second process parameters include: the first user invisible feature matrix P, the first project invisible feature matrix Q matrix, the genetic algorithm population size N, the disturbance amplitude β of generating new vector individuals based on the optimized vector, the initial solution individuals generated when optimizing each row vector, the probability r of the genetic algorithm mutation operator execution, the matrix update iteration control variable L, and the maximum number of matrix update iterations L max , a single vector updates the iterative control variable T, and the maximum number of single vector updates is T max , regularization penalty factor λ, iterative convergence termination threshold τ.
9. The user rating prediction method based on adaptive latent feature analysis and optimization according to claim 5, characterized in that: The S5 includes: S5-1: Constructing a corresponding second objective function according to the second process parameter and the first user implicit feature matrix P and the first project implicit feature matrix Q or In formula (6), P represents the first user implicit feature matrix; Q represents the first project implicit feature matrix; b, c represent linear bias terms; R Λ represents the known rating matrix; r u,i Represents the known rating matrix R Λ The value of the u-th row and the i-th column in is the rating of user u on item i; u,k represents the value of the uth row and the kth column in the first user's implicit feature matrix P; q k,i represents the value of the kth row and ith column in the latent feature matrix Q of the first item; Represents the predicted rating of user u for item i b u represents the bias term corresponding to the vector of user u, c u Represents the bias term corresponding to the vector of item i; λ represents the regularization constant to prevent overfitting during training; S5-2: Use a genetic algorithm to optimize the first user implicit feature matrix P and the first project implicit feature matrix Q row by row: First, optimize the first user's implicit feature matrix P, and then optimize the first project's implicit feature matrix Q; optimize the feature matrix row by row, randomly perturb the traversed row vectors, and generate N new vectors as the parent population P of the genetic algorithm. vector {P1,…,P N }, used to search for a better row vector; calculate the fitness value corresponding to each parent individual according to formula (6), and record the individual with the smallest fitness value as gbest; Then select the gbest individual as parent1 and any other parent individual as parent2 to generate the offspring population P vctorkid {kid1,…,kid N }; Crossover operator: kid i =0.8*parent1+0.2*parent2 (7) Mutation operator: kid i,e =rand(a,d) if rand0,1) <r (8) In formulas (7) and (8), kid i represents the i-th offspring individual, parent1 represents the first parent individual, parent2 represents the second parent individual, rand(a,d) represents any value in the range (a,d); r represents the probability of executing the mutation operator; e represents the i-th offspring individual kid i The e-th dimension of the vector; rand(0,1) means generating a random number in the range (0,1); if the random number is less than the probability r of the mutation operator execution, kid i The e-th dimension of the vector is assigned an arbitrary value within the vector's value range; According to formula (6), the second objective function values corresponding to the parent individuals and the offspring individuals are calculated, the second objective function values are arranged from small to large, and the individuals corresponding to the first M second objective function values are selected as the parent individuals of the next generation of the genetic algorithm. Finally, after the genetic algorithm iteration is completed, the optimal vector individual is selected to replace the original vector; S5-3: When the second objective function iteration is terminated, the second user implicit feature matrix P is obtained by optimizing the second objective function to reach the minimum value. * 、Second project implicit feature matrix Q * , calculate the user rating prediction data: Formula (7), F prediction represents the rating prediction data of user u for item i; f represents the dimension of latent feature space; Represents the second user's implicit feature matrix P * The value of row u and column k in ; Represents the implicit feature matrix Q of the second project * The value of the kth row and ith column in .
Citation Information
Patent Citations
Smart home user-service interestingness personalized prediction device and prediction method based on rapid non-negative implicit feature analysis
CN111563203A
Intelligent pediatric diet prediction method and device based on particle swarm optimization
CN111564201A
Financial service personalized recommendation device and method based on time sequence
CN112182395A
Cold start recommendation algorithm based on implicit factor prediction
CN113987363A
Systems and methods for improving social media advertising efficiency
US20180165706A1