# Enhancing Collaborative Filtering by User-User Covariance Matrix

Authors: Yingyuan Xiao; Jingjing Shi; Wenguang Zheng; Hongya Wang; Ching-Hsien Hsu
Journal: Mathematical Problems in Engineering
 (2018)

---

## Abstract

The collaborative filtering (CF) approach is one of the most successful personalized recommendation methods so far, which is employed by the majority of personalized recommender systems to predict users’ preferences or interests. The basic idea of CF is that if users had the same interests in the past they will also have similar tastes in the future. In general, the traditional CF may suffer the following problems: (1) The recommendation quality of CF based system is greatly affected by the sparsity of data. (2) The traditional CF is relatively difficult to adapt the situation that users’ preferences always change over time. (3) CF based approaches are used to recommend similar items to a user ignoring the user’s demand for variety. In this paper, to solve the above problems we build a new user-user covariance matrix to replace the traditional CF’s user-user similarity matrix. Compared with the user-user similarity matrix, the user-user covariance matrix introduces the user-user covariance to finely describe the changing trends of users’ interests. Furthermore, we propose an enhancing collaborative filtering method based on the user-user covariance matrix. The experimental results show that the proposed method can significantly improve the diversity of recommendation results and ensure the good recommendation precision.


---

## Body

## 1. Introduction

Recommendation systems have been widely applied to deal with information overload problems in e-commerce sites [1]. It is well known that collaborative filtering (CF) is one of the most widely used methods in recommender systems. CF utilizes users’ behaviors (e.g., ratings or clicks) to infer a target user’s preference for a particular item.CF is based on the assumption that users’ previous behaviors have huge influence on their future behaviors. The basic idea of CF is that if users shared the same interests in the past they will also have similar tastes in the future. Although CF approach has been employed by the majority of traditional personalized recommender systems, CF approach usually faces the following challenges: (1) The sparse data of the user-item matrix seriously affect the recommendation quality. (2) The traditional CF is relatively difficult to adapt the situation that users’ preferences always change over time. (3) Always recommending similar items to a user will fail to meet the user’s demand for variety.In this paper, we propose an enhancingcollaborativefiltering method based oncovariancematrix named CFCM, such that the problems described above can be solved. We first construct the user-user covariance matrix according to the traditional user-item rating matrix, which alleviates the sparsity of the rating matrix. Secondly, we introduce the covariance to effectively capture the user’s interest change. Finally, we adjust the weight between positive and negative reverse recommendations to improve the diversity of CF methods. The experimental results on a large MovieLens dataset demonstrate that CFCM outperforms the state-of-the-art CF methods.The rest of this paper is organized as follows. Section2 reviews related work. Section 3 builds a new user-user covariance matrix and presents an enhancing collaborative filtering method. Section 4 evaluates the proposed method through extensive experiments, and Section 5 concludes this paper.


## 2. Related Work

CF approach is one of the most successful personalized recommendation methods. The CF approach was first proposed by Goldberg et al. [2]. Since then, many improved CF methods have been proposed for personalized recommendation. CF methods can be grouped into two categories: memory-based and model-based.The model-based CF approaches leverage training datasets to train a predefined model [3–8]. The memory-based CF approaches are most relevant to the method proposed in this paper. At present, the memory-based CF approaches are widely adopted in commercial personalized recommender systems [9, 10]. The key to these memory-based CF approaches is how to efficiently compute the similarity between two users. Then, for a particular user, his neighborhood can be determined according to the similarity and recommendations are made based on the rating of neighborhood of the target user. Many similarity measures (i.e., similarity functions) for these memory-based CF approaches have been proposed. In the following, we use U to denote the set of users,I to represent the set of items, I
u to denote the set of those items rated by useru, and R to denote the user-item rating matrix. The user-item rating matrix R is a |
U
|
×
|
I
| matrix, and each entry r
u
i of R represents the rating of user u for item i. Let r
u
→ denote the rating vector of useru; i.e., r
u
→ is a |
I
|-dimensional vector constructed by all entries r
u
i, where i
∈
I. We use r
u
- to denote the average rating value of user u and r
m
e
d
- to denote the median value of all rates in the user-item rating matrixR.Given two usersu and v, a similarity function s
i
m
(
u
,
v
) returns a value that indicates the similarity of the two users. The larger the value is, the more similar the two users are. Thecosine similarity is one of the widely used similarity functions. Thecosine similarity function is defined as follows: (1)
s
i
m
c
o
s
u
,
v
=
r
u
→
.
r
v
→
r
u
→
×
r
v
→
=
∑
i
∈
I
r
u
i
×
r
v
i
∑
i
∈
I
r
u
i
2
×
∑
i
∈
I
r
v
i
2ThePearson correlation coefficient (PCC) [11] is another of the most popular similarity measures for CF approaches. The PCC similarity function is defined by the following equation:(2)
s
i
m
p
c
c
u
,
v
=
∑
i
∈
I
u
∩
I
v
r
u
i
-
r
u
-
×
r
v
i
-
r
v
-
∑
i
∈
I
u
∩
I
v
r
u
i
-
r
u
-
2
×
∑
i
∈
I
u
∩
I
v
r
v
i
-
r
v
-
2A variant of PCC is theconstrained Pearson correlation coefficient (CPCC) [12]. The difference between CPCC and PCC is that CPCC uses the median value of all users’ ratings to replace the mean value of the specified user’ ratings used in PCC. The CPCC similarity function is formulated as follows: (3)
s
i
m
c
p
c
c
u
,
v
=
∑
i
∈
I
u
∩
I
v
r
u
i
-
r
m
e
d
-
×
r
v
i
-
r
m
e
d
-
∑
i
∈
I
u
∩
I
v
r
u
i
-
r
m
e
d
-
2
×
∑
i
∈
I
u
∩
I
v
r
v
i
-
r
m
e
d
-
2Jaccard andmean squared difference (MSD) are also commonly used as similarity measures [13]. Their similarity functions are, respectively, defined as follows:(4)
s
i
m
J
a
c
u
,
v
=
I
u
∩
I
v
I
u
∪
I
v
s
i
m
M
S
D
u
,
v
=
1
-
∑
i
ϵ
I
r
u
i
-
r
v
i
2
I
u
∪
I
vFurther, Bobadilla et al. [14] combineJaccard and MSD and propose a new similarity measure called JMSD. JMSD is defined as the following equation:(5)
s
i
m
J
M
S
D
u
,
v
=
s
i
m
J
a
c
u
,
v
×
s
i
m
M
S
D
u
,
vIn addition, more works on similarity measures [15–19] have been investigated. Bobadilla et al. [15] present a new similarity measure, called MJD, which leverages optimization based on neural learning to combine the existing similarity measures. Ahn [16] proposes a new heuristic similarity measure called PIP (Proximity-Impact-Popularity), which is composed of three factors (proximity, impact, and popularity) of similarity and utilizes domain specific interpretation of user ratings to overcome the cold-start problem. Pirasteh et al. [17] introduce new weighting schemes and propose a new similarity measure called AC-PCC. AC-PCC allows us to consider new features in finding similarities between users. Liu et al. [18] present a new user similarity model (NHSM) to improve the recommendation performance when only few ratings are available to calculate the similarities. NHSM considers the local context information of user ratings to infer a target user’s preference for a particular item. Patraet al. [19] propose BCF similarity measure, which utilizes all ratings information comprehensively for locating useful neighbors of an active user in sparse ratings dataset.Obviously, the existing traditional similarity measures focus on how to infer a target user’s local preference based on his/her similar users’ previous behaviors and ignore more or less the fact that a user’s preference or interest always changes dynamically. In addition, ensuring the diversity of recommendations is often a desirable feature in recommender systems. Therefore, how to truly reflect the change of user’s interest is an important issue in designing a similarity function. In this paper, we introduce a novel method by using covariance to depict the changing trends of users’ interests and build a new user-user covariance matrix to model user similarity.


## 3. Enhancing Collaborative Filtering Approach

In this section, we first introducecovariance to build a new user-user covariance matrix and then propose an enhancing collaborative filtering method based on the user-user covariance matrix.


### 3.1. User-User Covariance Matrix

In probability theory and statistics, covariance is a measure of the joint variability of two random variables. If the trend of the two variables is consistent, the covariance between the two variables is positive. In the opposite case, if two variables change in the opposite direction, the covariance between the two variables is negative. The sign of the covariance therefore shows the tendency in the linear relationship between the variables.Considering the above-mentioned statistical characteristics of covariance, we construct a new user-user covariance matrix to model user similarity. Letu
i and u
j denote any two users inU, |
U
| =m,I represent the set of items, I
i represent the set of items rated by u
i, I
j denote the set of items rated by u
j, rik denote the rating of user u
i for item i
k, and rjk represent the rating of user u
j for item i
k. Now, we formally define the user-user covariance matrix.Definition 1.
A user-user covariance matrix is anm
×
m matrix, denoted by C
=
c
i
j
m
×
m, where (6)
c
i
j
=
c
o
v
u
i
,
u
j
=
+
∞
,
i
=
j
E
u
i
-
E
u
i
.
u
j
-
E
u
j
,
i
≠
jIn the above definition,cov(u
i, u
j) is set to +
∞, wheni =j. When i
≠
j,cov(u
i, u
j) denotes the covariance between u
i and u
j. Since each user is modeled as the rating sequence for all items in CF approaches, we can consider a user as a random variable, which means that it makes sense to calculate the covariance between two users. Like the covariance between two variables in probability theory and statistics, we give the calculation method for the covariance between two users at i
≠
j in (7)
c
o
v
u
i
,
u
j
=
E
u
i
-
E
u
i
∙
u
j
-
E
u
j
=
E
u
i
u
j
-
E
u
i
E
u
j
=
1
I
∑
k
∈
I
r
i
k
.
r
j
k
-
1
I
2
∑
k
∈
I
r
i
k
.
∑
k
∈
I
r
j
k
=
1
I
∑
k
∈
I
i
∩
I
j
r
i
k
.
r
j
k
-
1
I
2
∑
k
∈
I
r
i
k
.
∑
k
∈
I
r
j
kBelow we use an example to illustrate how to use (7) to calculate the covariance between two users. let r
1
→ = (r
11
,
r
12
,
r
13
,
r
14
,
r
15
,
r
16) = (0, 5, 2, 0, 3, 0) denote the rating vector of user u
1 for items i
1, i
2, i
3, i
4, i
5, and i
6, and r
2
→ = (r
21
,
r
22
,
r
23
,
r
24
,
r
25
,
r
26) = (4, 0, 0, 3, 0, 4) represent the rating vector of user u
2 for items i
1, i
2, i
3, i
4, i
5, and i
6. According to (7), the covariancecov(u
1, u
2) between u
1 and u
2 is calculated as follows:c
o
v
(
u
1
,
u
2
)
=
1
/
I
∑
k
∈
(
I
1
∩
I
2
)
r
1
k
.
r
2
k
-
1
/
I
2
∑
k
∈
I
r
1
k
.
∑
k
∈
I
r
2
k, where I
1
=
i
2
,
i
3
,
i
5, I
2
=
i
1
,
i
4
,
i
6, I
=
i
1
,
i
2
,
i
3
,
i
4
,
i
5
,
i
6, I
1
∩
I
2
=
i
2
,
i
3
,
i
5
∩
i
1
,
i
4
,
i
6
=
∅, and I
=
6. That is,cov
(
u
1
,
u
2
) = 1
/
6
×
0
-
1
/
6
2
r
11
+
r
12
+
r
13
+
r
14
+
r
15
+
r
16
×
r
21
+
r
22
+
r
23
+
r
24
+
r
25
+
r
26 = 0
-
1
/
36
0
+
5
+
2
+
0
+
3
+
0
×
4
+
0
+
0
+
3
+
0
+
4
≈
-
3.056.Further, Table1 demonstrates a user-user covariance matrix, which is derived by (7) from a user-item rating matrix shown in Table 2. As shown in Table 1, a user-user covariance matrix is a symmetric matrix and adds the negative correlation to depict the opposite trends of users’ interests. For traditional similarity measures, if two users have no common rated items, the similarity between the two users is usually equal to zero. For example, the similarity between u
1 and u
2 is equal to the similarity between u
1 and u
4, and both values are zero according to the traditional similarity measures, because u
1 have no common rated items with u
2 and u
4, as shown in Table 2. This means that the traditional similarity measures cannot distinguish the degree of dissimilarity between the users who have no common rated items. However, we can find from Table 1 that the covariancecov(u
1, u
2) between u
1 and u
2 is different from the covariancecov(u
1, u
4) between u
1 and u
4, both values are negative, and the absolute value ofcov(u
1, u
2) is bigger than that ofcov(u
1, u
4). It means that u
2 is more disinterested in those items, which u
1 are of interest to, than u
4. From the above example, we can learn that the user-user covariance matrix has a finer description capability for user similarity trends, and especially for the users without common rated items, it shows the more powerful description capability than the traditional similarity measures.Table 1
A user-user covariance matrix.
u
1
u
2
u
3
u
4
u
5
u
1
+
∞
-3.056
-0.444
-2.222
2.222
u
2
-3.056
+
∞
0.111
2.389
-1.972
u
3
-0.444
0.111
+
∞
-0.889
1.222
u
4
-2.222
2.389
-0.889
+
∞
-2.889
u
5
2.222
-1.972
1.222
-2.889
+
∞Table 2
A user-item rating matrix.
i
1
i
2
i
3
i
4
i
5
i
6
u
1
null
5
2
null
3
null
u
2
4
null
null
3
null
4
u
3
null
null
2
null
null
2
u
4
5
null
null
3
null
null
u
5
null
5
5
null
null
3


### 3.2. The Proposed Collaborative Filtering Algorithm

In the proposed enhancingcollaborativefiltering method based oncovariancematrix (CFCM), we first build the user-user covariance matrix C
=
c
i
j
m
×
m based on the user-item rating matrix. The above Definition 1 and (7) give the way of computing C
=
c
i
j
m
×
m. Then, for any target useru, we employ the user-user covariance matrix to calculate its K neighbors with the most similar interested trends and opposite K neighbors with the most dissimilar interested trends, respectively. In this paper, we use N
u
,
s to denote the set ofu’s K most similar neighbors and N
u
,
d to denote the set ofu’s K most dissimilar neighbors. Finally, the rating prediction r
u
i
^ of user u for item i is computed by the following equation:(8)
r
u
i
^
=
r
u
-
+
α
×
∑
v
∈
N
u
,
s
c
o
v
u
,
v
×
r
v
i
-
r
v
-
∑
v
∈
N
u
,
s
c
o
v
u
,
v
+
1
-
α
×
∑
v
∈
N
u
,
d
c
o
v
u
,
v
×
r
v
i
-
r
v
-
∑
v
∈
N
u
,
d
c
o
v
u
,
vIn (8), r
u
- denotesu’s average rating; ∑
v
∈
N
u
,
s
c
o
v
(
u
,
v
)
×
(
r
v
i
-
r
v
-
)
/
∑
v
∈
N
u
,
s
|
c
o
v
(
u
,
v
)
| reflects the influence on r
u
i
^ from the users who have the most similar interested trends withu, which ensures the recommendation precision; ∑
v
∈
N
u
,
d
|
c
o
v
u
,
v
|
×
(
r
v
i
-
r
v
-
)
/
∑
v
∈
N
u
,
d
|
c
o
v
(
u
,
v
)
| represents the influence on r
u
i
^ from the users who have the most dissimilar interested trends withu, which provides the diversity for the recommended result; α is the threshold that is employed to control the proportion of the above two aspects of influences. α takes a real value between 0 and 1.The difference between CFCM and the traditional CF approaches is mainly reflected in the following two aspects: (1) CFCM uses thecovariancecov(u,v) instead of the similaritysim(u,v) of the traditional CF approaches to enhance the recommendation precision, and (2) CFCM leverages the set ofu’s K most dissimilar neighbors to improve the diversity of recommendation results.Based on the above processing strategy, we formalize CFCM method in Algorithm1.Algorithm 1:CFCM (
R
,
u
).
Input: R and u, where R is the user-item rating matrix and u denotes a target user.
Output: Result, i.e., the recommendation list for u.
1:Result ≔ ⌀; N
u
,
s ≔ ⌀; N
u
,
d ≔ ⌀; Orderlist≔ ⌀;
2:   build the user-user covariance matrixC
=
{
c
i
j
}
m
×
m based on R;
3:N
u
,
s ≔ GetKSimilarUser(u);
4:N
u
,
d ≔ GetKDSimilarUser(u);
5:for  ∀
i
∈
I  do
6:r
u
i
^
=
r
u
-
+
α
×
∑
v
∈
N
u
,
s
c
o
v
u
,
v
×
r
v
i
-
r
v
-
∑
v
∈
N
u
,
s
c
o
v
u
,
v
+
1
-
α
×
∑
v
∈
N
u
,
d
c
o
v
u
,
v
×
r
v
i
-
r
v
-
∑
v
∈
N
u
,
d
c
o
v
u
,
v;
7:    inserti into Orderlistin descending order of r
u
i
^;
8:end for
9:Result ≔ GetFirstn(Orderlist)
10:return  Result;In Algorithm1, the function GetKSimilarUser(u) is responsible for getting the top K users who have the greatest covariance withu, the function GetKDSimilarUser (u) is responsible for getting the top K users who have the smallest covariance withu, and the functionGetFirstn(Orderlist) retrieves the first n items fromOrderlist.


## 3.1. User-User Covariance Matrix

In probability theory and statistics, covariance is a measure of the joint variability of two random variables. If the trend of the two variables is consistent, the covariance between the two variables is positive. In the opposite case, if two variables change in the opposite direction, the covariance between the two variables is negative. The sign of the covariance therefore shows the tendency in the linear relationship between the variables.Considering the above-mentioned statistical characteristics of covariance, we construct a new user-user covariance matrix to model user similarity. Letu
i and u
j denote any two users inU, |
U
| =m,I represent the set of items, I
i represent the set of items rated by u
i, I
j denote the set of items rated by u
j, rik denote the rating of user u
i for item i
k, and rjk represent the rating of user u
j for item i
k. Now, we formally define the user-user covariance matrix.Definition 1.
A user-user covariance matrix is anm
×
m matrix, denoted by C
=
c
i
j
m
×
m, where (6)
c
i
j
=
c
o
v
u
i
,
u
j
=
+
∞
,
i
=
j
E
u
i
-
E
u
i
.
u
j
-
E
u
j
,
i
≠
jIn the above definition,cov(u
i, u
j) is set to +
∞, wheni =j. When i
≠
j,cov(u
i, u
j) denotes the covariance between u
i and u
j. Since each user is modeled as the rating sequence for all items in CF approaches, we can consider a user as a random variable, which means that it makes sense to calculate the covariance between two users. Like the covariance between two variables in probability theory and statistics, we give the calculation method for the covariance between two users at i
≠
j in (7)
c
o
v
u
i
,
u
j
=
E
u
i
-
E
u
i
∙
u
j
-
E
u
j
=
E
u
i
u
j
-
E
u
i
E
u
j
=
1
I
∑
k
∈
I
r
i
k
.
r
j
k
-
1
I
2
∑
k
∈
I
r
i
k
.
∑
k
∈
I
r
j
k
=
1
I
∑
k
∈
I
i
∩
I
j
r
i
k
.
r
j
k
-
1
I
2
∑
k
∈
I
r
i
k
.
∑
k
∈
I
r
j
kBelow we use an example to illustrate how to use (7) to calculate the covariance between two users. let r
1
→ = (r
11
,
r
12
,
r
13
,
r
14
,
r
15
,
r
16) = (0, 5, 2, 0, 3, 0) denote the rating vector of user u
1 for items i
1, i
2, i
3, i
4, i
5, and i
6, and r
2
→ = (r
21
,
r
22
,
r
23
,
r
24
,
r
25
,
r
26) = (4, 0, 0, 3, 0, 4) represent the rating vector of user u
2 for items i
1, i
2, i
3, i
4, i
5, and i
6. According to (7), the covariancecov(u
1, u
2) between u
1 and u
2 is calculated as follows:c
o
v
(
u
1
,
u
2
)
=
1
/
I
∑
k
∈
(
I
1
∩
I
2
)
r
1
k
.
r
2
k
-
1
/
I
2
∑
k
∈
I
r
1
k
.
∑
k
∈
I
r
2
k, where I
1
=
i
2
,
i
3
,
i
5, I
2
=
i
1
,
i
4
,
i
6, I
=
i
1
,
i
2
,
i
3
,
i
4
,
i
5
,
i
6, I
1
∩
I
2
=
i
2
,
i
3
,
i
5
∩
i
1
,
i
4
,
i
6
=
∅, and I
=
6. That is,cov
(
u
1
,
u
2
) = 1
/
6
×
0
-
1
/
6
2
r
11
+
r
12
+
r
13
+
r
14
+
r
15
+
r
16
×
r
21
+
r
22
+
r
23
+
r
24
+
r
25
+
r
26 = 0
-
1
/
36
0
+
5
+
2
+
0
+
3
+
0
×
4
+
0
+
0
+
3
+
0
+
4
≈
-
3.056.Further, Table1 demonstrates a user-user covariance matrix, which is derived by (7) from a user-item rating matrix shown in Table 2. As shown in Table 1, a user-user covariance matrix is a symmetric matrix and adds the negative correlation to depict the opposite trends of users’ interests. For traditional similarity measures, if two users have no common rated items, the similarity between the two users is usually equal to zero. For example, the similarity between u
1 and u
2 is equal to the similarity between u
1 and u
4, and both values are zero according to the traditional similarity measures, because u
1 have no common rated items with u
2 and u
4, as shown in Table 2. This means that the traditional similarity measures cannot distinguish the degree of dissimilarity between the users who have no common rated items. However, we can find from Table 1 that the covariancecov(u
1, u
2) between u
1 and u
2 is different from the covariancecov(u
1, u
4) between u
1 and u
4, both values are negative, and the absolute value ofcov(u
1, u
2) is bigger than that ofcov(u
1, u
4). It means that u
2 is more disinterested in those items, which u
1 are of interest to, than u
4. From the above example, we can learn that the user-user covariance matrix has a finer description capability for user similarity trends, and especially for the users without common rated items, it shows the more powerful description capability than the traditional similarity measures.Table 1
A user-user covariance matrix.
u
1
u
2
u
3
u
4
u
5
u
1
+
∞
-3.056
-0.444
-2.222
2.222
u
2
-3.056
+
∞
0.111
2.389
-1.972
u
3
-0.444
0.111
+
∞
-0.889
1.222
u
4
-2.222
2.389
-0.889
+
∞
-2.889
u
5
2.222
-1.972
1.222
-2.889
+
∞Table 2
A user-item rating matrix.
i
1
i
2
i
3
i
4
i
5
i
6
u
1
null
5
2
null
3
null
u
2
4
null
null
3
null
4
u
3
null
null
2
null
null
2
u
4
5
null
null
3
null
null
u
5
null
5
5
null
null
3


## 3.2. The Proposed Collaborative Filtering Algorithm

In the proposed enhancingcollaborativefiltering method based oncovariancematrix (CFCM), we first build the user-user covariance matrix C
=
c
i
j
m
×
m based on the user-item rating matrix. The above Definition 1 and (7) give the way of computing C
=
c
i
j
m
×
m. Then, for any target useru, we employ the user-user covariance matrix to calculate its K neighbors with the most similar interested trends and opposite K neighbors with the most dissimilar interested trends, respectively. In this paper, we use N
u
,
s to denote the set ofu’s K most similar neighbors and N
u
,
d to denote the set ofu’s K most dissimilar neighbors. Finally, the rating prediction r
u
i
^ of user u for item i is computed by the following equation:(8)
r
u
i
^
=
r
u
-
+
α
×
∑
v
∈
N
u
,
s
c
o
v
u
,
v
×
r
v
i
-
r
v
-
∑
v
∈
N
u
,
s
c
o
v
u
,
v
+
1
-
α
×
∑
v
∈
N
u
,
d
c
o
v
u
,
v
×
r
v
i
-
r
v
-
∑
v
∈
N
u
,
d
c
o
v
u
,
vIn (8), r
u
- denotesu’s average rating; ∑
v
∈
N
u
,
s
c
o
v
(
u
,
v
)
×
(
r
v
i
-
r
v
-
)
/
∑
v
∈
N
u
,
s
|
c
o
v
(
u
,
v
)
| reflects the influence on r
u
i
^ from the users who have the most similar interested trends withu, which ensures the recommendation precision; ∑
v
∈
N
u
,
d
|
c
o
v
u
,
v
|
×
(
r
v
i
-
r
v
-
)
/
∑
v
∈
N
u
,
d
|
c
o
v
(
u
,
v
)
| represents the influence on r
u
i
^ from the users who have the most dissimilar interested trends withu, which provides the diversity for the recommended result; α is the threshold that is employed to control the proportion of the above two aspects of influences. α takes a real value between 0 and 1.The difference between CFCM and the traditional CF approaches is mainly reflected in the following two aspects: (1) CFCM uses thecovariancecov(u,v) instead of the similaritysim(u,v) of the traditional CF approaches to enhance the recommendation precision, and (2) CFCM leverages the set ofu’s K most dissimilar neighbors to improve the diversity of recommendation results.Based on the above processing strategy, we formalize CFCM method in Algorithm1.Algorithm 1:CFCM (
R
,
u
).
Input: R and u, where R is the user-item rating matrix and u denotes a target user.
Output: Result, i.e., the recommendation list for u.
1:Result ≔ ⌀; N
u
,
s ≔ ⌀; N
u
,
d ≔ ⌀; Orderlist≔ ⌀;
2:   build the user-user covariance matrixC
=
{
c
i
j
}
m
×
m based on R;
3:N
u
,
s ≔ GetKSimilarUser(u);
4:N
u
,
d ≔ GetKDSimilarUser(u);
5:for  ∀
i
∈
I  do
6:r
u
i
^
=
r
u
-
+
α
×
∑
v
∈
N
u
,
s
c
o
v
u
,
v
×
r
v
i
-
r
v
-
∑
v
∈
N
u
,
s
c
o
v
u
,
v
+
1
-
α
×
∑
v
∈
N
u
,
d
c
o
v
u
,
v
×
r
v
i
-
r
v
-
∑
v
∈
N
u
,
d
c
o
v
u
,
v;
7:    inserti into Orderlistin descending order of r
u
i
^;
8:end for
9:Result ≔ GetFirstn(Orderlist)
10:return  Result;In Algorithm1, the function GetKSimilarUser(u) is responsible for getting the top K users who have the greatest covariance withu, the function GetKDSimilarUser (u) is responsible for getting the top K users who have the smallest covariance withu, and the functionGetFirstn(Orderlist) retrieves the first n items fromOrderlist.


## 4. Performance Evaluation

In this section, we evaluate the performance of the proposed approach (CFCM) through extensive experiments. We first describe the experimental dataset chosen for our experiments in Section4.1. Then, in Section 4.2 we introduce the performance metrics of concern in this paper. Finally, we present and analyze the experimental results in Section 4.3.


### 4.1. Dataset Description

Similar to the existing literature related CF methods, we choose MovieLens (https://grouplens.org/datasets/movielens/) as the data source for our experiments. MovieLens includes integer ratings of users for movies. Specifically, the dataset used in our experiments is MovieLens-1M (https://grouplens.org/datasets/movielens/1m/) that is a stable benchmark dataset. MovieLens-1M consists of 6040 users who have rated a total of 3706 different movies and the total number of ratings is 1000209. All movies are divided into 18 basic categories by their themes. The sparsity level of the user-movie rating matrix is about 4.2% for MovieLens-1M. Here, the sparsity level is described as the percentage of all possible ratings available in a dataset. Table 3 shows the basic attributes of MovieLens-1M.Table 3
The basic attributes of MovieLens-1M.
Dataset
Number of users
Number of Movies
Number of Ratings
Sparsity level
Rating domain
MovieLens-1M
6040
3706
1M
4.2%
1,2
,
3,4
,
5Like the literature [15–18], we randomly pick 80% of ratings from MovieLens-1M as the training set and the rest as the testing set.


### 4.2. Performance Metrics

In our experiments, we use four performance metrics, theMean Absolute Error(MAE), theNormalizedMean Absolute Error (NMAE),F1, andDiversity to measure the performance of the proposed approach (CFCM).MAE is a popular evaluation metric widely used to measure the precision of a recommendation method.MAE is defined by the following equation:(9)
M
A
E
=
∑
i
j
r
i
j
-
r
i
j
^
nwhere r
i
j represents the rating of user u
i for itemj, r
i
j
^ denotes the rating prediction of user u
i for item j by a recommendation method, and n represents the number of tested ratings.NMAE is the normalizedMAE and is formulated as follows:(10)
N
M
A
E
=
1
r
m
a
x
-
r
m
i
n
∑
i
j
r
i
j
-
r
i
j
^
nwhere r
m
a
x and r
m
i
n, respectively, represent the maximum and minimum values of all user’s ratings.MAE andNMAE are used to describe the prediction precision of recommendation methods. The smallerMAE andNMAE mean the more accurate prediction.F1 is introduced as one of the most important comprehensive performance metrics for measuring the performance of the recommendation methods.F1 is defined by the following equation:(11)
F
1
=
2
1
/
p
r
e
c
i
s
i
o
n
+
1
/
r
e
c
a
l
lwhere the definitions ofprecision andrecall are formulated by the following equations, respectively:(12)
p
r
e
c
i
s
i
o
n
=
∑
u
∈
U
R
u
∩
T
u
∑
u
∈
U
R
u
(13)
r
e
c
a
l
l
=
∑
u
∈
U
R
u
∩
T
u
∑
u
∈
U
T
uwhere R
(
u
) represents the recommendation result set generated for user u by a recommendation method and T
(
u
) denotes the result set for user u generated byu’s actual behaviors on the testing set. Similar to some previous work, we use N=20 as the number of items recommended to the users while computingprecision,recall andF1.The higherF1 of a recommendation method means the better comprehensive performance of the recommendation method.Diversity, as an important performance metric, is used to describe the dissimilarity between the items in the recommendation result set. The largerDiversity means the better recommended performance at the sameprecision.Diversity is formulated as follows:(14)
D
i
v
e
r
s
i
t
y
=
1
U
∑
u
∈
U
1
-
∑
i
,
j
∈
R
u
,
i
≠
j
s
i
,
j
1
/
2
R
u
R
u
-
1wheres(i,j) denotes the Jaccard similarity of i and j.


### 4.3. Experimental Results

It can be seen from (8) that α and the number K of neighbors with the most similar or most dissimilar interested trend have an inevitable influence on the performance of CFCM. In this section, we first evaluate the impact of α and K on the performance of CFCM, and then we compare CFCM with the state-of-the-art approaches based on traditional CF methods. We can find that at α
=
0, (8) degenerates to r
u
i
^
=
r
u
-
+
∑
v
∈
U
u
,
d
|
c
o
v
u
,
v
|
×
(
r
v
i
-
r
v
-
)
/
∑
v
∈
U
u
,
d
|
c
o
v
(
u
,
v
)
|, i.e., the calculation of r
u
i
^ only considers K most dissimilar neighbors of the target user. Obviously, α
=
0 is a special case for our method.Figure1 shows the impact of the parameters α and K onMAE. As shown in Figure 1, we can learn that when α
≠
0,MAE decreases with α for any fixedK; i.e., the recommendation precision increases with α for any fixed K. This result is not surprising because α represents the weight of ensuring the recommended precision in (8), and a larger α means a higher recommendation precision. Furthermore, we can find from Figure 1 thatMAE remains relatively stable when α is greater than 0.8 which means that there is much less benefit to improve the prediction precision of recommendation by continually increase α when it is larger the 0.8. We can also observe thatMAE decreases with K when α takes a fixed value between 0 and 0.7. This is because the larger K means more neighbors are considered when calculating the rating prediction. The more neighbors naturally lead to the better recommendation precision. In addition, for a fixed α between 0.7 and 1,MAE no longer decreases with K when K is greater than 20. This demonstrates when α is greater than 0.7, the recommendation precision cannot be simply improved by increasing K. For α
=
0, the trend ofMAE is slightly fluctuating only when K is relatively small, such as K
=
20. At the same time, we find that K had very little influence onMAE at α
=
0.Figure 1
Impact ofα and K onMAE.Figure2 demonstrates the impact of the parameters α and K onNMAE. As we expect, the result and the trend of the curve are very similar to Figure 1. The reason is thatNMAE is the normalizedMAE.Figure 2
Impact ofα and K onNMAE.Figure3 depicts the impact of the parameters α and K onF1. We can see from Figure 3 thatF1 increases with α for any fixedK, that is, the recommendation comprehensive performance (including precision and recall) increases with α for any fixed K. The reason is the same as the one for Figure 1. We can also observe from Figure 3 thatF1 increases with K when α takes a fixed value between 0 and 0.7, and the growth rate gradually reduces as α increases. When α takes a fixed value between 0.7 and 1,F1 no longer increases with K. This demonstrates when α is greater than a certain threshold (i.e., 0.7), it is not feasible to improve the recommendation comprehensive performance by increasingK.Figure 3
Impact ofα and K onF1.Figure4 shows the impact of the parameters α and K onDiversity. We can find from Figure 4 thatDiversity decreases with α for any fixedK, and this decreasing trend becomes more apparent when α is greater than 0.8. This result is not surprising because the increase of α means the decrease of the weight that ensures the recommendation diversity. We can also observe from Figure 4 thatDiversity has a very small change with K when α takes a fixed value between 0 and 0.9. This demonstrates thatDiversity mainly depends on α and is less affected byK.Figure 4
Impact ofα and K onDiversity.By analyzing Figures1–4, we can find that when α takes 0.8, CFCM can achieve the optimal overall performance in terms of both recommendation precision and recommendation diversity.Further, in order to demonstrate the superiority of CFCM, we compare CFCM with the existing CF methods based on the traditional similarity measures. In the state-of-the-art CF methods, we select PCC [11], CPCC [12], JMSD [14], MJD [15], PIP [16], AC-PCC [17], NHSM [18], and BCF [19] as the baseline methods of our experiments. For CFCM, the parameter α is set to 0.8 in the following experiments. To ensure fairness, we adopt the optimal experimental parameter setting for each baseline method.Figure5 shows the performance comparison of CFCM with the above-mentioned eight methods onMAE for different K. As we expect, our method CFCM evidently outperforms the other eight methods onMAE at all K values. We can also observe from Figure 5 that theMAE of CFCM is the most stable and is almost unaffected by K. The reason is that the user-user covariance matrix has a finer description capability for user similarity trend than the traditional similarity measures.Figure 5
Performance comparison onMAE.Figure6 depicts the performance comparison of CFCM with the other eight methods onNMAE for different K. As shown in Figure 6, CFCM evidently outperforms the other eight methods onNMAE at all K values. Similar to Figure 5, theNMAE of CFCM is the most stable and is almost unaffected byK.Figure 6
Performance comparison onNMAE.Figure7 demonstrates the performance comparison of CFCM with the other eight methods onF1 for different K. We can see from Figure 7 that CFCM evidently outperforms the other eight methods onF1 at all K values. We can also observe from Figure 7 that theNMAEs of CFCM, NHSM and AC_PCC are almost unaffected by K and have a good stability.Figure 7
Performance comparison onF1.Figure8 shows the performance comparison of CFCM with the other eight methods onDiversity for different K. As we expect, CFCM evidently outperforms the other eight methods onDiversity at all K values. This is because CFCM adds the influencing factor from the neighbors with the most dissimilar interested trend into the rating prediction, which enhances the diversity of recommendation results.Figure 8
Performance comparison onDiversity.


## 4.1. Dataset Description

Similar to the existing literature related CF methods, we choose MovieLens (https://grouplens.org/datasets/movielens/) as the data source for our experiments. MovieLens includes integer ratings of users for movies. Specifically, the dataset used in our experiments is MovieLens-1M (https://grouplens.org/datasets/movielens/1m/) that is a stable benchmark dataset. MovieLens-1M consists of 6040 users who have rated a total of 3706 different movies and the total number of ratings is 1000209. All movies are divided into 18 basic categories by their themes. The sparsity level of the user-movie rating matrix is about 4.2% for MovieLens-1M. Here, the sparsity level is described as the percentage of all possible ratings available in a dataset. Table 3 shows the basic attributes of MovieLens-1M.Table 3
The basic attributes of MovieLens-1M.
Dataset
Number of users
Number of Movies
Number of Ratings
Sparsity level
Rating domain
MovieLens-1M
6040
3706
1M
4.2%
1,2
,
3,4
,
5Like the literature [15–18], we randomly pick 80% of ratings from MovieLens-1M as the training set and the rest as the testing set.


## 4.2. Performance Metrics

In our experiments, we use four performance metrics, theMean Absolute Error(MAE), theNormalizedMean Absolute Error (NMAE),F1, andDiversity to measure the performance of the proposed approach (CFCM).MAE is a popular evaluation metric widely used to measure the precision of a recommendation method.MAE is defined by the following equation:(9)
M
A
E
=
∑
i
j
r
i
j
-
r
i
j
^
nwhere r
i
j represents the rating of user u
i for itemj, r
i
j
^ denotes the rating prediction of user u
i for item j by a recommendation method, and n represents the number of tested ratings.NMAE is the normalizedMAE and is formulated as follows:(10)
N
M
A
E
=
1
r
m
a
x
-
r
m
i
n
∑
i
j
r
i
j
-
r
i
j
^
nwhere r
m
a
x and r
m
i
n, respectively, represent the maximum and minimum values of all user’s ratings.MAE andNMAE are used to describe the prediction precision of recommendation methods. The smallerMAE andNMAE mean the more accurate prediction.F1 is introduced as one of the most important comprehensive performance metrics for measuring the performance of the recommendation methods.F1 is defined by the following equation:(11)
F
1
=
2
1
/
p
r
e
c
i
s
i
o
n
+
1
/
r
e
c
a
l
lwhere the definitions ofprecision andrecall are formulated by the following equations, respectively:(12)
p
r
e
c
i
s
i
o
n
=
∑
u
∈
U
R
u
∩
T
u
∑
u
∈
U
R
u
(13)
r
e
c
a
l
l
=
∑
u
∈
U
R
u
∩
T
u
∑
u
∈
U
T
uwhere R
(
u
) represents the recommendation result set generated for user u by a recommendation method and T
(
u
) denotes the result set for user u generated byu’s actual behaviors on the testing set. Similar to some previous work, we use N=20 as the number of items recommended to the users while computingprecision,recall andF1.The higherF1 of a recommendation method means the better comprehensive performance of the recommendation method.Diversity, as an important performance metric, is used to describe the dissimilarity between the items in the recommendation result set. The largerDiversity means the better recommended performance at the sameprecision.Diversity is formulated as follows:(14)
D
i
v
e
r
s
i
t
y
=
1
U
∑
u
∈
U
1
-
∑
i
,
j
∈
R
u
,
i
≠
j
s
i
,
j
1
/
2
R
u
R
u
-
1wheres(i,j) denotes the Jaccard similarity of i and j.


## 4.3. Experimental Results

It can be seen from (8) that α and the number K of neighbors with the most similar or most dissimilar interested trend have an inevitable influence on the performance of CFCM. In this section, we first evaluate the impact of α and K on the performance of CFCM, and then we compare CFCM with the state-of-the-art approaches based on traditional CF methods. We can find that at α
=
0, (8) degenerates to r
u
i
^
=
r
u
-
+
∑
v
∈
U
u
,
d
|
c
o
v
u
,
v
|
×
(
r
v
i
-
r
v
-
)
/
∑
v
∈
U
u
,
d
|
c
o
v
(
u
,
v
)
|, i.e., the calculation of r
u
i
^ only considers K most dissimilar neighbors of the target user. Obviously, α
=
0 is a special case for our method.Figure1 shows the impact of the parameters α and K onMAE. As shown in Figure 1, we can learn that when α
≠
0,MAE decreases with α for any fixedK; i.e., the recommendation precision increases with α for any fixed K. This result is not surprising because α represents the weight of ensuring the recommended precision in (8), and a larger α means a higher recommendation precision. Furthermore, we can find from Figure 1 thatMAE remains relatively stable when α is greater than 0.8 which means that there is much less benefit to improve the prediction precision of recommendation by continually increase α when it is larger the 0.8. We can also observe thatMAE decreases with K when α takes a fixed value between 0 and 0.7. This is because the larger K means more neighbors are considered when calculating the rating prediction. The more neighbors naturally lead to the better recommendation precision. In addition, for a fixed α between 0.7 and 1,MAE no longer decreases with K when K is greater than 20. This demonstrates when α is greater than 0.7, the recommendation precision cannot be simply improved by increasing K. For α
=
0, the trend ofMAE is slightly fluctuating only when K is relatively small, such as K
=
20. At the same time, we find that K had very little influence onMAE at α
=
0.Figure 1
Impact ofα and K onMAE.Figure2 demonstrates the impact of the parameters α and K onNMAE. As we expect, the result and the trend of the curve are very similar to Figure 1. The reason is thatNMAE is the normalizedMAE.Figure 2
Impact ofα and K onNMAE.Figure3 depicts the impact of the parameters α and K onF1. We can see from Figure 3 thatF1 increases with α for any fixedK, that is, the recommendation comprehensive performance (including precision and recall) increases with α for any fixed K. The reason is the same as the one for Figure 1. We can also observe from Figure 3 thatF1 increases with K when α takes a fixed value between 0 and 0.7, and the growth rate gradually reduces as α increases. When α takes a fixed value between 0.7 and 1,F1 no longer increases with K. This demonstrates when α is greater than a certain threshold (i.e., 0.7), it is not feasible to improve the recommendation comprehensive performance by increasingK.Figure 3
Impact ofα and K onF1.Figure4 shows the impact of the parameters α and K onDiversity. We can find from Figure 4 thatDiversity decreases with α for any fixedK, and this decreasing trend becomes more apparent when α is greater than 0.8. This result is not surprising because the increase of α means the decrease of the weight that ensures the recommendation diversity. We can also observe from Figure 4 thatDiversity has a very small change with K when α takes a fixed value between 0 and 0.9. This demonstrates thatDiversity mainly depends on α and is less affected byK.Figure 4
Impact ofα and K onDiversity.By analyzing Figures1–4, we can find that when α takes 0.8, CFCM can achieve the optimal overall performance in terms of both recommendation precision and recommendation diversity.Further, in order to demonstrate the superiority of CFCM, we compare CFCM with the existing CF methods based on the traditional similarity measures. In the state-of-the-art CF methods, we select PCC [11], CPCC [12], JMSD [14], MJD [15], PIP [16], AC-PCC [17], NHSM [18], and BCF [19] as the baseline methods of our experiments. For CFCM, the parameter α is set to 0.8 in the following experiments. To ensure fairness, we adopt the optimal experimental parameter setting for each baseline method.Figure5 shows the performance comparison of CFCM with the above-mentioned eight methods onMAE for different K. As we expect, our method CFCM evidently outperforms the other eight methods onMAE at all K values. We can also observe from Figure 5 that theMAE of CFCM is the most stable and is almost unaffected by K. The reason is that the user-user covariance matrix has a finer description capability for user similarity trend than the traditional similarity measures.Figure 5
Performance comparison onMAE.Figure6 depicts the performance comparison of CFCM with the other eight methods onNMAE for different K. As shown in Figure 6, CFCM evidently outperforms the other eight methods onNMAE at all K values. Similar to Figure 5, theNMAE of CFCM is the most stable and is almost unaffected byK.Figure 6
Performance comparison onNMAE.Figure7 demonstrates the performance comparison of CFCM with the other eight methods onF1 for different K. We can see from Figure 7 that CFCM evidently outperforms the other eight methods onF1 at all K values. We can also observe from Figure 7 that theNMAEs of CFCM, NHSM and AC_PCC are almost unaffected by K and have a good stability.Figure 7
Performance comparison onF1.Figure8 shows the performance comparison of CFCM with the other eight methods onDiversity for different K. As we expect, CFCM evidently outperforms the other eight methods onDiversity at all K values. This is because CFCM adds the influencing factor from the neighbors with the most dissimilar interested trend into the rating prediction, which enhances the diversity of recommendation results.Figure 8
Performance comparison onDiversity.


## 5. Conclusion

Although the traditional CF methods have been widely studied and deployed, most of these methods suffer several inherent weaknesses. In this paper, to solve the inherent weaknesses we build a new user-user covariance matrix to replace the traditional CF’s user-user similarity matrix. Compared to the user-user similarity matrix, the user-user covariance matrix has a finer description capability for user similarity trends, and especially for the users without common rated items, it shows the more powerful description capability. Further, we propose an enhancing collaborative filtering method based on the user-user covariance matrix. The experimental results show that the proposed method can significantly improve the diversity of recommendation results in ensuring a good recommendation precision.In the future work, we will consider introducing new quality measure metrics, such as coverage quality measure [20], to measure the proposed approach more comprehensively.



---

*Source: 9740402-2018-11-25.xml*