Enhancing Collaborative Filtering by User-User Covariance Matrix

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.


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 enhancing collaborative f iltering method based on covariance matrix 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-ofthe-art CF methods.
The rest of this paper is organized as follows. Section 2 reviews related work. Section 3 builds a new user-user 2 Mathematical Problems in Engineering covariance matrix and presents an enhancing collaborative filtering method. Section 4 evaluates the proposed method through extensive experiments, and Section 5 concludes this paper.

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: memorybased and model-based.
The model-based CF approaches leverage training datasets to train a predefined model [3][4][5][6][7][8]. The memorybased 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 memorybased 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 to denote the set of users, I to represent the set of items, to denote the set of those items rated by user u, and to denote the user-item rating matrix. The user-item rating matrix is a | | × | | matrix, and each entry of represents the rating of user for item . Let → denote the rating vector of user u; i.e., → is a | |-dimensional vector constructed by all entries , where ∈ . We use to denote the average rating value of user and to denote the median value of all rates in the user-item rating matrix R.
Given two users and V, a similarity function ( , V) returns a value that indicates the similarity of the two users. The larger the value is, the more similar the two users are. The cosine similarity is one of the widely used similarity functions. The cosine similarity function is defined as follows: The Pearson 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: A variant of PCC is the constrained 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: Jaccard and mean squared difference (MSD) are also commonly used as similarity measures [13]. Their similarity functions are, respectively, defined as follows: Further, Bobadilla et al. [14] combine Jaccard and MSD and propose a new similarity measure called JMSD. JMSD is defined as the following equation: In addition, more works on similarity measures [15][16][17][18][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.

Enhancing Collaborative Filtering Approach
In this section, we first introduce covariance to build a new user-user covariance matrix and then propose an enhancing Mathematical Problems in Engineering 3 collaborative filtering method based on the user-user covariance matrix.

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. Let and denote any two users in U, | | =m, I represent the set of items, represent the set of items rated by , denote the set of items rated by , r ik denote the rating of user for item , and r jk represent the rating of user for item . Now, we formally define the user-user covariance matrix.

Definition 1. A user-user covariance matrix is an
In the above definition, cov( , ) is set to +∞, when i = j. When ̸ = , cov( , ) denotes the covariance between and . 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 ̸ = in Below we use an example to illustrate how to use (7) to calculate the covariance between two users. let → 1 = ( 11 , 12 , 13 , 14 , 15 , 16 ) = (0, 5, 2, 0, 3, 0) denote the rating vector of user 1 for items 1 , 2 , 3 , 4 , 5 , and 6 , and → 2 = ( 21 , 22 , 23 , 24 , 25 , 26 ) = (4, 0, 0, 3, 0, 4) represent the rating vector of user 2 for items 1 , 2 , 3 , 4 , 5 , and 6 . According to (7), the covariance cov( 1 , 2 ) between 1 and 2 is calculated as follows:   Table 1 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 useruser 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 1 and 2 is equal to the similarity between 1 and 4 , and both values are zero according to the traditional similarity measures, because 1 have no common rated items with 2 and 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 covariance cov( 1 , 2 ) between 1 and 2 is different from the covariance cov( 1 , 4 ) between 1 and 4 , both values are negative, and the absolute value of cov( 1 , 2 ) is bigger than that of cov( 1 , 4 ). It means that 2 is more disinterested in those items, which 1 are of interest to, than 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.

The Proposed Collaborative Filtering Algorithm.
In the proposed enhancing collaborative f iltering method based on covariance matrix (CFCM), we first build the user-user covariance matrix = { } × based on the user-item rating matrix. The above Definition 1 and (7) give the way of computing = { } × . Then, for any target user u, we employ the user-user covariance matrix to calculate its neighbors with the most similar interested trends and opposite neighbors with the most dissimilar interested , fl GetKDSimilarUser( ); 5: for ∀ ∈ do trends, respectively. In this paper, we use , to denote the set of u's most similar neighbors and , to denote the set of u's most dissimilar neighbors. Finally, the rating prediction of user for item is computed by the following equation: In (8), denotes u's average rating; (∑ V∈ , V( , V) × ( V − V ))/ ∑ V∈ , | V( , V)| reflects the influence onf rom the users who have the most similar interested trends with u, which ensures the recommendation precision; (∑ V∈ , | V( , V)| × ( V − V ))/ ∑ V∈ , | V( , V)| represents the influence on̂from the users who have the most dissimilar interested trends with u, 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 the covariance cov(u, v) instead of the similarity sim(u, v) of the traditional CF approaches to enhance the recommendation precision, and (2) CFCM leverages the set of u's most dissimilar neighbors to improve the diversity of recommendation results.
Based on the above processing strategy, we formalize CFCM method in Algorithm 1.
In Algorithm 1, the function GetKSimilarUser(u) is responsible for getting the top users who have the greatest covariance with u, the function GetKDSimilarUser (u) is responsible for getting the top users who have the smallest covariance with u, and the function GetFirstn(Orderlist) retrieves the first items from Orderlist.

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 Section 4.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.

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.
Like the literature [15][16][17][18], we randomly pick 80% of ratings from MovieLens-1M as the training set and the rest as the testing set. MAE is a popular evaluation metric widely used to measure the precision of a recommendation method. MAE is defined by the following equation: where represents the rating of user for item j,d enotes the rating prediction of user for item by a recommendation method, and represents the number of tested ratings.
NMAE is the normalized MAE and is formulated as follows: where and , respectively, represent the maximum and minimum values of all user's ratings.
MAE and NMAE are used to describe the prediction precision of recommendation methods. The smaller MAE and NMAE 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: where the definitions of precision and recall are formulated by the following equations, respectively: where ( ) represents the recommendation result set generated for user by a recommendation method and ( ) denotes the result set for user generated by u'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 computing precision, recall and F1.
The higher F1 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 larger Diversity means the better recommended performance at the same precision. Diversity is formulated as follows: where s(i, j) denotes the Jaccard similarity of and .

Experimental Results.
It can be seen from (8) that and the number 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 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 tô= i.e., the calculation of̂only considers most dissimilar neighbors of the target user. Obviously, = 0 is a special case for our method. Figure 1 shows the impact of the parameters and on MAE. As shown in Figure 1, we can learn that when ̸ = 0, MAE decreases with for any fixed K; i.e., the recommendation precision increases with for any fixed . 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 that MAE 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 that MAE decreases with when takes a fixed value between 0 and 0.7. This is because the larger 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 when is greater than 20. This demonstrates when is greater than 0.7, the recommendation precision cannot be simply improved by increasing . For = 0, the trend of MAE is slightly fluctuating only when is relatively small, such as = 20. At the same time, we find that had very little influence on MAE at = 0. Figure 2 demonstrates the impact of the parameters and on NMAE. As we expect, the result and the trend of the curve are very similar to Figure 1. The reason is that NMAE is the normalized MAE. Figure 3 depicts the impact of the parameters and on F1. We can see from Figure 3 that F1 increases with for any fixed K, that is, the recommendation comprehensive performance (including precision and recall) increases with for any fixed . The reason is the same as the one for Figure 1. We can also observe from Figure 3 that F1 increases with 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 . This demonstrates when is greater than a certain threshold (i.e., 0.7), it is not feasible to improve the recommendation comprehensive performance by increasing K. Figure 4 shows the impact of the parameters and on Diversity. We can find from Figure 4 that Diversity decreases with for any fixed K, 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 that Diversity has a very small change with when takes a fixed value between 0 and 0.9. This demonstrates that Diversity mainly depends on and is less affected by K. By analyzing Figures 1-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-ofthe-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. Figure 5 shows the performance comparison of CFCM with the above-mentioned eight methods on MAE for different . As we expect, our method CFCM evidently outperforms the other eight methods on MAE at all values. We can also observe from Figure 5 that the MAE of CFCM is the most stable and is almost unaffected by . The reason is that the user-user covariance matrix has a finer description capability for user similarity trend than the traditional similarity measures. Figure 6 depicts the performance comparison of CFCM with the other eight methods on NMAE for different . As shown in Figure 6, CFCM evidently outperforms the other eight methods on NMAE at all values. Similar to Figure 5, the NMAE of CFCM is the most stable and is almost unaffected by K.  We can see from Figure 7 that CFCM evidently outperforms the other eight methods on F1 at all values. We can also observe from Figure 7 that the NMAEs of CFCM, NHSM and AC PCC are almost unaffected by and have a good stability. Figure 8 shows the performance comparison of CFCM with the other eight methods on Diversity for different . As we expect, CFCM evidently outperforms the other eight methods on Diversity at all 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.

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.

Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
The authors declared no conflicts of interest regarding the submission of this manuscript.