Project recommendation method and device, computer readable storage medium and electronic equipment

By updating the user feature and project feature matrix based on information from multiple dimensions in matrix decomposition, the problem of low accuracy in matrix decomposition recommendations is solved, and more accurate user project recommendations are achieved.

CN119539059AActive Publication Date: 2025-02-28TRAVELSKY TECHNOLOGY LIMITED
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411696588.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-02-28
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

When recommending items to users based on matrix decomposition, there is a problem of low recommendation accuracy.

Method used

By obtaining the scores of M items by each user among N users, a scoring matrix is ​​constructed, and the initial user feature matrix, initial hidden vector matrix and initial project feature matrix are randomly generated. Then, based on the matrix decomposition method, these matrices are updated until the iteratively meets the preset conditions, and the prediction scores of each user for M items are determined, and the items are recommended based on the score.

Benefits of technology

Through the update of multi-dimensional information and matrix decomposition, the potential relationship between users and projects can be more accurately reflected and recommendation accuracy can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119539059A_ABST
    Figure CN119539059A_ABST
Patent Text Reader

Abstract

The invention discloses a project recommendation method and device, a computer readable storage medium and electronic equipment. Relates to the field of recommendation algorithms, and the method comprises the steps: obtaining the score of each user in N users for at least a part of items in M items, and constructing a score matrix according to the scores; randomly generating an initial user feature matrix, an initial implicit vector matrix and an initial item feature matrix; and based on a matrix decomposition method, updating the initial user feature matrix, the initial implicit vector matrix and the initial item feature matrix until iteration of the matrix decomposition method meets a preset iteration condition, and determining predicted scores of all items in the M items by each user according to the user feature matrix, the implicit vector matrix and the item feature matrix, and determining to-be-recommended items corresponding to the N users according to the prediction scores, and recommending the to-be-recommended items to the N users. According to the method and the device, the technical problem of low recommendation accuracy when items are recommended to users based on matrix decomposition in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of recommendation algorithms, and in particular to a project recommendation method, device, computer-readable storage medium and electronic device. Background Art

[0002] With the rapid development of Internet technology, personalized recommendation systems have become an indispensable part of e-commerce, social media, online entertainment and other fields. Recommendation algorithms aim to predict and recommend content or products that may be of interest to users by analyzing their historical behaviors and preferences, thereby improving user experience and satisfaction. Traditional recommendation methods such as content-based recommendation and collaborative filtering have been widely used, but they often face challenges such as data sparsity and cold start problems.

[0003] In order to solve the above problems, researchers have begun to explore more advanced technical means to improve the performance of recommendation systems in recent years. Among them, matrix factorization (MF) has received widespread attention as an effective solution. The basic idea of ​​matrix factorization is to decompose the user-item rating matrix into two low-rank matrices: one represents the user's latent vectors, and the other represents the latent vectors of the items. In this way, the potential relationship between users and items can be captured, and more accurate recommendations can be made based on this. However, when recommending items to users based on traditional matrix factorization, there is still a problem of low recommendation accuracy.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] Embodiments of the present invention provide a project recommendation method, device, computer-readable storage medium and electronic device to at least solve the technical problem in the related art of low recommendation accuracy when recommending projects to users based on matrix decomposition.

[0006] According to one aspect of an embodiment of the present invention, a project recommendation method is provided, comprising: obtaining scores of at least some of M projects from each user among N users, and constructing a scoring matrix based on the scores, wherein a single element in the scoring matrix represents the score of a single user on a single project; randomly generating an initial user feature matrix, an initial latent vector matrix, and an initial project feature matrix, wherein the initial user feature matrix includes user feature vectors of each user, the initial project feature matrix includes project feature vectors of each project, and the initial latent vector matrix is ​​used to represent the correlation between features in the user feature vector and features in the project feature vector; based on a matrix decomposition method, updating the initial user feature matrix, the initial latent vector matrix, and the initial project feature matrix until the iteration of the matrix decomposition method meets a preset iteration condition, determining the predicted scores of all projects in the M projects from each user based on the updated user feature matrix, latent vector matrix, and project feature matrix, determining the recommended projects corresponding to the N users respectively based on the predicted scores, and recommending the recommended projects to the N users.

[0007] Furthermore, the project recommendation method also includes: determining a target value based on target information, wherein the target information includes at least one of the following: the number of users of N users, the number of projects of M projects, the total number of ratings of N users, and the target value is positively correlated with the value in the target information; determining the number of dimensions of features in the user feature vector based on the target value, wherein the target value is positively correlated with the number of dimensions.

[0008] Furthermore, the project recommendation method also includes: calculating the loss value according to a preset objective function, an initial user feature matrix, an initial latent vector matrix and an initial project feature matrix; when the loss value is greater than a target threshold, updating the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix using a gradient descent method to obtain a user feature matrix, a latent vector matrix and a project feature matrix; repeatedly executing the step of calculating the loss value according to the preset objective function, the user feature matrix, the latent vector matrix and the project feature matrix until the loss value is less than or equal to the target threshold, determining that the iteration of the matrix decomposition method meets the preset iteration condition.

[0009] Furthermore, the project recommendation method also includes: determining N*M user-project pairs based on N users and M projects; for each user-project pair, calculating the prediction error value corresponding to the user-project pair according to the rating matrix, the initial project feature matrix, the user feature vector associated with the user-project pair, and the project feature vector associated with the user-project pair; updating the initial user feature matrix, the initial latent vector matrix, and the initial project feature matrix according to the prediction error value to obtain the user feature matrix, the latent vector matrix, and the project feature matrix.

[0010] Furthermore, the item recommendation method also includes: updating the user feature vector according to the prediction error value of the user-item pair associated with the user feature vector in the initial user feature matrix to obtain a user feature matrix; updating the initial latent vector matrix according to the prediction error value of the user-item pair to obtain a latent vector matrix; updating the item feature vector according to the prediction error value of the user-item pair associated with the item feature vector in the initial item feature matrix to obtain an item feature matrix.

[0011] Furthermore, the project recommendation method also includes: multiplying the user feature matrix and the latent vector matrix to obtain a first matrix; multiplying the first matrix and the transposed matrix of the project feature matrix to obtain a target rating matrix, wherein the target rating matrix includes each user's predicted ratings for all projects in the M projects.

[0012] Furthermore, the project recommendation method also includes: for each user, determining the unrated projects associated with the user according to the scoring matrix to obtain multiple target unrated projects; determining the user's predicted scores for the multiple target unrated projects according to the target scoring matrix; and determining the to-be-recommended projects corresponding to the user from the multiple target unrated projects according to the predicted scores of the multiple target unrated projects to obtain the to-be-recommended projects corresponding to N users respectively.

[0013] According to another aspect of an embodiment of the present invention, a project recommendation device is also provided, including: an acquisition module, used to obtain the scores of each user among N users for at least some of the projects in M ​​projects, and construct a scoring matrix based on the scores, wherein a single element in the scoring matrix represents the score of a single user for a single project; a generation module, used to randomly generate an initial user feature matrix, an initial latent vector matrix and an initial project feature matrix, wherein the initial user feature matrix includes user feature vectors of each user, the initial project feature matrix includes project feature vectors of each project, and the initial latent vector matrix is ​​used to represent the association between features in the user feature vector and features in the project feature vector; a processing module, used to update the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix based on a matrix decomposition method until the iteration of the matrix decomposition method meets the preset iteration condition, determine the predicted scores of each user for all the projects in the M projects based on the updated user feature matrix, latent vector matrix and project feature matrix, determine the recommended projects corresponding to the N users respectively based on the predicted scores, and recommend the recommended projects to the N users.

[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned item recommendation method when running.

[0015] According to another aspect of an embodiment of the present invention, an electronic device is also provided, which includes one or more processors; a memory for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the above-mentioned item recommendation method when running.

[0016] In an embodiment of the present invention, a method of recommending projects to users based on information of multiple dimensions in matrix decomposition is adopted, by obtaining the scores of each user among N users on at least some of the projects in M ​​projects, and constructing a score matrix according to the scores, and then randomly generating an initial user feature matrix, an initial latent vector matrix, and an initial project feature matrix, and then updating the initial user feature matrix, the initial latent vector matrix, and the initial project feature matrix based on the matrix decomposition method, until the iteration of the matrix decomposition method meets the preset iteration condition, the predicted scores of each user on all the projects in M ​​projects are determined according to the updated user feature matrix, latent vector matrix, and project feature matrix, and the recommended projects corresponding to the N users are determined according to the predicted scores, and the recommended projects are recommended to the N users. Wherein, a single element in the score matrix represents the score of a single user on a single project, wherein the initial user feature matrix includes the user feature vectors of each user, the initial project feature matrix includes the project feature vectors of each project, and the initial latent vector matrix is ​​used to represent the correlation between the features in the user feature vector and the features in the project feature vector.

[0017] In the above process, by randomly generating an initial user feature matrix, an initial latent vector matrix and an initial project feature matrix, the random determination of user features, project features and the correlation between user features and project features is achieved. By updating the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix based on a matrix decomposition method, the effective updating of information of multiple dimensions based on a matrix decomposition method is achieved, so that it can more accurately reflect the potential relationship between users and projects. By determining the predicted scores of each user for all projects in M ​​projects based on the updated user feature matrix, latent vector matrix and project feature matrix when the iteration of the matrix decomposition method meets the preset iteration conditions, it is achieved that in the matrix decomposition, the user's score for the project is determined based on the information of multiple dimensions, thereby improving the accuracy of the determined score, and further improving the recommendation accuracy.

[0018] It can be seen that the solution provided in the present application achieves the purpose of recommending items to users based on information of multiple dimensions in matrix decomposition, thereby achieving the technical effect of improving the accuracy of recommendations, and further solving the technical problem of low recommendation accuracy when recommending items to users based on matrix decomposition in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0020] Figure 1 This is a process of an optional project recommendation method according to an embodiment of the present invention. Figure 1 ;

[0021] Figure 2 This is a process of an optional project recommendation method according to an embodiment of the present invention. Figure 2 ;

[0022] Figure 3 is a schematic diagram of an optional item recommendation device according to an embodiment of the present invention;

[0023] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis (such as user ratings of projects), stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards in the relevant regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0027] Example 1

[0028] According to an embodiment of the present invention, an embodiment of a project recommendation method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0029] Figure 1 This is a process of an optional project recommendation method according to an embodiment of the present invention. Figure 1 ,like Figure 1 As shown, the method comprises the following steps:

[0030] Step S101 : obtaining scores of at least some of the M projects from each of the N users, and constructing a score matrix based on the scores, wherein a single element in the score matrix represents a score of a single user on a single project.

[0031] Optionally, electronic devices, application systems, servers and other devices may be used as the execution subject of the present application. In this embodiment, the target recommendation system is used as the execution subject to execute the above-mentioned project recommendation method.

[0032] Optionally, the above items may be different depending on the actual application scenario. For example, in a shopping scenario, the items may be different types of goods, in a financial scenario, the items may be different types of financial products, in an aviation scenario, the items may be different types of coupons, or the items may be different types of aviation insurance, etc. Therefore, in this embodiment, the content of the items is not specifically limited.

[0033] Optionally, the target recommendation system can read the original user-item rating data from the database, that is, obtain the ratings of each user among the N users on at least some of the M items. Among them, for each user among the N users, the user may have only rated some of the M items, that is, there may be items in the M items that the user has not rated. The target recommendation system can predict the user's rating of the unrated items through the item recommendation method provided in this embodiment, so as to recommend items to the user based on the rating after the prediction is completed. Among them, the aforementioned M and N are both positive integers greater than 1.

[0034] Optionally, after obtaining the original user-item rating data, the target recommendation system can perform a data integrity check to ensure that each record has a valid user ID, item ID, and rating value. For missing fields, the system logs and marks them as abnormal data. In addition, the system can use statistical methods to identify outliers, such as ratings that are outside a reasonable range (for example, the rating is between 1 and 5, but there are ratings of 0 or more than 5), and delete them or replace them with reasonable default values. In order to reduce the impact of duplicate data, the system can retain only the latest or average of multiple rating records of the same user for the same item, thereby obtaining updated user-item rating data.

[0035] In some embodiments, the user's ratings of items are directly stored in the database so that the target recommendation system can directly obtain them.

[0036] In some embodiments, the database does not directly store the user's ratings of the items, but instead stores the user's behavior records of clicking, purchasing, collecting, etc. on the items. The target recommendation system can obtain these behavior records, and then determine the user's rating of the item based on the preset scoring rules and the user's behavior records on the item.

[0037] Optionally, after obtaining the original user-item rating data or the updated user-item rating data, the target recommendation system can construct a rating matrix based on the ratings of at least some of the M items by each of the N users. For example, the rating of a user on an item is taken as an element, and the elements corresponding to the same user are set to belong to the same row, and the elements corresponding to the same item are set to belong to the same column, thereby constructing an M×N rating matrix, which is a sparse matrix. In the rating matrix, rows represent users, columns represent items, and each element r ui Represents the rating of user u on item i. For items that are not rated by the user, the corresponding elements in the rating matrix can be represented by 0. Since user-item rating data is usually highly sparse, the system uses a sparse matrix representation to save a lot of storage space.

[0038] Step S102, randomly generate an initial user feature matrix, an initial latent vector matrix and an initial project feature matrix, wherein the initial user feature matrix includes user feature vectors of each user, the initial project feature matrix includes project feature vectors of each project, and the initial latent vector matrix is ​​used to characterize the correlation between features in the user feature vector and features in the project feature vector.

[0039] Optionally, the target recommendation system can use normal distribution to randomly generate the initial user feature matrix U (size is M×k), the initial latent vector matrix V (size is k×l), and the initial item feature matrix I (size is N×l), where each row in the initial user feature matrix U represents a latent vector of a user, each column in the initial item feature matrix I represents a latent vector of an item, and the initial latent vector matrix V is used to characterize the association between the k features in the user feature vector and the l features in the item feature vector. The latent vector can capture the key features of each entity without directly relying on explicit attribute descriptions. For example, in the movie recommendation scenario, although users may not explicitly indicate what type of movies they like, by analyzing their viewing history, we can infer that the user may have a preference for movies of certain styles or themes. Similarly, for the movie itself, even if there is a lack of detailed classification information, implicit features reflecting its characteristics can be extracted from the audience's collective evaluation pattern. Therefore, the latent vector-based method not only helps to alleviate the impact of data sparsity, but also discovers deep interest matching relationships, thereby improving the quality of recommendations.

[0040] In some embodiments, the target recommendation system may also use other initialization strategies to generate an initial user feature matrix, an initial latent vector matrix, and an initial item feature matrix.

[0041] Step S103, based on the matrix decomposition method, the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix are updated until the iteration of the matrix decomposition method meets the preset iteration condition, and the predicted scores of each user for all the projects in the M projects are determined according to the updated user feature matrix, the latent vector matrix and the project feature matrix, and the recommended projects corresponding to the N users are determined according to the predicted scores, and the recommended projects are recommended to the N users.

[0042] Optionally, the target recommendation system may update the initial user feature matrix, the initial latent vector matrix, and the initial project feature matrix based on the matrix decomposition method until the iteration of the matrix decomposition method satisfies a preset iteration condition. For example, the preset iteration condition of the matrix decomposition method is that the loss value calculated based on the objective function is less than or equal to the target threshold value. The target recommendation system may calculate the loss value based on the initial user feature matrix, the initial latent vector matrix, the initial project feature matrix, and the objective function, thereby determining that the iteration of the matrix decomposition method satisfies the preset iteration condition when the loss value is less than or equal to the target threshold value, and updating the initial user feature matrix, the initial latent vector matrix, and the initial project feature matrix when the loss value is greater than the target threshold value, and calculating the loss value again, thereby continuously iterating until it is determined that the iteration of the matrix decomposition method satisfies the preset iteration condition.

[0043] Optionally, when the iteration of the matrix decomposition method satisfies the preset iteration condition, the target recommendation system can determine the scores of each user for all items in the M items based on the user feature matrix, latent vector matrix and item feature matrix obtained by the last update. For example, a target score matrix of size M×N is determined based on the user feature matrix, latent vector matrix and item feature matrix, and the elements in the target score matrix are determined as the predicted scores of a single user for a single item, thereby determining the predicted scores of each user for all items in the M items based on the target score matrix.

[0044] Optionally, after determining the predicted scores of all the items in the M items by each user, the target recommendation system can determine the items to be recommended corresponding to the N users respectively according to the predicted scores, and recommend the items to be recommended to the N users. For example, for each user, the M items are sorted in descending order of predicted scores, so that the top D items are determined as the items to be recommended. For another example, for each user, the items that have not been rated by the user before are sorted in descending order of predicted scores, so that the top E items are determined as the items to be recommended. Wherein, D and E are positive integers, and D and E can be the same or different.

[0045] Based on the scheme defined in the above steps S101 to S103, it can be known that in the embodiment of the present invention, a method of recommending projects to users based on information of multiple dimensions in matrix decomposition is adopted, by obtaining the scores of each user among N users for at least some of the projects in M ​​projects, and constructing a score matrix according to the scores, and then randomly generating an initial user feature matrix, an initial latent vector matrix, and an initial project feature matrix, and then updating the initial user feature matrix, the initial latent vector matrix, and the initial project feature matrix based on the matrix decomposition method, until the iteration of the matrix decomposition method meets the preset iteration condition, the predicted scores of each user for all the projects in M ​​projects are determined according to the updated user feature matrix, latent vector matrix, and project feature matrix, and the recommended projects corresponding to N users are determined according to the predicted scores, and the recommended projects are recommended to N users. Wherein, a single element in the score matrix represents the score of a single user for a single project, wherein the initial user feature matrix includes the user feature vectors of each user, the initial project feature matrix includes the project feature vectors of each project, and the initial latent vector matrix is ​​used to represent the correlation between the features in the user feature vector and the features in the project feature vector.

[0046] It is easy to notice that in the above process, by randomly generating the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix, the random determination of the user features, project features and the correlation between user features and project features is realized. By updating the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix based on the matrix decomposition method, the effective updating of information of multiple dimensions based on the matrix decomposition method is realized, so that it can more accurately reflect the potential relationship between users and projects. By determining the predicted scores of each user for all projects in M ​​projects according to the updated user feature matrix, latent vector matrix and project feature matrix when the iteration of the matrix decomposition method meets the preset iteration conditions, it is realized that in the matrix decomposition, the user's score for the project is determined based on the information of multiple dimensions, thereby improving the accuracy of the determined score, and then improving the recommendation accuracy.

[0047] It can be seen that the solution provided in the present application achieves the purpose of recommending items to users based on information of multiple dimensions in matrix decomposition, thereby achieving the technical effect of improving the accuracy of recommendations, and further solving the technical problem of low recommendation accuracy when recommending items to users based on matrix decomposition in related technologies.

[0048] In an optional embodiment, the target recommendation system may determine the number of dimensions of features in the user feature vector in the following manner: determine a target value based on target information, wherein the target information includes at least one of the following: the number of users of N users, the number of items of M items, the total number of ratings of N users, and the target value is positively correlated with the value in the target information; determine the number of dimensions of features in the user feature vector based on the target value, wherein the target value is positively correlated with the number of dimensions.

[0049] Optionally, the target recommendation system may determine the number of dimensions k of the features in the user feature vector according to the size and complexity of the data set. For example, the calculation formula of k may be as follows:

[0050] k=min(max(c 1 log(x+c 2 ),k min ),k max )

[0051] Among them, c 1 is a proportional constant used to control the rate of growth, c 2 is an offset used to ensure that log(x+c 2 ) is still a positive number, k min is the minimum number of dimensions, k max is the maximum number of dimensions, and x represents the target value.

[0052] Optionally, the target value can be measured based on the total number of users (i.e., the number of users of N users), the total number of projects (i.e., the number of projects of M projects), and the total number of ratings. For example, the target recommendation system has a preset mapping relationship between the value in the target information and the target value, and one of the optional mapping relationships can be "when the number of users is in the interval (10,100), add 1 to the target value", and the initial value of the target value can be 0, so that the target recommendation system can determine the target value based on the aforementioned mapping relationship and the target information. For example, a specific calculation formula for k can be as follows:

[0053] k=min(max(5log(x+1),5),50)

[0054] It should be noted that through the above process, the number of dimensions of the features in the user feature vector is dynamically adjusted according to the amount of data that the target recommendation system needs to process. By setting the number of dimensions to increase with the increase of data volume and decrease with the decrease of data volume, it not only effectively reduces unnecessary computing load and processing time and improves the efficiency of the system, but also can more finely capture user preferences and enhance the expression ability of user features when the data set grows, thereby significantly improving the accuracy of the recommendation algorithm. This mechanism that changes flexibly with the data scale enables the recommendation system to maintain high performance when facing massive data, providing users with more personalized and accurate services.

[0055] In an optional embodiment, in the process of updating the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix based on the matrix decomposition method, the target recommendation system can calculate the loss value according to the preset objective function, the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix, and then when the loss value is greater than the target threshold, the gradient descent method is used to update the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix to obtain the user feature matrix, the latent vector matrix and the project feature matrix, thereby repeating the step of calculating the loss value according to the preset objective function, the user feature matrix, the latent vector matrix and the project feature matrix, until the loss value is less than or equal to the target threshold, and it is determined that the iteration of the matrix decomposition method meets the preset iteration condition.

[0056] An alternative objective function can be as follows:

[0057]

[0058] Among them, Ω is the set of known ratings, r ui is an element in the rating matrix, representing the rating of user u on item i, U u is the user feature vector of user u in the initial user feature matrix U, I i is the item feature vector of item i in the initial item feature matrix I, V is the initial latent vector matrix, and λ is the regularization parameter. By introducing the L2 regularization term in the objective function, overfitting can be prevented. L2 regularization limits the model complexity by imposing a penalty term on the model parameters.

[0059] Optionally, the target processing system can calculate the loss value based on the above-mentioned calculation formula, and when the loss value is greater than the target threshold, the gradient descent method is used to update the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix to obtain the user feature matrix, the latent vector matrix and the project feature matrix.

[0060] After determining the user feature matrix, latent vector matrix and item feature matrix, the target recommendation system can calculate a new loss value based on the preset objective function, user feature matrix, latent vector matrix and item feature matrix, and when the new loss value is greater than the target threshold, the gradient descent method is used to continue updating the user feature matrix, latent vector matrix and item feature matrix, thereby continuously iterating until the loss value is less than or equal to the target threshold, and it is determined that the iteration of the matrix decomposition method meets the preset iteration condition.

[0061] In some embodiments, other optimization algorithms may be used instead of the gradient descent method.

[0062] It should be noted that, through the above process, the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix are effectively updated, so as to improve the accuracy of the subsequent ratings of each user on all the M projects, thereby improving the recommendation accuracy.

[0063] In an optional embodiment, in the process of updating the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix using the gradient descent method to obtain the user feature matrix, the latent vector matrix and the project feature matrix, the target recommendation system can determine N*M user-item pairs based on N users and M projects, and then for each user-item pair, according to the rating matrix, the initial project feature matrix, the user feature vector associated with the user-item pair, and the project feature vector associated with the user-item pair, calculate the prediction error value corresponding to the user-item pair, thereby updating the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix according to the prediction error value to obtain the user feature matrix, the latent vector matrix and the project feature matrix.

[0064] Optionally, a user-project pair includes a user and a project.

[0065] For example, an optional prediction error value calculation formula is as follows:

[0066] e ui =r ui -(U u ·V·I i T )

[0067] Among them, e ui represents the prediction error value corresponding to the user-item pair consisting of user u and item i, r ui is an element in the rating matrix, representing the rating of user u on item i, U u is the user feature vector of user u in the initial user feature matrix U, I i is the item feature vector of item i in the initial item feature matrix I, and V is the initial latent vector matrix.

[0068] Optionally, the user feature vector associated with the user-item pair refers to the user feature vector of the user in the user-item pair, and the item feature vector associated with the user-item pair refers to the item feature vector of the item in the user-item pair.

[0069] In some embodiments, after determining the prediction error values ​​corresponding to each user-item pair, the target recommendation system can filter out target user-item pairs from all user-item pairs according to the rating matrix, wherein the target user-item pair refers to the user-item pair corresponding to the existing rating (i.e., non-zero rating) in the rating matrix. Afterwards, the target processing system can update the initial user feature matrix, the initial latent vector matrix, and the initial item feature matrix according to the prediction error values ​​of the target user-item pairs to obtain the user feature matrix, the latent vector matrix, and the item feature matrix.

[0070] It should be noted that by updating each initial matrix according to the prediction error values ​​corresponding to the user-item pairs, the updating accuracy can be further improved, thereby improving the recommendation accuracy.

[0071] In an optional embodiment, in the process of updating the initial user feature matrix, the initial latent vector matrix and the initial item feature matrix according to the prediction error value to obtain the user feature matrix, the latent vector matrix and the item feature matrix, the target recommendation system can update the user feature vector according to the prediction error value of the user-item pair associated with the user feature vector in the initial user feature matrix to obtain the user feature matrix, update the initial latent vector matrix according to the prediction error value of the user-item pair to obtain the latent vector matrix, and update the item feature vector according to the prediction error value of the user-item pair associated with the item feature vector in the initial item feature matrix to obtain the item feature matrix.

[0072] Optionally, the target recommendation system can update the user feature vector according to the following formula:

[0073]

[0074] Among them, U u ′ represents the updated user feature vector of user u, U u represents the user feature vector of user u, α is the learning rate, e ui represents the prediction error value corresponding to the user-item pair consisting of user u and item i. The user-item pair associated with the user feature vector refers to the user-item pair including the target user, where the target user refers to the user to which the user feature vector belongs. Ω is the set of known ratings, i.e., the set of target user-item pairs.

[0075] Optionally, after obtaining the updated user feature vector of each user, a user feature matrix may be formed by the updated user feature vectors of each user.

[0076] Optionally, the target recommendation system can update the latent vector matrix according to the following formula:

[0077]

[0078] Among them, V ′ represents the updated latent vector matrix, and V represents the latent vector matrix.

[0079] Optionally, the target recommendation system can update the item feature vector according to the following formula:

[0080]

[0081] Among them, I i ′ represents the updated item feature vector of item i, I i represents the item feature vector of item i, the user-item pair associated with the item feature vector refers to the user-item pair including the target item, and the target item refers to the item to which the item feature vector belongs.

[0082] Optionally, after obtaining the updated project feature vectors of each project, a project feature matrix may be formed by the updated project feature vectors of each project.

[0083] In some embodiments, during the iterative process of matrix decomposition, the target recommendation system can use the AdaGrad optimizer to update parameters. The AdaGrad optimizer is an adaptive learning rate optimizer that can dynamically adjust the learning rate based on historical gradient information so that each parameter has a different learning rate. Specifically, AdaGrad maintains a cumulative sum of squared gradients to adjust the learning rate. In some embodiments, the system can also attach a timestamp to each user-item pair based on the corresponding scoring time of the user-item pair, and calculate a time weight factor ω(t) for the timestamp, which is multiplied by the factor when updating the vector to better capture changes in user interests over time.

[0084] It should be noted that, through the above process, targeted updates are achieved for each user feature vector and each item feature vector, which can further improve the accuracy of the update and further improve the accuracy of item recommendations.

[0085] In an optional embodiment, in the process of determining the predicted scores of each user for all items in the M projects based on the updated user feature matrix, latent vector matrix and project feature matrix, the target recommendation system may multiply the user feature matrix and the latent vector matrix to obtain a first matrix, and multiply the first matrix by the transposed matrix of the project feature matrix to obtain a target rating matrix, wherein the target rating matrix includes the predicted scores of each user for all items in the M projects.

[0086] For example, the target recommendation system can calculate the target rating matrix through the following formula:

[0087]

[0088] in, represents the target rating matrix, U″ represents the user feature matrix obtained by the last update, V″ represents the latent vector matrix obtained by the last update, I″ represents the item feature matrix obtained by the last update, and I″ T represents the transposed matrix of I″, and U″·V″ is equivalent to the first matrix mentioned above. Each element in the target score matrix represents the predicted rating of user u for item i.

[0089] It should be noted that, through the above process, accurate determination of the predicted scores of each user for all the M items is achieved.

[0090] In an optional embodiment, in the process of determining the recommended items corresponding to N users respectively according to the predicted scores, the target recommendation system can determine, for each user, the unrated items associated with the user according to the scoring matrix to obtain multiple target unrated items, and determine the user's predicted scores for the multiple target unrated items according to the target scoring matrix, thereby determining the recommended items corresponding to the user from the multiple target unrated items according to the predicted scores of the multiple target unrated items, to obtain the recommended items corresponding to the N users respectively.

[0091] Optionally, for each user, the target recommendation system may determine the element with a value of 0 corresponding to the user in the rating matrix as the unrated item of the user, thereby obtaining multiple target unrated items. Afterwards, the target recommendation system may determine the predicted rating of the user for the multiple target unrated items according to the target rating matrix.

[0092] Optionally, after determining the user's predicted scores for multiple target unrated items, the target recommendation system may sort the target unrated items in descending order of predicted scores, thereby determining the top E target unrated items as items to be recommended.

[0093] It should be noted that, through the above process, the items to be recommended are accurately determined, thereby improving the accuracy of recommendation. In addition, by recommending items that have not been rated to users, the recommendation effect can be further improved.

[0094] In an optional embodiment, Figure 2 This is a process of an optional project recommendation method according to an embodiment of the present invention. Figure 2 ,according to Figure 2 An optional application process of this embodiment is described. Optionally, the target recommendation system may include a data preprocessing module, a model initialization module, a latent vector optimization module, a recommendation generation module, and a performance evaluation module. Figure 2 As shown, the target recommendation system can collect and clean user rating data through the data preprocessing module, and then construct a rating matrix. After that, the model initialization module calculates the number of dimensions k and randomly generates an initial user feature matrix, an initial latent vector matrix, and an initial project feature matrix. Then, the latent vector optimization module uses the gradient descent method to update the initial user feature matrix, the initial latent vector matrix, and the initial project feature matrix until the preset iteration conditions are met. The recommendation generation module generates a target rating matrix based on the updated user feature matrix, the latent vector matrix, and the project feature matrix, thereby determining the recommended items. Optionally, the functions of the aforementioned performance evaluation module include evaluation index calculation and model parameter adjustment. The target recommendation system can use standard evaluation indicators to quantitatively analyze model performance. For example, calculate the difference between the recommended score and the true score, measure the prediction accuracy, calculate the absolute difference between the recommended score and the true score, measure the prediction stability, and calculate the proportion of truly relevant items in the recommendation list to the total relevant items, so that the system adjusts the latent vector dimension k, the learning rate α, the regularization parameter λ, etc. according to the evaluation results to further optimize the recommendation effect.

[0095] It can be seen that the solution provided in the present application achieves the purpose of recommending items to users based on information of multiple dimensions in matrix decomposition, thereby achieving the technical effect of improving the accuracy of recommendations, and further solving the technical problem of low recommendation accuracy when recommending items to users based on matrix decomposition in related technologies.

[0096] Example 2

[0097] According to an embodiment of the present invention, an embodiment of a project recommendation device is provided, wherein: Figure 3 is a schematic diagram of an optional project recommendation device according to an embodiment of the present invention. Figure 3 As shown, the device comprises:

[0098] The acquisition module 301 is used to obtain the scores of at least some of the M projects by each user among the N users, and construct a scoring matrix according to the scores, wherein a single element in the scoring matrix represents the score of a single user on a single project;

[0099] A generating module 302 is used to randomly generate an initial user feature matrix, an initial latent vector matrix and an initial project feature matrix, wherein the initial user feature matrix includes user feature vectors of each user, the initial project feature matrix includes project feature vectors of each project, and the initial latent vector matrix is ​​used to represent the correlation between features in the user feature vector and features in the project feature vector;

[0100] The processing module 303 is used to update the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix based on the matrix decomposition method until the iteration of the matrix decomposition method meets the preset iteration condition, and then determine the predicted scores of each user for all projects in the M projects according to the updated user feature matrix, latent vector matrix and project feature matrix, and determine the recommended projects corresponding to N users respectively according to the predicted scores, and recommend the recommended projects to the N users.

[0101] It should be noted that the above-mentioned acquisition module 301, generation module 302 and processing module 303 correspond to steps S101 to S103 in the above-mentioned embodiment. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.

[0102] Optionally, the project recommendation device also includes: a first determination module, used to determine a target value based on target information, wherein the target information includes at least one of the following: the number of users of N users, the number of projects of M projects, the total number of ratings of N users, and the target value is positively correlated with the value in the target information; a second determination module, used to determine the number of dimensions of features in the user feature vector based on the target value, wherein the target value is positively correlated with the number of dimensions.

[0103] Optionally, the processing module also includes: a calculation submodule, used to calculate the loss value according to a preset objective function, an initial user feature matrix, an initial latent vector matrix and an initial project feature matrix; an update submodule, used to update the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix using a gradient descent method when the loss value is greater than a target threshold, so as to obtain a user feature matrix, a latent vector matrix and a project feature matrix; a first processing submodule, used to repeatedly execute the steps of calculating the loss value according to a preset objective function, a user feature matrix, a latent vector matrix and a project feature matrix, until the loss value is less than or equal to the target threshold, and it is determined that the iteration of the matrix decomposition method satisfies a preset iteration condition.

[0104] Optionally, the updating submodule also includes: a determination unit, used to determine N*M user-item pairs based on N users and M items; a calculation unit, used to calculate, for each user-item pair, a prediction error value corresponding to the user-item pair based on the scoring matrix, the initial item feature matrix, the user feature vector associated with the user-item pair, and the item feature vector associated with the user-item pair; an updating unit, used to update the initial user feature matrix, the initial latent vector matrix, and the initial item feature matrix according to the prediction error value to obtain a user feature matrix, a latent vector matrix, and an item feature matrix.

[0105] Optionally, the updating unit also includes: a first updating subunit, used to update the user feature vector according to the prediction error value of the user-item pair associated with the user feature vector in the initial user feature matrix to obtain a user feature matrix; a second updating subunit, used to update the initial latent vector matrix according to the prediction error value of the user-item pair to obtain a latent vector matrix; a third updating subunit, used to update the item feature vector according to the prediction error value of the user-item pair associated with the item feature vector in the initial item feature matrix to obtain an item feature matrix.

[0106] Optionally, the processing module also includes: a second processing sub-module, used to multiply the user feature matrix and the latent vector matrix to obtain a first matrix; a third processing sub-module, used to multiply the first matrix with the transposed matrix of the project feature matrix to obtain a target rating matrix, wherein the target rating matrix includes the predicted ratings of each user for all items in the M projects.

[0107] Optionally, the processing module also includes: a first determination submodule, used to determine, for each user, the unrated items associated with the user according to the rating matrix, to obtain multiple target unrated items; a second determination submodule, used to determine the user's predicted ratings for the multiple target unrated items according to the target rating matrix; and a third determination submodule, used to determine the to-be-recommended items corresponding to the user from the multiple target unrated items according to the predicted ratings of the multiple target unrated items, to obtain the to-be-recommended items corresponding to N users respectively.

[0108] Example 3

[0109] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned item recommendation method when running.

[0110] Example 4

[0111] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, wherein: Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present invention, such as Figure 4As shown, the electronic device includes one or more processors; a memory for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the above-mentioned item recommendation method when running.

[0112] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0113] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0114] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0116] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0117] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0118] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A project recommendation method, characterized in that: include: Obtain scores of at least some of the M projects from each of the N users, and construct a score matrix based on the scores, wherein a single element in the score matrix represents a score of a single user on a single project; Randomly generate an initial user feature matrix, an initial latent vector matrix, and an initial project feature matrix, wherein the initial user feature matrix includes user feature vectors of each user, the initial project feature matrix includes project feature vectors of each project, and the initial latent vector matrix is ​​used to characterize the correlation between features in the user feature vector and features in the project feature vector; Based on the matrix decomposition method, the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix are updated until the iteration of the matrix decomposition method meets the preset iteration condition, and the predicted scores of each user for all the projects in the M projects are determined according to the updated user feature matrix, latent vector matrix and project feature matrix, and the recommended projects corresponding to the N users are determined according to the predicted scores, and the recommended projects are recommended to the N users.

2. The method according to claim 1, characterized in that The number of dimensions of the features in the user feature vector is determined by: Determining a target value according to target information, wherein the target information includes at least one of the following: the number of users of the N users, the number of items of the M items, and the total number of ratings of the N users, and the target value is positively correlated with a value in the target information; The number of dimensions of the features in the user feature vector is determined according to the target value, wherein the target value is positively correlated with the number of dimensions.

3. The method according to claim 1, characterized in that Based on a matrix decomposition method, the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix are updated, including: Calculate the loss value according to the preset objective function, the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix; When the loss value is greater than a target threshold, the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix are updated using a gradient descent method to obtain a user feature matrix, a latent vector matrix and a project feature matrix; Repeat the step of calculating the loss value according to the preset objective function, the user feature matrix, the latent vector matrix and the project feature matrix until the loss value is less than or equal to the target threshold, and determine that the iteration of the matrix decomposition method meets the preset iteration condition.

4. The method according to claim 3, characterized in that The initial user feature matrix, the initial latent vector matrix and the initial project feature matrix are updated by using a gradient descent method to obtain a user feature matrix, a latent vector matrix and a project feature matrix, including: Determine N*M user-item pairs based on the N users and the M items; For each user-item pair, calculating a prediction error value corresponding to the user-item pair according to the rating matrix, the initial item feature matrix, the user feature vector associated with the user-item pair, and the item feature vector associated with the user-item pair; The initial user feature matrix, the initial latent vector matrix and the initial item feature matrix are updated according to the prediction error value to obtain the user feature matrix, the latent vector matrix and the item feature matrix.

5. The method according to claim 4, characterized in that The initial user feature matrix, the initial latent vector matrix, and the initial item feature matrix are updated according to the prediction error value to obtain the user feature matrix, the latent vector matrix, and the item feature matrix, including: According to the prediction error value of the user-item pair associated with the user feature vector in the initial user feature matrix, the user feature vector is updated to obtain the user feature matrix; According to the prediction error value of the user-item pair, the initial latent vector matrix is ​​updated to obtain the latent vector matrix; According to the prediction error value of the user-item pair associated with the item feature vector in the initial item feature matrix, the item feature vector is updated to obtain the item feature matrix.

6. The method according to claim 1, characterized in that Determine the predicted scores of each user for all items in the M items according to the updated user feature matrix, latent vector matrix and item feature matrix, including: Multiplying the user feature matrix and the latent vector matrix to obtain a first matrix; The first matrix is ​​multiplied by the transposed matrix of the project feature matrix to obtain a target rating matrix, wherein the target rating matrix includes the predicted ratings of each user for all the projects in the M projects.

7. The method according to claim 6, characterized in that Determining the recommended items corresponding to the N users respectively according to the predicted scores includes: For each user, determining the unrated items associated with the user according to the rating matrix to obtain a plurality of target unrated items; Determining, according to the target rating matrix, the predicted ratings of the user for the multiple target unrated items; According to the predicted scores of the multiple target unscored items, the to-be-recommended items corresponding to the user are determined from the multiple target unscored items to obtain the to-be-recommended items corresponding to the N users respectively.

8. A project recommendation device, characterized in that: include: An acquisition module, used to acquire scores of at least some of the M projects from each of the N users, and construct a score matrix based on the scores, wherein a single element in the score matrix represents a score of a single user on a single project; A generating module, used to randomly generate an initial user feature matrix, an initial latent vector matrix and an initial project feature matrix, wherein the initial user feature matrix includes a user feature vector of each user, the initial project feature matrix includes a project feature vector of each project, and the initial latent vector matrix is ​​used to characterize the correlation between the features in the user feature vector and the features in the project feature vector; A processing module is used to update the initial user feature matrix, the initial latent vector matrix and the initial project feature matrix based on a matrix decomposition method until the iteration of the matrix decomposition method satisfies a preset iteration condition, and then determine the predicted scores of each user for all the projects in the M projects according to the updated user feature matrix, latent vector matrix and project feature matrix, and determine the recommended projects corresponding to the N users respectively according to the predicted scores, and recommend the recommended projects to the N users.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the item recommendation method described in any one of claims 1 to 7 when running.

10. An electronic device, characterized in that: The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the item recommendation method described in any one of claims 1 to 7 when run.

Citation Information

Patent Citations

  • Recommendation system optimization method with information of user and item and context attribute integrated

    CN102982107A

  • Project recommendation method based on attribute coupling matrix decomposition

    CN108959334A

  • Matrix decomposition recommendation method based on user preference

    CN108960966A

  • Personalized recommendation method based on user trust and convolutional neural network

    CN110555161A

  • Recommendation method and system based on hybrid deep learning model

    CN110807154A