Summary of the invention
In view of weak point of the prior art, the invention provides the dynamic recommendation method that a kind of adaptation user interest based on temporal information changes, comprise the following steps:
Step one, basis collect the scoring list of the user-article obtained from e-commerce website, build the explicit rating matrix of user-article;
Step 2, quantification treatment is carried out to the comprising click, collect, add shopping cart of user, the implicit feedback behavioural information of purchase, then build the implicit scores matrix of user-article;
Step 3, utilize step one and step 2 result build user-article comprehensive grading matrix;
Step 4, according to Person formula of correlation coefficient, calculate the similarity between two two users;
Step 5, carry out descending sort according to similarity size between user, obtain the K position user forward with targeted customer's similarity and gather as the neighbour of targeted customer;
Step 6, choose monotone decreasing exponential time function as scoring weighting function, different according to the interests change trend that the scoring of user embodies, calculate the weight factor of every user in scoring weighting function;
Step 7, introducing scoring weighting function improve score in predicting formula, and target of prediction user is to the score value of article of not marking;
N item article forward for prediction score are recommended user by step 8, employing TOP-N recommend method.
Wherein in step one, the scoring scope of user to article is the integer got between 1-5.Meanwhile, the row of explicit rating matrix represents user, and article are shown in list, if certain user does not mark to certain article, then corresponding matrix entries element is empty.
In step 2 when certain user does not produce explicit scoring to certain article, just quantize the carrying out of user concealed behavior, definition purchase is 5 points, and adding shopping cart is 4 points, and collection is 3 points, clicks twice and is 2 points above, clicks and is once 1 point.
In step 3, the obtaining value method of comprehensive grading is: if user gives explicit scoring to article, then this score value is comprehensive grading; If user does not give scoring to article, then quantize the implicit expression behavior in step 2, namely the quantized value obtained is comprehensive grading.
The detailed process of step 6 is: by exponential time function f (t) of monotone decreasing=e
-ω tbe multiplied by the scoring of user to article, the scoring weight of adjustment user, namely give larger weight to the score value of the article that user accesses in the recent period, the score value of the article of past access gives less weight.Because the interests change trend of each user is different, so give every user different personalized factor ω, wherein, calculate ω to need to classify according to the classification belonging to article to the article of user's scoring, be simultaneously a time period divide the scoring time of article according to three months according to user, counting user within each time period to the scoring behavior of a certain class article, if there is scoring behavior to be just designated as 1, otherwise be designated as 0, simultaneously the actual scoring number of counting user in some time periods to a certain class article.
The present invention is directed to the collaborative filtering recommending method that e-commerce website uses to improve, binding time information, consider user interest over time, for it provides more accurate personalized article recommendation service.Fully take into account a lot of user may unwilling cost thought mark to article simultaneously, the explicit scoring caused is little, make the problem that the result of recommendation is not accurate enough, be combined the quantification of the implicit feedback behavioural information for user, effectively alleviate the openness problem of data.Relative to traditional collaborative filtering recommending method, be particularly suitable for doing personalized precisely recommendation, for ecommerce brings better benefit to user in ecommerce.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
As shown in Figure 1, this method comprises following steps:
S10, definition user collects U={u
1, u
2..., u
m, m represents total number of users, article collection P={p
1, p
2..., p
n, n represents total number of items, X representative scoring item x
i, jthe explicit rating matrix of m*n, x
i, jrepresent that user i is to the explicit scoring of article j, wherein, 1≤i≤m, 1≤j≤n, x
i, jspan be { 1,2,3,4,5}.If certain user i comments too to article j, then corresponding matrix entries x
i, jfor sky.So by m position user, the explicit rating matrix X of the user-article of n article structure is designated as:
S20, if certain user i comments too to article j, then analyzes the implicit feedback behavior of this user to these article, is carried out quantification treatment, if this user i does not also produce implicit expression behavior to article j, then and corresponding matrix entries y
i, jfor sky.
The quantizing rule of user concealed feedback behavioural information is:
1) if. user have purchased article, so y
i, j=5;
2) if. user i adds shopping cart article j, so y
i, j=4;
3) if. user i has collected article j, so y
i, j=3;
4) if. user i clicks article j for many times, so y
i, j=2;
5) if. user i only clicks article j, so a y
i, j=1;
Then the implicit scores matrix Y of user-article is designated as:
S30, the explicit rating matrix of user-article built in conjunction with S10 and S20 and the implicit scores matrix of user-article, finally build the comprehensive grading matrix R of user-article, definition r
i, jrepresent the explicit scoring of user i to article j and the comprehensive grading of implicit scores, if user has explicit scoring to article, this explicit scoring is comprehensive grading.
Comprehensive grading r
i, jvalue formula as follows:
The comprehensive grading matrix R of so final user-article is designated as:
Final comprehensive grading table as shown in Figure 2.
S40, utilizes Pearson correlation coefficient formula, calculate two user i, v based on article scoring between similarity:
Wherein r
i, j, r
v, jexpression user i, v are to the scoring of article j respectively,
represent user i respectively, the average score of v, cn represents the article of both common scorings.
Such as, in calculating chart 3 targeted customer tar respectively with user a, the similarity of b, c:
The average score of targeted customer tar is:
The similarity of targeted customer tar and user a is:
sim(tar,b)=0.00sim(tar,c)=0.89sim(tar,d)=-0.80
S50, carries out descending sort according to sim (i, v) size, obtains the neighbour of targeted customer as shown in Figure 4, wherein, and sim (i, v
1) > sim (i, v
2) > ... > sim (i, v
m-1), obtain and gather as the neighbour of targeted customer with the forward K position user of targeted customer's similarity.
Clearly, as K=2, according to the result of calculation of S40, choose user a and user c and collect as the neighbour user of targeted customer tar.
S60, introduces exponential time function f (t)=e
-ω tas scoring weight, it is the function of a monotone decreasing, and the value of t is larger, and the value of f (t) is less.And, because the interests change trend of each user is different, so every user should be given different personalized weight factor ω, ω is larger, represent that interest decays faster in time, otherwise then slower, ω ∈ (0,1) .t represents the interval to the earliest time that article to be predicted are marked in current time in system and neighbour user.
1) first the article of user's scoring are classified according to the classification belonging to article, be simultaneously a time period divide the scoring time of article according to three months according to user, counting user within each time period to the scoring behavior of a certain class article, if there is scoring behavior to be just designated as 1, otherwise be designated as 0, the actual scoring number of counting user in some time periods to a certain class article simultaneously, concrete form is as Fig. 5.
2) calculate the ω value of every user, the computing formula of ω is:
wherein, ω
arepresent that user is to the personalized factor of category-A article interest-degree, N
arepresent that user is to the scoring number of category-A article, n represents that user comments the total number of undue article,
represent probability.
Wherein, d represents time period sequence number.
Such as, statistics targeted customer tar was the categorize interests of a time period according to three months in 1 year, as shown in Figure 5.So, user tar is to the personalized factor of category-A article interest-degree
S70, will mark weighting function f (t
ij) introducing score in predicting formula, target of prediction user is to the score value of article of not marking.
The score in predicting formula introduced after scoring weight is:
Wherein, P
i, jrepresent that user i marks to the prediction of article j, N
ifor the neighbour user of user i,
with
represent user i respectively, the average mark of v scoring, r
v, jrepresent that neighbour user v is to the score value of article j, f (t
i, j) represent that user i is to the scoring weighting function of article j.
Such as, in prognostic chart 3 targeted customer tar to the article Item that do not mark
2scoring, suppose Item
2belong to category-A article, and the current time in system is July 18, neighbour user a and c of targeted customer tar is to Item
2the scoring time be respectively July 17 and July 16, then according to the implication of t in S60, time interval t should value be 2.So,
In like manner, Item is supposed
4belong to D class article, then ω
d=0.6, as time interval t=2
S80, adopts TOP-N recommend method, and N item article forward for prediction score are recommended user.Such as N=1, because
so article Item
4recommend targeted customer.
Be more than better embodiment of the present invention, but protection scope of the present invention is not limited thereto.Any those of ordinary skill in the art are in the technical scope disclosed by the present invention, and the conversion expected without creative work or replacement, all should be encompassed within protection scope of the present invention.Therefore the protection domain that protection scope of the present invention should limit with claim is as the criterion.