An Recommendation Algorithm Based On Weighted Slope One Algorithm and User-Based Collaborative Filtering
An Recommendation Algorithm Based On Weighted Slope One Algorithm and User-Based Collaborative Filtering
Abstract: Personalized recommendation is one of the most popular marketing methods, and collaborative filtering is one
of the most successful recommendation technologies. However, data sparsity problem results in the low prediction
accuracy and the poor recommendation quality. To resolve this problem, the present study proposed an improved
recommendation method with weighted Slope one algorithm. The method calculates the similarity between users based
on users’ ratings, so as to find every user’s nearest neighbors. Based on the nearest neighbor’s ratings, weighted Slope
one algorithm is used to predict the unknown ratings of the target user and to present recommendation results. In the
experiment, MovieLens data set was used to test the recommendation accuracy of the method. The experimental results
suggest that the improved algorithm can effectively improve the accuracy of rating prediction and the recommendation
performance.
Key Words: Personalized Recommendation, Similarity, Collaborative Filtering, Weighted Slope One Algorithm
978-1-4673-9714-8/16/$31.00 2016
c IEEE 2431
neighbors to predict empty ratings and to give
recommendation.
¦ ( R − R )( R − R ) i,m i j,m j
Sim ( i, j) =
m∈Ii,j
(3)
2 THE SIMILARITY BETWEEN USERS
¦ (R − R ) ¦ (R − R )
2 2
m∈Ii,j i,m i m∈Ii,j j,m j
In order to find user’s neighbors, this study use the
collaborative filtering method to calculate the similarity Where R i is the average rating of user i on the users set Ii,j ,
between users and to find the nearest neighbor set. R j is the average rating of user j on the users set Ii,j .
Collaborative filtering is mainly classified into two types:
model-based collaborative filtering algorithm and The calculation of cosine correlation is simple, but when
memory-based collaborative filtering algorithm. The latter the data is sparse, it is not a good way to find the nearest
algorithm includes user-based collaborative filtering and neighbors. Pearson correlation can achieve better results
item-based collaborative filtering. The main idea of compared with other methods [11], it was used by many
user-based collaborative filtering is to find out the users recommendation systems. In this research, the similarities
who are similar to the behavior of the target user based on among users are calculated by Pearson correlation method.
history data, and to recommend these users' behavior to the
target user. So the first step of collaborative filtering 3 SLOPE ONE ALGORITHM
algorithm is to calculate the similarities among users, then Slope one is a typical item-based collaborative filtering
do recommendations to the target user. The recommended algorithm. The algorithm takes into account both the
items should be the items which have not been rated by the information from other users who rate the same items and
target users. The aim of similarity calculation is to find the information of the other items rated by the same user,
similar users, and get the neighbor set based on the value of and it is based on the rating difference between items.
similarity. The similarity is particularly important for that it The basic Slope one algorithm [5][6][7] is derived from a
affects the quality of recommendation. The specific way of
simple linear model: y = f ( x ) = x + b , where x is a
similarity calculation is introduced as follows.
To calculate the similarities between users according to variable presented the difference of ratings and b is a
users’ ratings, the fundamental computing methods are constant, for example, the ratings of five items which are
rated by user1, user2, user3,user4 are shown in table 1 as
cosine correlationǃadjusted cosine vector similarityǃand
follows:
Pearson correlation.
First, the rating matrix R(mhQ) of users is defined, where Table1. Ratings for five items
m denotes the number of users, n represents the number of item
items. R i,j is the rating of the item j rated by user i, Ii,j is item1 item2 item3 item4 item5
user
the item set both rated by user i and user j, where user1 5 1 1 3
Ii,j = Ii ∩ I j .
user2 4 2 3 2 2
1) Cosine correlation
user3 4 3 5 3
The user's ratings are seen as a vector of n-dimension
spaces on the project, user i and user j are expressed as the user4 3 2 ?
vector i and the vector j. If the user has no ratings on the
items, the ratings are defined as zero, so the similarity
calculation between user i and user j is as follows: From the table 1, we want to know how the user4 rated to
G G the item5, so the average difference which user1, user2 and
i⋅ j
Sim ( i, j) = cos ( i, j) = G 2 G 2 (1) user3 had rated to the item2, item3 and item5 is first
& i & ⋅& j & calculated, the calculation process is:
Where numerator is the inner product of two users’ rating ( ( 3 − 1 ) + ( 2 − 2 ) ) / 2 = 1 , ( ( 3 − 1) + ( 2 − 3 ) ) / 2 = 0.5 . The
vectors, the denominator is the product of two users’ rating
norm of vectors. computational result is: ( ( 3 + 1) + ( 2 + 0.5) ) / 2 = 3.25 , thus,
2) Adjusted cosine vector similarity this result fill the vacant rating of user4 rated to the item5.
Ii is the item set rated by user i, I j is the item set rated by Given the training set, the average difference between item
i and item j could be defined as dev j,i , the formula is as
user j, so the formula is as follows:
follows:
¦ (R − R )(R − R )
m∈Ii,j i,m i j,m j
u j − ui
Sim ( i, j) = dev j,i =
(2) ¦ card ( S j,i ( Ȥ ) )
(4)
¦ (R − R ) ¦ (R − R )
2 2
i,m i j,m j u∈S j,i( Ȥ )
m∈Ii m∈I j
REFERENCES
[1] P. Wang, H.W. Ye, A personlized recommendation
algorithm combining slope one scheme and user based
collaborative filtering, Proceedings of International
Conference on Industrial and Information Systems, 152-154ˈ
Fig 1. Comparison of MAE of different neighbors
2009.
From the Figure 1, as the number of neighbors increased, [2] D.J. Zhang, An item-based collaborative filtering
the MAE values decreased first and then increased when k recommendation algorithm using slope one scheme
smothing, Proceedings of 2th International Symposium on
was greater than 10, which means that the accuracy of Electronic Commerce and Security, IEEE Computer Society
prediction was increased first and then decreased when k Press, 215-217,2009.
was greater than 10. Therefore, value 10 was selected for [3] H. Chai, J.Y. Liu. Research on improved Slope one
the best k value. recommendation algorithm, NetinfoSecurity, Vol.2, 77-81,
2015.
5.4 Predicting Results
[4] M.K. Du, M. Liu, S.H. Li, Q. Pu, Slope one collaborative
In the end, the experimental results of MAE from the filtering recommendation algorithm based on neighbor,
improved weighted Slope one algorithm were compared Journal of Chongqing University of Posts and
with MAE from weighted Slope one algorithm and Telecommunications, Vol.26, No.3, 421-426, 2014.
user-based collaborative filtering algorithm, as shown in [5] T.Q. Jiang, W. Lu, H.T. Xiong, Personalized collaborative
Figure 2. filtering based on improved slope one Algorithm,
Proceedings of International Conference on Systems and
Informatics, 2312-2315,2012.
[6] C. Lv, Weighted item deviation Slope One collaborative
filtering recommendation algorithm based on the user
similarities, Journal of Nanchang University, Vol.38, No.4,
342-347, 2014.
[7] D.J. Lin, X.W. Meng, Slope one algorithm based on single
value decomposition, New Industrialization Straregy, Vol.2,
No.11, 12-17, 2012.
[8] J. Chen, Y. Pan, Z.H. Zhang, F. Pan, Slope One Model and
Algorithm Based on Real-time User Behavior, Operations
Research and Management Science, Vol.24,No.1, 89-92,
Fig 2. MAE of different algorithms 2015.
As it can be seen, the MAE from the improved algorithm is [9] D. Lemire, A. Maclachlan, Slope one predictors for onine
lower than the basic weighted Slope one when k=10. The rating-based collaborative filtering, Proceedings of SIAM
Data Mining Conference, 2005.
proposed algorithm alleviates the data sparsity problem.
The experimental results show that the improved Slope one [10] Y. Wang, H.Y. Lou, Improved slope one algorithm for
collaborativefiltering, Computer Science, Vol.38, No.10A,
algorithm is more accurate than weighted Slope one
192-194, 2011.
algorithm.
[11] M.W. Wang, H.L. Tao, X.Y. Xiong, A collabotative filtering
recommendation algorithm based on iterative Bidirectional
6 CONCLUSIONS Clustering, Journal of Chinese Information Processing,
Vol.22, No.4, 61-65, 2008.
The result of traditional Slope one algorithm is less
[12] J.J. Wang, K.H. Lin, J. Li, A Collaborative Filtering
accurate, because it does not take the similarities between Recommendation Algorithm Based on User Clustering and
users into consideration. An improved weighted Slope one Slope one Scheme, Proceedings of 8th Computer Science &
algorithm, which is based on the similarity between users, Education,1473-1476,2013.
is proposed in the present study to improve the [13] C.G. Huang, J. Yin, J. Wang, Uncertain
recommendation accuracy. Specifically, the most similar neighbors’collaborative filtering recommendation algorithm,
users are chosen as neighbors, then the weighted Slope one Chinese Journal of Computers, Vol.33, No.8, 1369-1377,
algorithm is used to fill the blank ratings. If the user does 2010.
not have neighbors (k=0), the ratings of the unrated items