Tb-ca: a Hybrid Method Based on Trust and Context-aware for Recommender System in Social Networks

Recommender systems help users faced with the problem of information overflow and provide personalized recommendations. Social networks are used for providing variety of business or social activities, or sometimes a combination of both. In this paper, by considering social network of users and according to users' context and items, a new method is introduced that is based on trust and context aware for recommender systems in social networks. The purpose of this paper is to create a recommender system which increases precision of predicted ratings for all users especially for cold start users. In the proposed method, walking on web of trust is done by neighbor users for finding rating of similar items and users' preference is gotten of items' context. The results show that suitable recommendation with user's context is provided by using this method. Also, this system can increase precision of predicted rating for all users and cold starts too and however, do not decrease the rating's coverage.


Introduction
Nowadays web users spend significant amount of time on various websites and produce ample information.User profile information and user interaction behaviors are instances of information that are generated by various users.However, users generally wish to get personalized results as search results, but they do not tend to spend significant amount of time to determine their interests and preferences and also complete their personal profile.Also, during the time and according to the various users, the key words in the search process are different.Recommender systems automatically extract information about the users and use this information to make recommendations tailored to each user.However, the traditional recommender systems encompassed with some challenges, such as requiring many initial ratings to produce recommendations.It is also possible to create fake profiles to fraud and thus new recommender systems approaches were considered.One of the recent applications of recommender systems are their applications in social network.
During the past few years, many researches have focused in the field of new and available strategies within the web 2.0.Some of these new strategies are dedicated to Social Recommender systems (Zhou et al., 2012).Social network based-recommendation is used to improve recommendation systems because of its benefits.For instance, as long as cold-start users are connected to the social network, it can deal with them.Social network based recommendation systems are more robust to fraud, in particular to profile attacks (Jamali & Ester, 2011).Social recommender systems have been accomplished in various branches of studies.Trust based and Context-Aware models are two approaches for creating recommendation in social networks.A system which combines features of both approaches, can suggest more suitable items in accordance with the users' preferences and the context of user and items.In this system, recommendations will be according to context of item and user and is affected by ratings of items and trust network of users to items.
Context is expressed as a set of features, which represents the user status specification (Alonso et al., 2009).In addition to user profiles, user context can be also affected to the user preferences.Traditional recommender systems rely on user profile, which reflect the user's personal taste, but do not consider additional measures, such as temporal emotional and geographical.In addition, history of user's context can affect his/her preferences (Akther et al., 2012;Sim et al., 2012).
Recommender systems on social networks using trust network among the users estimate the user's rating to items.On the other hand, context-aware recommender systems by considering user context try to recommend items that suit their context.The purpose of this paper is to provide a recommender system on social network, which offers accurate suggestions to users by using information of users trust network.By using trust network among the users this recommender system tries to recommend items, which are more in accordance with user preferences and by applying context data tries to offer items tailored to user conditions.In the proposed trust-based context-aware (TB-CA) method, not only ratings of user's neighbors to target item or similar items and distance between given user and his/her neighbors but also most similar item in each step of random walking are considered.Meanwhile properties of context of user and item and history of item context are used for presenting more accurate recommendations.
The rest of the paper is organized as follows: Section 2 reviews the previous works.The details of the proposed model are discussed in Section 3. Section 4 describes the data set, evaluation criteria and experimental results.Then Section 5 concludes the paper and discusses future researches.

Related Works
In this section the previous works on Recommender systems used in social networks are reviewed.In the recent years, developed models in recommender systems on social networks have been increased.According to the nature of social networks and recommender systems, limiting of research to a specific field is difficult and sometimes several fields simultaneously are applied in a research.There are four categories for social recommender systems: context-aware models, trust-based models, tag-based models, social influence-based models (Keikha et al., 2013a;Keikha et al., 2013b).
Generally, trust-based recommender systems on social networks are divided into two approaches: memory-based and model-based, that each approach has its properties.In the memory-based approach, first social network for finding raters in neighborhood is explored and ratings are collected for prediction calculation (Jamali & Ester, 2009).TidalTrust is a trust-based recommender system on social network in which trust is the core of algorithm.In TidalTrust, a modified breadth first search on the trust network is accomplished for calculation of a prediction.In fact, all raters with minimum distance from the source user are found and weighted ratings, which are given by the trust among these users and source user are combined (Golbeck & Hendler, 2006).In TidalTrust, due to data sparseness of input scoring matrix, step of finding similar users are often failed.In MoleTrust, a trust measure is used instead of this step.The used idea in MoleTrust and TidalTrust is similar but in MoleTrust, all score of raters is considered to a maximum depth.Also, MoleTrust perform a backward search for calculating the trust value between two users (Park et al., 2012).
TrustWalker is a trust-based recommender system on social network, which combine trust based and Item based recommendation.In this method not only rating of target item is considered but ratings of similar items are used.Also, several random walks on the social network are performed where each random walk returns a rating on a target item or a similar item and finally, predicted rating is obtained from total of all returned ratings (Jamali & Ester, 2009).
Nowadays, since choices of users depend on their current context, such as time, location, and etc., a recommender system that suggests items according to context of users and items is valuable.Sim et al. (2012) presented a Context-Aware recommender scheme that reflects the user types for estimating the closeness between users on social networks with the cosine similarity measure.Computer simulation shows that the proposed scheme significantly improved precision and validity of ratings compare with models that use multi-dimensional paradigm and rough set theory.Moreover, proposed scheme suggests services to users according to social position and context of users (Sim et al., 2012).Adomavicius et al. (2005) presented a multidimensional approach for recommendation systems based on context information that uses background information and increases the quality of recommendations for specific cases (Adomavicius et al., 2005).In Shin et al. (2009) raw context information is summarized into a conceptual level and then this conceptual context is used in recommendation process.Proposed model in Bogers (2010) used relationships between different context objects on the website for making a context graph and a random walk on this graph to generate a probability distribution on user unobserved movies is done.Pessemier et al. ( 2009) developed a recommender system that social network relations and context (location, time, etc.) were considered.This system enables users to select a mood, place and conditions of their environment from a predefined list.
In Alonso et al. (2009), a hybrid collaborative filtering model was proposed, which provides recommendations based on context for passenger users by considering geographical context.A new architecture for personalization user was developed by Akther et al. (2012) that combine social network and context data.

Trust-Based Context-Aware Model
In this section, the trust-based context-aware (TB-CA) proposed model is presented that applies trust network among users, context of item and user and item domain to predict rating of user to item.Steps of Trust-Based Context-Aware model is shown in Fig. 1.In this section, first data preprocessing step is described and then the details of the proposed model are presented.

Data preprocessing
For prediction ratings of users to items the ratings of users to items, item context and also the trust network of users must be available.As shown in Fig. 1, context data to use in the proposed system must be converted to conceptual context data and for this purpose, the conceptual context must be identified.According to the type of raw context, the conceptual contexts are different.Therefore, identification of conceptual contexts is a process that specifies conceptual contexts for each section of raw context data.For example, the raw context data of date and time can be interpreted to spring, summer, autumn, winter, morning, afternoon, evening, etc.
Since the raw context data are dynamic and sequential, they cannot be used directly in the system.Thus, an abstraction process is needed to summarize raw context data into context concepts for using context in the system.There are different weight functions for separating of sequential data such as the triangular, trapezoidal function, Gaussian function, etc. (Shin et al, 2009).Since each item in Recommender Systems is expressed by several features, general conceptual domains of items must be identified and also, sub-domains must be classified for using in the proposed system effectively according to the identified domains.As shown in Fig. 1, after determining conceptual domains of items, sub domains which are related to the items are classified to a set of conceptual domains.These classifications are used to determine the similarity of items.

Data preprocessing
Steps Results

Rating Estimation in TB-CA Model
Estimation of rating is the basic problem in recommender systems.In TB-CA model some steps have been proposed that rating of user to items can be predicted with good precision as following: first a user and an item are selected and then, a set of rated items by user that have similar conceptual context with target item and a set of trusted neighbors of user are formed.If the target item exists in the set of items, the item rating is returned.On the other hands, by considering context and context history of items, in the set of rated items, most similar items with user who has similar conceptual domain with target item, is determined and by using this similar, a probability for continuing random walk or returning rate of most similar item is calculated.If random walk is continued, one of the user neighbors for continuing the walking is selected and the process is repeated.Random walk steps are being forwarded to the specified depth and finally rating of user to item is predicted based on returned ratings.These steps are shown in Fig. 1.
Users and items in recommender system are called U and I, respectively, which are defined as U= {u1, …, uN} and I= {i1, …, iM}.Rating of user u on item i is expressed as ru,i that can be any real number, but ratings are usually integer numbers in interval [1,5].Also, set of rated items by user is defined as For u∈U and i∈I suppose that ru,i is unknown, the aim of recommender systems is to predict rating of u to I, where u and i are called source user and target item and predicted rating is expressed as r � u,i .
There is a trust network among users in a trust based system.If user u trusts user v, the value of the trust is expressed as tu,v and it's a real number in the interval [0,1].Collection of direct trusted users by user u is called TUu.Therefore, trust network can be define as a graph G=<U,TU> that there is a node corresponding to each user and an edge for every trust statement and TU is defined as TU={(u,v)| u∈U,v∈TUu}.
For prediction of rating for source user and target item, first RIu and TUu for source user u is formed where TUu is defined as   ={v∈U|  , >0,  , ≤ 1} (Jamali & Ester, 2009).The next step is to check for existence of the target item in RIu with same context.In TB-CA model, two same items are considered quite identical if they have same conceptual contexts.One of the conditions for stopping random walk at each step is existence of similar items and in this case, rating of similar item is returned for prediction of the rating.
If random walking is continued, in the next step similarity of items in RIu with item i should be calculated and most similar item must be determined.To calculate the correlation in the TB-CA model, data of context concepts are used which are obtained from raw contexts.The expected preferences of i th user on k th item is: where fUH(i,j) is the correlation between the i th current context of user and the j th context history and fHI(j,k) is the correlation between the j th context history and the k th item (Shin et al., 2009).Finally, an item which has the highest preference is the best recommend to the user.Similarity of item j which has highest preference with item i is calculated by: , is the set of common user which have rated both items i and j and Corr(i,j) is correlation between items i and j (Jamali & Ester, 2009).To avoid a random walk continues forever, a value for the maximum depth is considered.If the number of steps is fewer than the maximum depth, the random walking with probability Ø u,i,k is stopped and with probability 1 − Ø u,i,k is continued that Ø u,i,k is: k indicates the number of steps.If the random walk is stopped, item j with high preference according to Eq. ( 1) is selected and its rating is returned.If we decide to continue the random walk, we choose trusted users of u for forwarding random walk.Estimated rating for the source user u on target item i should be obtained from values of expected ratings which is returned by various random walking as below (Shin et al., 2009): where XYu,i is the random variable for stopping the random walk at node v and selecting item j rated by v, while the random walk started from source user u looking for target item i (Jamali & Ester, 2009).

Empirical analysis
This section shows experiments for evaluation the efficiency of the proposed model and comparison with other models.Dataset and evaluation strategy is introduced and then the results of test are presented.Experiments are performed on a real dataset and results for different versions of proposed method, item-based recommendation method and TrustWalker (Jamali & Ester, 2009) are reported.Also, TrustWalker model and item based collaborative filtering model (Sarwar et al., 2001) are implemented and evaluated on the dataset.

Dataset Description
To test and evaluate the TB-CA model, a dataset that have rating of users to items, context data of user and item and information of trust network among users are needed.Data are collected from Epinions.comwhich is a customer comments website that users can review various items and rate them between 1 and 5. Also users can add other users in their trust network.A crawler was written for collection of ratings and trust statements.This dataset contains ratings of user to items, time of ratings, trust network of user and information of items categories and sub categories.
The dataset contains 87,793 users who have rated at least one item of 302,454 items.The overall number of assigned ratings is 1,029,060 and sparseness of rating matrix is 99.996124 percent.29,131 Users who have less than 5 Ratings are 33.18percent of users that are considered as a new user.The items are placed in 33 categories and 628 sub categories.It also includes data on 5 July 1999 to 5 July 2013.72,777 users also have declared their trust state to 53,507 users.Number of expressed trust statement are 513,702 and average number of trusted user by each user is 7.05.

Experimental Design
To evaluate the TB-CA model by using different contextual concepts and compare with previous models, these models are implemented.To measure the effects of various contexts, the TB-CA model is implemented by using different contextual concepts including work days and weekends, weekdays, seasons and all of them.For comparison TB-CA model with previous models, Item based collaborative filtering (Sarwar et al., 2001) is implemented by using Pearson correlation as similarity measure and TrustWalker model (Jamali & Ester, 2009) is implemented with maximum depth=6.

Evaluation measures
The most common method for evaluating recommender systems is "leave-one-out" which is an offline method.This method can be performed on an already accumulated data set that ignores one of the ratings and then using a specific algorithm tries to predict the rating.Then the predicted rating is compared with the actual rating and difference between them is considered as the prediction error (Park et al., 2012).The prediction error is calculated by using Root Mean Squared Error (RMSE): , is a Boolean, which indicates user u has rating on i in our data set and  , and ̂ , , respectively show the actual and predicted ratings.Smaller value of RMSE represents the more accurate recommendation (Jamali & Ester, 2009).
On the other hand, the aim of the trust based recommender models is to increase of Coverage without loss of precision.In fact, the Coverage is considered as percentage of pair <user, item> which its ratings can be predicted.The Coverage was not considered in many previous studies because the coverage closes to one hundred percent.But it is a fact that in those studies there is a considered data set which at least each user rated to 20 items and there are many of items that are rated by several users.But in a very sparse data set, there are plenty of new users who have rated very few items and also, there are plenty of items which have been rated by only one person (Park et al., 2012;Jamali & Ester, 2009).
To combine RMSE and Coverage on a single evaluation criterion, "F Measure" is calculated.For this purpose, the RMSE should be converted into a measure of precision in the interval [0, 1].Since ratings are in [1,5] and 4 is the maximum of possible error, precision is defined as 1 −  4 .Therefore, F measure is defined as: For each pair of <user, item> that model cannot predict rating, it is said that Recommender System does not cover the pair of <user, item> (Jamali & Ester, 2009).

Experimental Results
In this section, experimental results are expressed for the proposed model by using various contextual concepts and previous models on cold start users and all users.Table 2 shows RMSE, coverage and F measure for different models on all users and Fig. 3 shows the precision, coverage and F-measure on all users.As shown in  In summary, the TB-CA model has the highest F measure for both cold start users and all users.In other words, by using the TB-CA model, the prediction error is reduced while coverage is not lost.Also, coverage of TB-CA model is close to TrustWalker model and much higher than traditional collaborating filtering model with approximately 95% for all users and 73% for cold start users while it improves precision of prediction for cold start users and all users.Moreover, proposed model with all context concepts has highest value of F measure.

Conclusion
Recommender systems suggest items to users without spending significant amount of time to determine user interests and preferences.Traditional collaborative filtering estimate utility of items for users according to rated items by other users.Nowadays the influence of social network among users has caused increasing notice to social network based recommender system.Process of finding similarity is replaced with trust network in recommender systems on social networks while context of user and item is not considered.Methods which have considered contexts for recommendation in social networks ignore the trust network of users.For increasing precision of recommendations, a model was developed in this paper that suggests items to users by using trust network among users and context of users and items.
In the proposed model, at the time of walking on the trust network for calculating similarity of items, category and sub-category of item and context of items and users were used.If target item with equivalent context is found in walking steps, rating of the item is returned to prediction of rating.In each step, preferences of given user to most similar item is considered for calculating probability of stopping or continuing of random walk and if random walk is stopped, rate of most similar item is returned.Finally, rating of given user to target item based on returned ratings is predicted.
Precision of the proposed model was evaluated with different contextual concepts and compared with previous trust based recommender systems.By using of extracted dataset from Epinions.comempirical analysis showed that TB-CA model with all contextual concepts had the most precision and F measure compared with previous models and it means that coverage was not lost in TB-CA model.
This work suggests several interest directions for future works.In this paper, only trust information among users was used but distrust information can be used to improve the model which is in some social networks.Also, social influence and social network concepts can be used for increasing precision in proposed model.

Fig. 2 .
Fig. 2. Precision, coverage and F measure for different models on cold start users

Fig. 3 .
Fig. 3. Precision, coverage and F measure for different models on all users Table1shows RMSE, coverage and F measure for various models on cold start users.As can be seen, the coverage in TrustWalker model and TB-CA with little difference is the maximum amount of coverage on cold start user compared with the other models.By considering week days as only context concept reduce coverage and increase RMSE.If context is considered as work days and weekend, coverage is more than item based collaborative filtering and TB-CA with context of week days.If all context concepts are considered not only the coverage is maintained but rating prediction error is reduced.

Table 2
, proposed model with all available context concepts has more coverage than proposed model with part of context concepts but it has a little lower coverage than TrustWalker model.Nevertheless, since RMSE for proposed model with all context concepts is lower than TrustWalker model, proposed model has highest F measure.

Table 2
Results for all users