Personalized recommendation method, electronic equipment and storage medium
Through the DNSVD model combining time decay function, SVD++ model and K-mean clustering algorithm, the shortcomings of the existing recommendation algorithm in terms of accuracy, diversity and novelty are solved, and the diversity and novelty are improved based on accuracy are achieved. , improve user satisfaction and exposure of "long-tail projects".
Patent Information
- Application Number
- CN202411407849.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-18
AI Technical Summary
The existing recommendation algorithms have shortcomings in accuracy, diversity and novelty, resulting in a single type of user recommendation list activities, making it difficult for unpopular activities to enter the recommendation list, which makes unpopular activities even more unpopular.
A personalized recommendation algorithm is proposed to effectively couple accuracy, diversity and novelty through the DNSVD model, using time decay function, singular value decomposition (SVD)++ model, Ebbinghaus forgetting curve and K-mean clustering algorithm , calculate user prediction scores for projects to ensure a balance between accuracy, diversity and novelty of recommendation results.
While ensuring accuracy, it improves the diversity and novelty of recommended results, improves user satisfaction, and increases the exposure of "long-tail projects", thereby bringing greater benefits to merchants.
Smart Images

Figure CN119474524A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of recommendation algorithms, and in particular to a personalized recommendation method, electronic equipment and storage medium. Background Art
[0002] As Internet information resources become increasingly rich and diversified, a serious information overload problem has emerged. It is becoming increasingly difficult for users to obtain the personalized information they need from massive data. In the context of information explosion, personalized recommendation has become increasingly important. It is widely used in e-commerce, social media, online video platforms and other fields, aiming to provide users with personalized content recommendations, thereby improving user experience and increasing platform activity.
[0003] Most existing recommendation algorithm models focus on improving accuracy. However, the final perception of the recommendation system is completed by users, and the user's perception comes from many aspects. In addition to the accuracy that has always been pursued, it also includes novelty, diversity, explainability of recommendation reasons, robustness, etc. Most existing algorithms perform poorly in novelty and diversity, resulting in a single activity type in the user's recommendation list. Unpopular activities cannot enter the recommendation list, making unpopular activities even more unpopular. The diversity of recommendation algorithms requires that there must be a certain difference between recommended items, and the recommended result set should cover a variety of categories as much as possible to meet the potential interests of users in all aspects. Novelty requires that the recommended results are unexpected but reasonable, and is mainly used to measure the surprise of the recommendation results. Some of these goals of the recommendation system are independent of each other, some are mutually exclusive, and some are mutually progressive. There is a contradiction between accuracy and novelty and diversity, and a balance must be achieved when recommending; novelty and diversity have a certain mutual advancement relationship and can complement each other. Therefore, they cannot be simply combined, and the constraint relationship between them must be considered. Summary of the invention
[0004] In order to solve the problems of data sparsity, poor recommendation accuracy, low diversity and novelty in existing recommendation algorithms, the present invention proposes a personalized recommendation algorithm that considers the effective coupling of accuracy, diversity and novelty to improve user satisfaction. The algorithm considers accuracy, diversity and novelty at the same time, and optimizes the diversity and novelty of the recommendation algorithm while ensuring better accuracy.
[0005] To achieve the above-mentioned object of the invention, one aspect of the present invention provides a personalized recommendation method, which effectively couples accuracy, diversity and novelty to calculate the user's predicted score for the item, comprising the following steps:
[0006] Step S1, read user data and divide the user data into a training set and a test set, and construct a user-item rating matrix;
[0007] Step S2, adjusting the user's rating data for the project through a time decay function to update the user's project rating;
[0008] Step S3, performing matrix decomposition on the adjusted rating data to obtain a user-feature factor matrix and an item-feature factor matrix;
[0009] Step S4, calculating the user's preference value for item novelty;
[0010] Step S5, calculating the user's diversity tendency;
[0011] Step S6, improving the SVD (Singular Value Decomposition) ++ model, bringing the novelty preference value and diversity tendency into the improved SVD ++ model, and obtaining DNSVD (SVD ++
[0012] model considering diversity and novelty factors, SVD++) model considering diversity and novelty factors, score prediction of the DNSVD model The calculation formula is:
[0013]
[0014] Among them: μ is the mean score, b u , b i are the bias items of user u and item i respectively, X j T is the potential factor of long-tail item j, representing the product characteristics of the long-tail item; T l It is a collection of users who give excessive ratings to niche items. <P u , X j > Inner Product represents the novelty score of user u on item i, defined as the novelty index, p u is the potential factor vector of user u, q i is the latent factor vector of item i;
[0015] Step S7, training the DNSVD model, using the user-feature factor matrix and the item-feature factor matrix to iterate the parameters, and finding the optimal value of each parameter until the model iteration reaches the loss function threshold;
[0016] Step S8: Make predictions on the test set, calculate the user's predicted value for the item, and make recommendations based on the predicted value.
[0017] Furthermore, in step S2, the Ebbinghaus forgetting curve is used to calculate the time decay, and the time decay function is expressed as follows:
[0018]
[0019] Among them, δ is the forgetting coefficient, δ∈[0,1]. The larger its value is, the faster the decay process is. o ,t m , t represent the earliest time, the latest time and the current project scoring time in the data set respectively;
[0020] If r(u, i, t) is the rating of item i given by user u at time t, the user's rating of the item after correction is expressed as follows:
[0021] r′(u,i,t)=r(u,i,t)*decay(t).
[0022] Furthermore, in step S4, the user's liking degree is defined as libi, and the user's libi for a single item is verified by the user's rating of the item. The existing item ratings are normalized. The highest libi of an item is 1, and the lowest is 0. The user's liking degree libi is defined as:
[0023]
[0024] Among them, rating(i,u) is the rating of user u on item i, and max score is the maximum value in the scoring system; effective novelty should take into account novelty and user's preference, so the effective novelty enov is expressed as follows:
[0025] enov i,u =nov(i)libi(i,u)
[0026] where nov(i) represents the novelty factor.
[0027] Furthermore, the calculation steps of the user's diversity tendency are as follows:
[0028] Step S501, randomly select K objects as K initial cluster centers, and assign each object to the most similar cluster according to the similarity with the cluster center;
[0029] Step S502, updating the cluster center, recalculating the mean of each cluster according to the current object in the cluster, and using the new cluster center to redistribute the object to the cluster that is most similar to the cluster center;
[0030] Step S503, repeating step S502, iteratively reallocating objects to various clusters, improving the partitioning process until object reallocation no longer occurs, and the clustering process returns the result cluster;
[0031] Step S504: After obtaining K clusters of all items using the K-means clustering algorithm, the items in the user's historical feedback records are compared with the K clusters after clustering to obtain L subclasses (L<=K), where L is the number of subclasses of the items in the user's historical feedback records. The user's diversity tendency is calculated by the following formula:
[0032]
[0033] Furthermore, in step S7, a regularization term is introduced to control the degree of reduction of the loss function, and the novelty index and the diversity tendency are added to the model as additional regularization terms, and the loss function is expressed as follows:
[0034]
[0035] in represents the error between the predicted rating and the actual rating of item i by user u. The goal of this term is to improve the accuracy of the recommendation system by minimizing the difference between the predicted rating and the actual rating;
[0036] represents the error between the predicted novelty score of user u for item i and the true novelty score; λ x represents the regularization parameter, controlling the novelty weight; d represents the regularization parameter, which adjusts the diversity recommendation strength; d >0 is the adaptive diversity regularization parameter. The larger its value, the stronger the overall demand for diversity in recommended topics. ω represents the diversity tendency. d(j1, j2) is the Euclidean distance between two products j1 and j2.
[0037] bu 2 、bi 2 , is the regularization term, and λ is the regularization parameter, which is used to control the complexity of the model to prevent the model from overfitting;
[0038] p u is the user’s latent factor vector, q j1 ,q j2 are the latent factor vectors of items j1 and j2 respectively, Indicates the preference of user u for the difference between items j1 and j2. At the same time, multiplied by the user's diversity tendency w, this formula can control the output strength of the diversity regularization term. The whole formula encourages the recommendation system to produce more diverse recommendation results by penalizing recommendation pairs with small differences in user preferences but large distances between products.
[0039] Furthermore, stochastic gradient descent is used to update the values of each parameter to find the optimal solution of the parameter. The update formula of each parameter is expressed as:
[0040]
[0041] Where: θ a are model parameters and η is the learning rate.
[0042] A second aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a personalized recommendation method as described above when executing the computer program.
[0043] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a personalized recommendation method as described above.
[0044] Compared with the prior art, the present system and method have the following advantages:
[0045] The present invention proposes a personalized recommendation algorithm that considers the effective coupling of accuracy, diversity and novelty: the DNSVD model. This model can improve the diversity and novelty of recommendation results while ensuring accuracy, and consider the overall performance of the recommendation system as comprehensively as possible, so as to better meet the personalized needs of users and improve user satisfaction. At the same time, it can also increase the exposure rate of "long-tail projects", thereby bringing greater benefits to merchants. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 The figure is a flow chart of a personalized recommendation method. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 are within the scope of protection of the present invention.
[0048] like Figure 1The flowchart of the method of this embodiment is shown. This embodiment discloses a personalized recommendation algorithm that considers the effective coupling of accuracy, diversity and novelty.
[0049] The algorithm is defined as follows:
[0050] The input is the user set U;
[0051] Project Collection I;
[0052] Regularization coefficients λ, λ x , d ;
[0053] The output is the predicted rating of user u for item i.
[0054] The following steps are involved:
[0055] Step S1, read user data and divide the user data into a training set and a test set, and construct a user-item rating matrix;
[0056] Step S2, adjusting the user's rating of the project through a time decay function to update the user's project rating;
[0057] Step S3, performing matrix decomposition on the adjusted rating data to obtain a user-feature factor matrix and an item-feature factor matrix;
[0058] Step S4, calculating the novelty factor of the user's preference value for the item novelty;
[0059] Step S5, calculating the user's diversity tendency;
[0060] Step S6, improving the SVD++ model, bringing the novelty factor and diversity tendency into the improved SVD+ model to obtain a DNSVD model;
[0061] Step S7, training the DNSVD model, iterating the parameters, and finding the optimal value of each parameter until the model iteration reaches the loss function threshold;
[0062] Step S8, make predictions on the test set and calculate the user's predicted value for the item.
[0063] In step S2, since the user's interests will change over time, the more recent the ratings are, the more they can represent the user's current interests. In order to ensure the accuracy of the recommendation and make the user's rating values more consistent with the user's dynamic interests, the Ebbinghaus forgetting curve is introduced to simulate the decay process of the importance of user feedback information. The forgetting factor decay(t) in the Ebbinghaus forgetting curve is expressed as follows:
[0064]
[0065] Among them, δ is the forgetting coefficient, δ∈[0,1], the larger its value, the faster the decay process. o ,t m , t represent the earliest time, latest time and current item rating time in the data set respectively. Let r(u, i, t) be the rating of item i by user u at time t. After introducing the Ebbinghaus forgetting curve, the new rating can be expressed as follows:
[0066] r′(u,i,t)=r(u,i,t)*decay(t) (2)
[0067] In step S4, in the recommendation system, the core of improving novelty is to give unknown items a higher score ranking. The novelty of an item refers to the proportion of all users who have not interacted with the item by rating it. Herlocker interprets it as "recommending items that the target user is potentially interested in but does not know about". Novelty is also a very important indicator that affects user satisfaction. Therefore, we define an effective novelty factor to indicate the user's preference for the item.
[0068] The original novelty definition is expressed as follows:
[0069]
[0070] Where ratingnum(i) is the number of all users who have rated item i in the existing dataset, totalpersonnum is the number of all users, and the user's preference is defined as libi. The user's libi for a single item can be verified by the user's rating of the item. The existing item ratings are normalized, and the highest libi of an item is 1, and the lowest is 0. Then libi is defined as follows:
[0071]
[0072] Among them, rating(i,u) is the rating of user u on item i, and max score is the maximum value in the scoring system. For example, in the Movie-Lens100k dataset, the scoring range is 0 to 5. score =5.
[0073] In addition to novelty, effective novelty also takes into account the user's preference. The effective novelty enov is expressed as the product of the user's preference libi and the novelty nov(i).
[0074] enov i,u =nov(i)libi(i,u) (5)
[0075] Diversity has two main meanings: intra-user diversity and inter-user diversity. Intra-user diversity, also known as individual diversity, measures the diversity of recommendations from the perspective of a single user, and mainly examines the ability of the algorithm to find unpopular items that users like. Inter-user diversity, also known as overall diversity, mainly emphasizes that the recommendations for different users should be as different as possible. For example, some users have broad interests and like various types of movies, while some users have relatively single interests and only like to watch one or two fixed types of movies. Different users have different diversity needs, so targeted recommendations are needed. In addition, improving diversity can not only improve user satisfaction, but also allow merchants to recommend more "long-tail products", thereby obtaining greater profits. Therefore, the present invention introduces diversity propensity as a diversity indicator, fully considering the viewing preferences of different users to achieve higher user satisfaction.
[0076] In step S5, using the attribute information of the project, the feature values of project a and project b in the k-dimensional attribute feature space are set to be f a ={a1, a2, ..., a k}, f b ={b1, b2, ..., b k}, then the similarity calculation of items a and b is expressed as follows:
[0077]
[0078] Among them, sim a,b ∈[0, 1].
[0079] The process steps of K-means clustering are as follows:
[0080] Step S501: K objects are randomly selected as K initial cluster centers, and each object is assigned to the most similar cluster according to the similarity with the cluster center.
[0081] Step S502: Update the cluster center. Recalculate the mean of each cluster based on the current object in the cluster, and use the new cluster center to reallocate the object to the cluster that is most similar to the cluster center.
[0082] Step S503, repeating step S502, iteratively reallocating objects to various clusters, improving the partitioning process until object reallocation no longer occurs, and the clustering process returns the result cluster.
[0083] Step S504: After obtaining K clusters of all items using the K-means clustering algorithm (except for outliers), the items in the user's historical feedback records are compared with the K clusters after clustering to obtain L subclasses (L<=K), where L is the number of subclasses of the items in the user's historical feedback records. The user's diversity tendency is then calculated by It can be obtained.
[0084] Since the latent factors of a user are trained by his / her historical ratings. In our model, not only the observed ratings of the user but also the ratings of the long-tail items are used to train the latent factors. We define the latent factor of the long-tail item j as x j , represents the product characteristics of long-tail items. The number of long-tail items is t, T l is a collection of users who have rated niche items too highly. You can use <P u , X j >Inner product is used to represent the novelty score of user u on item i, which is used as the novelty indicator.
[0085] Then, combining the diversity tendency and novelty factor, let The score prediction calculation formula of the improved SVD++ model is:
[0086]
[0087] Where: μ is the mean score, b u , b i are the bias items of user u and item i respectively.
[0088] The loss function shows the degree of deviation between the predicted score and the actual score, so the accuracy of the model's predicted score will increase as the loss function decreases. However, if the loss function is too small, overfitting will occur, resulting in a weakened generalization ability of the model. To address this problem, the present invention introduces a regularization term to control the degree of reduction of the loss function, and at the same time adds the novelty factor and diversity tendency to the model as additional regularization terms. The resulting loss function is shown below:
[0089]
[0090] Where: represents the error between the predicted rating and the actual rating of item i by user u. The goal of this term is to improve the accuracy of the recommendation system by minimizing the difference between the predicted rating and the actual rating;
[0091] represents the error between the predicted novelty score of user u for item i and the true novelty score; λ x represents the regularization parameter, controlling the novelty weight. d Represents the regularization parameter, which adjusts the diversity recommendation strength. d>0 is the adaptive diversity regularization parameter. The larger its value, the stronger the overall demand for diversity in recommended topics. ω represents the diversity tendency; d(j1, j2) is the Euclidean distance between two products j1 and j2. If the distance between the two products is large and the diversity tendency ω of user u is large, the proposed regularization term can constrain the latent vectors of user u and related items, reduce the difference in u's ratings for items i and j (in fact, it makes the probabilities of the two being recommended as close as possible), and realize personalized adjustment of the strength of diversity recommendation.
[0092] bu 2 、bi 2 , is the regularization term, and λ is the regularization parameter, which is used to control the complexity of the model to prevent the model from overfitting. u is the user’s latent factor vector, q j1 ,q j2 are the latent factor vectors of items j1 and j2 respectively. The whole formula encourages the recommendation system to produce more diverse recommendation results by penalizing recommendation pairs with small differences in user preferences but large distances between products.
[0093] The present invention uses stochastic gradient descent to update the values of each parameter, thereby finding the optimal solution for the parameter. The update formula for each parameter is:
[0094]
[0095] where θ a are model parameters and η is the learning rate.
[0096] This paper proposes a personalized recommendation algorithm that considers the effective coupling of accuracy, diversity and novelty: the DNSVD model. This model can improve the diversity and novelty of recommendation results while ensuring accuracy, and consider the overall performance of the recommendation system as comprehensively as possible, so as to better meet the personalized needs of users and improve user satisfaction. At the same time, it can also increase the exposure rate of "long-tail projects", thereby bringing greater benefits to merchants.
[0097] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A personalized recommendation method, characterized in that: The method effectively couples accuracy, diversity and novelty to calculate the predicted score of the user for the item, including the following steps: Step S1, read user data and divide the user data into a training set and a test set, and construct a user-item rating matrix; Step S2, adjusting the user's rating data for the project through a time decay function to update the user's project rating; Step S3, performing matrix decomposition on the adjusted rating data to obtain a user-feature factor matrix and an item-feature factor matrix; Step S4, calculating the user's preference value for item novelty; Step S5, calculating the user's diversity tendency; Step S6, improving the SVD++ model, bringing the novelty preference value and diversity tendency into the improved SVD++ model to obtain a DNSVD model, and the score prediction of the DNSVD model The calculation formula is: Among them: μ is the mean score, b u 、b i are the bias items of user u and item i respectively, X j T is the potential factor of long-tail item j, representing the product characteristics of the long-tail item; T l It is a collection of users who give excessive ratings to niche items. <P u , X j > Inner Product represents the novelty score of user u on item i, defined as the novelty index, p u is the potential factor vector of user u, q i is the latent factor vector of item i; Step S7, training the DNSVD model, using the user-feature factor matrix and the item-feature factor matrix to iterate the parameters, and finding the optimal value of each parameter until the model iteration reaches the loss function threshold; Step S8: Make predictions on the test set, calculate the user's predicted value for the item, and make recommendations based on the predicted value.
2. A personalized recommendation method according to claim 1, characterized in that: In step S2, the Ebbinghaus forgetting curve is used to calculate the time decay, and the time decay function is expressed as follows: Among them, δ is the forgetting coefficient, δ∈[0,1]. The larger its value is, the faster the decay process is. o ,t m , t represent the earliest time, the latest time and the current project scoring time in the data set respectively; If r(u, i, t) is the rating of item i given by user u at time t, the user's rating of the item after correction is expressed as follows: r′(u,i,t)=r(u,i,t)*decay(t).
3. A personalized recommendation method according to claim 1, characterized in that: In step S4, the user's liking degree is defined as libi. The user's libi for a single item is verified by the user's rating of the item. The existing item ratings are normalized. The highest libi of an item is 1, and the lowest is 0. The user's liking degree libi is defined as: Among them, rating(i,u) is the rating of user u on item i, and max score is the maximum value in the scoring system; effective novelty should take into account novelty and user's preference, so the effective novelty enov is expressed as follows: enov i,u =new(s) free(s) where nov(i) represents the novelty factor.
4. A personalized recommendation method according to claim 1, characterized in that: The calculation steps of the user's diversity tendency are as follows: Step S501, randomly select K objects as K initial cluster centers, and assign each object to the most similar cluster according to the similarity with the cluster center; Step S502, updating the cluster center, recalculating the mean of each cluster according to the current object in the cluster, and using the new cluster center to reallocate the object to the cluster that is most similar to the cluster center; Step S503, repeating step S502, iteratively reallocating objects to various clusters, improving the partitioning process until object reallocation no longer occurs, and the clustering process returns the result cluster; Step S504: After obtaining K clusters of all items using the K-means clustering algorithm, the items in the user's historical feedback records are compared with the K clusters after clustering to obtain L subclasses (L<=K), where L is the number of subclasses of the items in the user's historical feedback records. The user's diversity tendency is calculated by the following formula:
5. A personalized recommendation method according to claim 1, characterized in that: In step S7, a regularization term is introduced to control the degree of reduction of the loss function, and the novelty index and the diversity tendency are added to the model as additional regularization terms, and the loss function is expressed as follows: in represents the error between the predicted rating and the actual rating of item i by user u. The goal of this term is to improve the accuracy of the recommendation system by minimizing the difference between the predicted rating and the actual rating; represents the error between the predicted novelty score of user u for item i and the true novelty score; λ x represents the regularization parameter, controlling the novelty weight; d represents the regularization parameter, which adjusts the diversity recommendation strength; d>0 is the adaptive diversity regularization parameter. The larger its value, the stronger the overall demand for the diversity of recommended topics. ω represents the diversity tendency. d(j1, j2) is the Euclidean distance between two products j1 and j2. bu 2 、bi 2 , is the regularization term, and λ is the regularization parameter, which is used to control the complexity of the model to prevent the model from overfitting; p u is the user’s latent factor vector, q j1 ,q j2 are the latent factor vectors of items j1 and j2 respectively, Indicates the preference degree of user u for the difference between items j1 and j2.
6. A personalized recommendation method according to claim 1, characterized in that: Stochastic gradient descent is used to update the value of each parameter to find the optimal solution of the parameter. The update formula of each parameter is expressed as: Where: θ a are model parameters and η is the learning rate.
7. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, a personalized recommendation method according to any one of claims 1 to 6 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a personalized recommendation method as described in any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Progressive book recommendation method and system, terminal equipment and medium
CN121388269A