Context-Similarity Collaborative Filtering Recommendation

This article proposes a new method to overcome the sparse data problem of the collaborative filtering models (CF models) by considering the homologous relationship between users or items calculated on contextual attributes when we build the CF models. In the traditional CF models, the results are built only based on data from the user’s ratings for items. The results of the proposed models are calculated on two factors: (1) the similar factors based on rating values; (2) the similar factors based on contextual attributes. The findings from the experimentation on two datasets DePaulMovie and InCarMusic, show that the proposed models have higher accuracy than the traditional CF models.


I. INTRODUCTION
According to the research reviews on recommender models [8], [19], [24], [37], the CF models have been applied successfully in many applications such as e-commerce Amazon [11], Netflix [4]. This is one of the effective solutions to the information explosion problem in online systems, while the number of users increases very fast. However, these models also face issues [8], [39] that need dealing with, such as cold-start, sparsity, and scalability. The context-aware is an extensive research method nowadays [16], [17], [44]. The literature indicates that the context of a user influences user decisions, and modeling contextual information may address the sparsity [45]- [50]. Therefore, incorporating contextual information in recommender systems is an effective approach to create more accurate and relevant recommendations. Especially, some applications lack information when considering the relationship between users and items [21], [22], [40]. For example, movie recommender systems are very important to incorporate contextual information such as time, location, and companion into the process of recommending the movies to users.
The associate editor coordinating the review of this manuscript and approving it for publication was Pasquale De Meo.
In this research, we propose a new method to increase the efficiency of CF models by considering the similarity values of users or items based on contextual attributes. This method can tackle the sparse data problem of CF models. In particular, the recommender models are built based on two similarity matrices: similarity matrix based on rating values and context-similarity matrix based on the contextual attributes. The models, after being built, are experimented on two datasets of DePaulMovie and InCarMusic, and then the results are compared with the traditional CF models. This article is organized into seven parts. Part 1 introduces an overview of recommender systems and research questions. Part 2 briefly presents Context-Aware recommender models. Part 3 presents steps for calculating contextual similarity values between users or items based on the Chi-square similarity kernel. Part 4 presents the context-similarity collaborative filtering models. Part 5 presents methods for evaluating collaborative filtering models. Part 6 displays the experimental results on two datasets: DePaulMovie and InCarMusic. The final part presents the results of the proposed models.

II. CONTEXT-AWARE RECOMMENDER MODELS
Using contextual data to provide recommendations in the direction of personalization of users is a strong trend of development in recent research on recommender models [14], [27], [32], [42]. Usually, in different situations, users can make different decisions [7]. Comprehensive research of contextual recommendations [10] highlights the real-life that a user's decision depends on its context, rather than it's invariant. Similar users may prefer different items in a different context. Therefore, to accurately predict user preferences, context information needs to be integrated to support recommender models. For example, a companion person is an important context for a movie recommendation, and time and place are essential contextual attributes for holiday recommendation [5] for users. This approach has become popular in many areas, such as the proposed models applied to recommend movies according to contextual data: who to watch movies and where to watch movies [2]. A studying contextual for movie recommendation [43] proposes a context-aware recommender model that uses joint matrix factorization, combining the similarity measures with similar values that calculated from plot keywords of the movies. The models propose contextual articles [20] to users based on contextual information and adjust how to choose articles based on users 'feedback. The contextual recommendation is also prevalent in music recommendation. A study performed on the models for collecting user emotions by describing their mood based on the websites they visited [35]. This emotional context is used to recommend music for users. Beginning from the traditional recommender models as content filtering [8] collaborative filtering [8], the models often use two essential components users and items to predict the recommendation results. Therefore, these models are considered as a function with two parameters: F (user, item) and return the predicted recommendation results: F: U × I − >R In traditional models, predictive functions only consider two input parameters: users and items. Therefore, these models have some problems like cold-start, sparsity. To overcome the above problems, the contextual information of users or items is seen as an important factor to predict the recommendation results. It becomes a third input parameter for the predictive function. Meanwhile, the predictive function becomes a multidimensional function: F: U × I × C − > R Where, F is the predictive function of models; U is a user set, I is item set; C is contexts of users or items; R is user rating matrix; There are three main models used in the contextaware recommender systems. Based on how the contextual information, the models are named as follows: Pre-filtering, Post-filtering, and Contextual modeling. Pre-filtering models ( Figure 1. (a)) [1], [9], [28], [37] These models use contextual properties to build an executable dataset. Then, this dataset is deployed on common 2D models such as collaborative filtering or content-based filtering.
Post-filtering models ( Figure 1. (b)) [1], [9], [28], [37] These models only use contextual attributes at the last step of the recommendation process. The models take the entire 3D database to build predictable results. Then, in the final step, contextual attributes are applied to adjust the recommendation results. Contextual modeling   [1], [9], [28], [37] the contextual information is used in the process of calculating the unknown ratings. The models are to deploy the context directly in the process of user rating prediction.

III. SIMILARITY BASED ON CONTEXT A. CONTEXT INFORMATION OF USERS OR ITEMS
Consider the following examples, if users need support from the tourism recommender systems for booking tours, the contextual factors about the season and accompanied person can greatly affect to decision of users for choosing their journeys or space and time are two important contextual information if users need support to select movies for watching. The examples above show us that the contexts of users or items depend on each specific recommender systems. However, to describe the context-aware collaborative filtering models, the contexts of users or items are defined as follows: Let U = {u 1 ,u 2 , . . . ,u n } includes n users; I = {i 1 , i 2 , . . . ,i m } includes m items; C = {c1,c2, . . . ,ck} includes k contextual attributes when users select items or when items selected by users. When the user u a select item i j or when item i j selected by user u a the value of contextual attributes is specified as follows: Kernel functions have also become a popular useful tool in machine learning [30]. A kernel is a function that takes in two data objects such as images, DNA sequences, or vectors with k-dimensional and outputs a number, with the property that the function is symmetric or positive-semi definite. In this research, we use Chi-square similarity kernel [28], [30] to calculate the similarity context between two users or two items with the formula defined as follows: Suppose user u a selects item i j and user u b selects item i h with contextual attributes defined by two vectors as follows: C a,j = c1 a,j , c2 a,j , . . . ,ck a,j and C b,h = c1 b,h , c2 b,h , . . . ,ck b,h , then the context-similarity value of VOLUME 8, 2020 user u a and user u b or context-similarity value of the item i j and item i h is determined by the following formula: where, K (C a,j , C b,h ) is the context-similarity value between the user u a and user u b or item i j and item i h ; k is the number of contextual attributes; cz a,j is the value of the z th contextual attribute when the user u a selects item i j ; cz b,h is the value of the z th contextual attribute when the user u b selects item i h ;

C. DEFINITION OF CONTEXT-SIMILARITY MATRIX
The context-similarity matrix has a symmetric matrix structure with rows, columns as users or items, and cells as context-similarity values of two users or two items on the rows and columns respectively.
Context-similarity matrix based on users defined as follows: where su a,b is a context-similarity value between the user u a and user u b . This value is calculated by the Eq. (1).
Context-similarity matrix based on items defined as follows: where si j,h is a context-similarity value between item i j and item i h . This value is calculated by Eq. (1).

IV. CONTEXT-SIMILARITY COLLABORATIVE FILTERING RECOMMENDER MODELS
In this section, we propose two models: Context-similarity, user-based collaborative filtering recommender model (CUBCF), and context-similarity item-based collaborative filtering recommender model (CIBCF). The CUBCF model is developed based on the user-based collaborative filtering recommender model and the contextual attributes of users. The CIBCF model is developed based on the Item-based collaborative filtering recommender model and the contextual attributes of items. Both models are based on the rating data and contextual information. However, the CUBCF model is based on the similarity between users, while the CIBCF model is based on the similarity between items.

A. CONTEXT-SIMILARITY USER-BASED COLLABORATIVE FILTERING RECOMMENDER MODEL
The CUBCF model is defined as follows: . . ,ck} include k contextual attributes; R = r c,j be the rating matrix, each row representing a user u c (1 ≤ c ≤ n), each column representing an item i j (1 ≤ j ≤ m), r c,j be the rating value based on user contexts; N be the item list that has a high rating value, and u a be the current user with contextual attributes: C a,j = c1 a,j , c2 a,j , . . . ,ck a,j . The CUBCF model is represented as follows: Figure 2 shows the context-similarity user-based collaborative filtering recommender model. In the first step, user splitting techniques are used to build a similarity matrix based on the contextual attributes of users. In the second step, the context-similarity matrix is built based on the contextual attributes of users. In the third step, the similarity integrated matrix between the similarity matrix and the contextsimilarity matrix is built. In the final step, the similarity integrated matrix is used to build the user-based FC models.

Context-Similarity User-Based Collaborative Filtering Recommender Algorithm
Input: Rating data of users; Context-data of users; User need recommendation (u a ); Output: List of N items recommends to the user u a ; Begin Step 1: Construct a similarity matrix based on users (SU R ) -Use user splitting techniques; -Construct a similarity matrix based on users; Step 2: Construct a context-similarity matrix based on users (SU C ).
-Calculate the context-similarity value between two users; -Construct a context-similarity matrix based on users; Step 3: Construct a similarity integrated matrix (SU I = SU R + SU C ); Step 4: Build CF models based on similarity integrated matrix; Step 5: Identify a list of similar items for user u a ; Step 6: Recommend user u a N items the highest similarity value; End The CIBCF model is defined as follows: Let U = {u 1 ,u 2 , . . . ,u n } include n users; k contextual attributes; R = {r c,j } be the rating matrix, each row representing a user u c (1 ≤c ≤ n), each column representing an item i j (1 ≤ j ≤ m), r c,j be the rating value based on item contexts; N be the item list that has the high rating value, and u a be the current user with contextual attributes: C a,j = c1 a,j , c2 a,j , . . . ,ck a,j . The CIBCF model is represented as follows: Figure 3 shows the context-similarity item-based collaborative filtering recommender model. In the first step, item splitting techniques are used to build a similarity matrix based on contextual attributes of items. In the second step, the context-similarity matrix is built based on the contextual attributes of items. In the third step, the similarity integrated matrix between the similarity matrix and the context-similarity matrix is built. In the final step, the similarity integrated matrix is used to build the item-based FC models

Context-Similarity Item-Based Collaborative Filtering Recommender Algorithm
Input: Rating data of users; Context-data of items; User need recommendation (u a ); Output: List of N items recommends to user u a ; Begin Step 1: Construct a similarity matrix based on items (SI R ) -Use item splitting techniques; -Construct a similarity matrix based on items; Step 2: Construct a context-similarity matrix based on items (SI C ).
-Calculate the context-similarity value between two items; -Construct a context-similarity matrix based on items; Step 3: Construct a similarity integrated matrix (SI I = SI R + SI C ); Step 4: Build CF models based on similarity integrated matrix; Step 5: Identify a list of similar items for user u a ; Step 6: Recommend user u a N items the highest similarity value; End

V. EVALUATE THE ACCURACY OF COLLABORATIVE FILTERING RECOMMENDER MODELS
An evaluation of the CF models is based on the hypothesis that if the models run well on testing data (items rated by users), it will give good prediction results for new data (items have not been rated by users) [6]. In particular, the empirical  dataset is divided into two parts based on the number of users: one is used for the learning models called the training dataset, and the other is used to test the predicted results of the models called the testing dataset. One model is evaluated as good if it gives rating values that are similar to those that the user has rated for items in the testing dataset, or the items that the models choose to recommend users are purchased or rated high by the users in the testing dataset [15]. To evaluate the accuracy of the recommended models, one of two methods is used: an evaluation based on the models' predicted rating value and evaluation based on the models' recommendation results [12], [15].

A. EVALUATION BASED ON PREDICTED RATING VALUES
Evaluation based on predicted rating value of models is a method based on the accuracy of the models by comparing the predicted rating value with the actual rating value [31]. This method often uses the five measures used to calculate errors in statistics: Mean Squared Error (MSE), Root Mean Square Error (RMSE), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE) and Symmetric Mean Absolute Percentage Error (SMAPE). It is considered good when quantities of these errors are of low values [12], [15]. VOLUME 8, 2020 Mean Squared Error (MSE) [25], [31]: The average square error between user rating value and model's predicted rating value.
Root Mean Square Error (RMSE) [25], [31]: The square root of the mean square error between user rating value and the model's predicted rating value.
Mean Absolute Error (MAE) [25], [31]: The average absolute error between user rating value and model's predicted rating value.
Mean Absolute Percentage Error (MAPE) [25], [31]: The average absolute percentage error between user rating value and model's predicted rating value. [25], [31]: The symmetric average absolute percentage error between user rating value and model's predicted rating value.

Symmetric Mean Absolute Percentage Error (SMAPE)
where κ is the number rating values; r ij is the actual rating value for item i by user i;r ij is the predicted value of the models;

B. EVALUATION BASED ON RECOMMENDATION RESULTS
Evaluation based on recommendation results of models is a method used to measure the effectiveness of models by comparing the proposed results of the models with the actual choice of users [31]. To compare these two values, we use three measures: Precision, Recall, and F-measure [25]. In many studies, Precision and Recall are commonly used as indicators for evaluating models based on recommendation results. However, in some cases, when Precision and Recall are inversely proportional, the F-measure indicator is used to evaluate the overall efficiency of the models by harmonizing the Precision indicator and the Recall indicator. If three indicators are high value, the models are rated well [12], [15], [25]. The formulas of three evaluation indicators are presented as follows [25], [31]:

VI. EXPERIMENT A. EXPERIMENTAL DATASETS
Experimental parts of the models are implemented in two different scenarios: Scenario 1 is performed on the DePaulMovie dataset [50], and Scenario 2 is performed on the InCarMusic dataset [3]. DePaulMovie is dataset collected from students' survey results that rate films according to different contextual attributes: time, location, and companion. This dataset contains 5043 rating values of 97 students for 319 films based on three contextual attributes mentioned above. In particular, the rating attribute has a continuous value between 1 and 5 with 16.44% rated 1; 12.39% rated 2; 19.97% rated 3; 24.03% rated 4; 25.92% rated 5). InCarMusic is the dataset that collected suggestions of contextual music of automobile drivers on web services. This dataset includes 4012 rating values of 43 users for 139 songs based on eight contextual attributes. In particular, the rating attribute has a continuous value between 0 and 5 with rated 0 is 122; rated one is 1488; rated two is 709; rated three is 658; rated four is 516; rated five is 519.

B. TOOL USED FOR EXPERIMENT
The proposed models have experimented on the ARQAT tool [33]. This tool has been developed by our team in the language R. It includes functions: process data; calculate context-similarity matrix based on Chi-square similarity kernel; build and evaluate the CF models [13].

C. SCENARIO 1 1) PROCESS DEPAULMOVIE DATASET ACCORDING TO CONTEXTUAL ATTRIBUTES
From students' rating data for movies, we build a real numerical rating matrix of DePaulMovie dataset with 97 rows, 319 columns, and 5043 rating values. To build a contextsimilarity matrix of users, the contextual attributes are used to split users according to specific contexts when students choose to watch movies. This leads to the set of original users being split into 488 different contextual users. Therefore, the context-similarity matrix of users is a square matrix with a structure of 488 × 488. To build a context-similarity matrix of items, the contextual attributes are used to split items according to specific contexts when the movies are selected by the students. This leads to the set of original items being split  into 1610 different contextual items. Therefore, the contextsimilarity matrix of items is a square matrix with the structure 1610 × 1610.

2) EVALUATE BASED ON PREDICTED RATING VALUES
To compare the accuracy of the two proposed models with two traditional CF models (UBCF and IBCF), we developed evaluation data for models using the k-fold method (k = 5) on the rating matrix. After that, the experimental process is implemented on four models: CUBCF, CIBCF, UBCF, and IBCF. From the empirical results, we measured error indicators: Mean Squared Error (MSE), Root Mean Square Error (RMSE), Mean Absolute Error (MAE) of each model. Table 1 presents the value of the error indicators of the models. This result shows that context-similarity collaborative filtering recommender models have lower error indicators than traditional CF models on the DePaulMovie dataset. Specifically, the RMSE, MSE, MAE indicators of CIBCF models are all lower than those on the IBCF models; Similar to CIBCF models, the RMSE, MSE, MAE indicators of CUBCF models are all lower than those on the UBCF models.

3) EVALUATE BASED ON RECOMMENDATION RESULTS
This evaluation method runs experiments on four models: CUBCF, CIBCF, UBCF, IBCF and calculate the Precision, Recall, and F-measure indicators on the empirical data divided by the k-fold method (k = 5). Figure 4 presents the results of comparing the three above indicators of the models. This comparing result shows that the indicators for measuring the accuracy of both models (CUBCF and CIBCF) are higher than those in the traditional CF models (UBCF and IBCF). In particular, CIBCF models have the highest accuracy compared to the remaining 3 experimental models.

4) COMPARE ACCURACY OF MODELS BASED ON THE PREC/REC RATIO
To evaluate the effectiveness of the two proposed models on the DePaulMovie dataset, we chart the Prec/Rec ratio of these two models and compare them with the two traditional CF models UBCF and IBCF. In particular, the number of movies recommends to users of these models is gradually increased from 1 to 10. The results of comparing the accuracy of each pair of models are presented in Figure 5. The chart comparing the results of the models shows that the Prec/Rec ratios of CUBCF and CIBCF models are always higher than Prec/Rec ratios of UBCF and IBCF models when the number of recommendation movies per user varies from 1 to 10.

D. SCENARIO 2 1) PROCESS INCARMUSIC DATASET ACCORDING TO CONTEXTUAL ATTRIBUTES
From the rating data of automobile drivers for songs, we build a real numerical rating matrix of InCarMusic dataset with 43 rows, 139 columns, and 4012 rating values. To build a context-similarity matrix based on users, the contextual attributes are used to split users according to specific contexts when drivers choose to listen to the songs. This leads to the VOLUME 8, 2020  set of original users being split into 782 different contextual users. Therefore, the context-similarity matrix of users is a square matrix with a structure 782 × 782. To build a contextsimilarity matrix based on items, the contextual attributes are used to split items according to specific contexts when the songs are selected by drivers. This leads to the set of original items being split into 2967 different contextual items. Therefore, the context-similarity matrix based on items is a square matrix with the structure 2967 × 2967.

2) EVALUATE BASED ON THE PREDICTED RATING VALUE
Similar to the experimental section on the DePaulMovie dataset, in this evaluation, we continue to calculate the error indicators: RMSE, MSE, MAE for four models: CUBCF, CIBCF, UBCF, IBCF on experimental data divided by k-fold method (k = 5). The value of the error indicators of the models is presented in Table 2. These results show that the error indicators of the proposed models (CUBCF and CIBCF) are lower than those of the two traditional CF models (UBCF and IBCF).

3) EVALUATE BASED ON RECOMMENDATION RESULTS
Similar to the experimental section on the DePaulMovie dataset, we continue to calculate indicators for measuring the accuracy of models (CUBCF, CIBCF, UBCF, IBCF) on the dataset divided by the k-fold method (k = 5). Figure 6 presents the comparison results of the three above indicators of the models. This comparison results show that the values of the indicators for measuring the accuracy of both models (CUBCF and CIBCF) are higher than those of two traditional CF models (UBCF and IBCF). In particular, CIBCF models have the highest accuracy compared to the remaining three experimental models.

4) COMPARE ACCURACY OF MODELS BASED ON THE PREC/REC RATIO
Similar to the experimental scenario 1, to compare the effectiveness of the two proposed models with two traditional CF models on the InCarMusic dataset, we continue to graph the Prec/Rec ratio to compare each pair of models CUBCF-UBCF, CIBCF-IBCF. Specifically, when the proposed models execute with the number of songs recommended for each user of the models increases gradually from 1 to 10. Figure 7 presents a chart comparing the accuracy of model pairs. This chart shows that CIBCF's Prec/Rec ratio is always higher than IBCF's Prec/Rec ratio. For the CUBCF model, the Prec/Rec ratio is equal to the UBCF model's Prec/Rec ratio when the number of songs recommended for each user of the models increases from 1 to 2. On the contrary, when the experimental models with the number of songs increase from 3 to 10, the Prec/Rec ratio of CUBCF models is always higher than the Prec/Rec of UBCF models.

VII. CONCLUSION
In this article, we propose a method to improve the accuracy of the CF models by integrating contextual information of users or items when developing the recommender models. In these models, the recommendation results are calculated based on an integrated similarity matrix. The integrated similarity matrix is built by integrating the similarity matrix based on rating values and context-similarity matrix based on contextual attributes. Our experimental results reveal that the proposed models can offer significant improvements in recommendation tasks based on the two real context datasets.
In particular, these models can alleviate the sparse data problem and offer more improvements. MOHAMED ABDEL-BASSET received the B.Sc. and M.Sc. degrees from the Faculty of Computers and Informatics, Zagazig University, Egypt, and the Ph.D. degree from the Faculty of Computers and Informatics, Menoufia University, Egypt. He is currently an Associate Professor with the Faculty of Computers and Informatics, Zagazig University. His current research interests are optimization, operations research, data mining, computational intelligence, applied statistics, decision support systems, robust optimization, engineering optimization, multiobjective optimization, swarm intelligence, evolutionary algorithms, and artificial neural networks. He is also working on the application of multiobjective and robust meta-heuristic optimization techniques. He is also an/a Editor/Reviewer in different international journals and conferences. He holds the Program Chair in many conferences in the fields of decision making analysis, big data, optimization, complexity, and the Internet of Things, and editorial collaboration in some journals of high impact.
MAHMOUD ISMAIL received the B.Sc., M.Sc., and Ph.D. degrees from the Faculty of Computers and Informatics, Zagazig University, Egypt. He is currently working on the application of metaheuristic optimization techniques. His current research interests are optimization, operations research, computational intelligence, decision support, swarm intelligence, and evolutionary algorithms. He is also a reviewer in different international journals and conferences. VOLUME 8, 2020