Keywords

1 Introduction

With the development of the Internet, a lot of data are generated. It is becoming more and more difficult to quickly find the required information in a large amount of data. This is the problem of information overload. Recommender systems are proposed to solve this problem. Recommendation system can analyze user preferences according to historical data, then help users filter information, and display the useful information to users. Recommender systems are widely used in the field of e-commerce. On the one hand, it can make the user experience better and improve the loyalty of users. On the other hand, it can help businesses sell more things and increase sales.

Recommender systems can be divided into content-based recommender systems, collaborative filtering systems and hybrid recommender systems. Collaborative filtering is one of the most widely used recommender systems [1]. Collaborative filtering assumes that two users with similar historical ratings also have similar ratings for other items that have not been rated. Collaborative filtering includes three steps: the first step is to calculate the similarity between users according to their historical ratings; the second step is to find the nearest neighbors who are most similar to the target users as the nearest neighbors of the target users; and the third step is to calculate the weighted average of the nearest neighbors’ ratings on the target items as the predicted rating. Collaborative filtering does not require domain knowledge, and is intuitive and easy to understand. However, traditional collaborative filtering faces the following problems: data sparsity, cold start, scalability and so on [2]. Adding trust relationship between users in recommender systems provides a new way to solve the above problems.

Some scholars have tried to use trust relationship to improve recommender system. Ma et al. propose SoRec which map user-item rating matrix and trust relation matrix to low dimensional space at the same time, and combine the two matrixes by sharing the same user latent feature space [3]. Tidaltrust performs a modified breadth-first search in social networks to predict the target user’s rating on the target item [4]. MoleTrust is similar to TidalTrust, the different is that MoleTrust considers all users who have rated the target item up to a maximum-depth [5]. Jamali et al. proposed a random walk method called TrustWalker, which is a combination of trust-based and item-based recommendations [6]. Deng et al. proposed an algorithm called RelevantTrustWalker, which is similar to TrustWalker, but using matrix factorization to calculate the similarity between users and the similarity between items [7]. Jamali and Ester proposed a recommender system which combines the collaborative filtering and trust-based approach to improve Top-N Recommendation [8]. Though these papers have improved recommender systems by consider trust information, most of these paper did not combine the explicit trust and implicit trust. In fact, the implicit trust is also really useful in recommendation.

In this paper, we proposed a trust based recommender system named RS-exp-imp, which combine explicit trust influence and implicit trust influence. Firstly, we mine the implicit trust between users by calculating similarity of historical ratings between users. Then, for every user, we select K explicit trust users and K implicit trust users. The predicted rating is a combination of the rating from explicit trust users and implicit trust users. Besides, we consider trust propagation to use more effective information. In specific, if the target users have not rated the target item, then his rating is predicted ratings from his own explicit trust users and implicit trust users.

2 Methodology

Suppose there are m users and n items. The historical ratings can be expressed as a matrix R = [rij]m × n. rij is the rating of the jth item given by the ith user, which is usually an integer number from 1 to 5 with interval of 1. T = [Tif]m × m denotes the explicit trust matrix. If the ith user trust the fth user, Tif= 1, otherwise T if= 0. The problem we study in this paper is as follows: predict the ratings for items given by users using R and T.

  1. A.

    Mining the implicit trust between users

Explicit trust is obtained directly from the user’s trust list or friends list and is defined by the user himself. Implicit trust is mined through user’s historical ratings. The idea behind implicit trust is that there is a trust relationship between the target user and those users who have similar historical ratings with him. So we calculate the similarities between users. In this paper, we use Pearson Correlation Coefficient (PCC) to measure the similarities between users. The calculation formula of PCC is 1.

$$ sim_{ig} = \frac{{\sum\limits_{{j \in {\mathbf{I}}_{i} \cap {\mathbf{I}}_{g} }} {(r_{ij} - \bar{R}_{i} )\,{ \times }\,(r_{gj} - \bar{R}_{g} )} }}{{\sqrt {\sum\limits_{{j \in {\mathbf{I}}_{i} \cap {\mathbf{I}}_{g} }} {(r_{ij} - \bar{R}_{i} )^{2} } } \,{ \times }\,\sqrt {\sum\limits_{{j \in {\mathbf{I}}_{i} \cap {\mathbf{I}}_{g} }} {(r_{gj} - \bar{R}_{g} )^{2} } } }} $$
(1)

where simig is the similarity of the ith user and the gth user, Ii is the set of the items that the ith user has rated rij is the rating that the ith user gave to the jth item \( \bar{R}_{i} \) is the average rating of the ith user. The value of simig is between −1 and 1. The larger the value is, more similar the two users are.

For every user, we select top K users who are the most similar to him as his implicit trust users and build implicit trust relationship between users.

  1. B.

    Trust propagation

For the target user, his predicted rating is a combination of predicted rating from his explicit trust users and his implicit trust users. As shown in Fig. 1.

Fig. 1.
figure 1

Recommender systems based on explicit trust and implicit trust

The target user is presented as a red point in Fig. 1. The dotted line represents the implicit trust relationship between users, while the solid lines represent explicit trust relationships between users. Suppose the target user has two explicit users and three implicit users, his predicted rating for the target item consists of two part. One is from his two explicit users, which is defined as \( R_{ij}^{exp} \). Another is from his three implicit users, which is defined as \( R_{ij}^{imp} \). The weights of \( R_{ij}^{exp} \) and \( R_{ij}^{imp} \) are \( W_{i}^{exp} \) and \( W_{i}^{imp} \), respectively.

$$ W_{u}^{exp} + W_{u}^{imp} = 1 $$
(2)

\( R_{ij}^{exp} \) is the weighted average of the ratings from all explicit trusted users. The formula of \( R_{ij}^{exp} \) is 3.

$$ R_{ij}^{exp} = \frac{{\bar{R}_{i} \sum\nolimits_{{m \in T_{i}^{exp} }} {Trust_{im}^{exp} \,{ \times }\,(R_{mj} - \bar{R}_{m} )} }}{{\sum\nolimits_{{m \in T_{i}^{exp} }} {Trust_{im}^{exp} } }} $$
(3)

where \( \bar{R}_{i} \) is the average rating of the ith user. \( T_{i}^{exp} \) is the set users who are explicit users of the ith user. \( Trust_{im}^{exp} \) is the trust degree of the ith user to the mth user. The more the target user trusts the mth user, the large the weight is and the greater the influence from the mth user, \( Trust_{im}^{exp} \) is calculated by 4.

$$ Trust_{im}^{exp} = \frac{1}{{1 + \exp ( - \frac{{\left| {I(i) \cap I(m)} \right|}}{2})}}\,{ \times }\,sim_{im} $$
(4)

where I(i) is the item set the ith user has rated. \( sim_{im} \) is calculated using 1.

Similar to explicit trust, the formula of \( R_{ij}^{imp} \) is defined in 5

$$ R_{ij}^{imp} = \frac{{\bar{R}_{i} \sum\nolimits_{{n \in T_{i}^{imp} }} {Trust_{in}^{imp} \,{ \times }\,(R_{nj} - \bar{R}_{n} )} }}{{\sum\nolimits_{{n \in T_{i}^{imp} }} {Trust_{in}^{imp} } }} $$
(5)

where \( T_{i}^{imp} \) is the set users who are implicit users of the ith user. \( Trust_{in}^{imp} \) is the trust degree of the ith user to the nth user, which is calculated by 6.

$$ Trust_{in}^{imp} = \frac{1}{{1 + \exp ( - \frac{{\left| {I(i) \cap I(n)} \right|}}{2})}}\,{ \times }\,sim_{in} $$
(6)

In this paper, we set \( W_{u}^{exp} = W_{u}^{imp} = 0.5. \)

If a user who is trusted by the target user has not rated the target item, we predict a rating for from his own explicit trust users and implicit trust users, and the predicted rating are seen as his own rating and is fed back to the target user. In this way, propagation of both explicit trust and implicit trust is considered into the recommender system.

3 Results

  1. A.

    Datasets

In this section, we select two well-known datasets FilmTrust and Ciao to do experiments to compare the recommender system proposed in this paper and other recommender systems.

FilmTrust is a movie website. Users in this website are able to rate the movies in the range of 0.5 (min) to 4.0 (max) with step 0.5. Moreover, we can get the explicit trust relationship between users. The Ciao dataset contains users’ ratings on an online-shopping website Ciao.com. The values of the ratings are in the range of 1 (min) to 5 (max) with step 1. We can also get the explicit trust relationship between users. The general statistics of the two datasets are shown in Table 1.

Table 1. Statistics of FilmTrust and Ciao
  1. B.

    Metrics

We use the Mean Absolute Error (MAE) and the Root Mean Square Error (RMSE) to measure the accuracy of predicted ratings.

The MAE is defined as:

$$ MAE = \,\frac{{\sum\limits_{{(i,j) \in {\text{Te}}}} {\left| {r_{ij} - \hat{r}_{ij} } \right|} }}{{\left| {{\mathbf{Te}}} \right|}} $$
(7)

where \( \hat{r}_{ij} \) is the predicted value of the rating \( r_{ij} \) and Te is the testing rating set.

The RMSE is defined as

$$ RMSE = \sqrt {\frac{{\sum\limits_{{(i,j) \in {\text{Te}}}} {\left( {r_{ij} - \hat{r}_{ij} } \right)^{2} } }}{{\left| {{\mathbf{Te}}} \right|}}} $$
(8)

The smaller the value of MAE or RMSE is, the better the recommendation performance is.

  1. C.

    Comparison

We compare our proposed recommender system and the following recommender systems.

  1. (1)

    UBCF: user-based CF approach, which predicts the preference of a target user by collecting the ratings from other similar users.

  2. (2)

    TrustWalker: proposed by Jamali and Ester, which is a random walk method combining the trust-based and item-based recommendations [6].

  3. (3)

    RelevantTrustWalker: proposed by Deng et al. [7]. The target of each walk is selected according to the trust relevancy among users instead of being selected randomly.

  4. (4)

    Trust-CF: proposed by Jamali and Ester [8]. It combines the collaborative filtering and trust-based approach.

K is the number of implicit trusted users. We do 5-fold cross validation six times. A total of 30 experiments were conducted and T-test was carried out. The results are shown in Tables 2 and 3.

Table 2. Accuracy comparisons of rating prediction on FilmTrust
Table 3. Accuracy comparisons of rating prediction on Ciao

From Tables 2 and 3 we can see that our proposed recommender system can predict ratings more accurate than other 4 recommender systems and T test are significant. When K = 10, RS-exp-imp performs better than K = 5, but the results is not significant. So the parameter K can affect the results, but the effect is not obvious.

  1. D.

    The Advantage of Explicit Trust and Implicit Trust

In this section, we do experiments to explore the advantages of combining explicit trust and implicit trust. We compare the performance of only consider explicit trust, only consider implicit trust and consider both of explicit trust and implicit trust. The results are shown in Table 4.

Table 4. The advantage of explicite trust and implicite trust

It can be seen that considering both explicit trust and implicit trust perform best, which confirm the advantage of explicit trust and implicit trust.

4 Conclusion

In this paper, we proposed a recommender system RS-exp-imp, which combines both explicit trust and implicit trust. We calculate the similarity between users and mine the implicit trust between users. Then predicted rating for the target user is the combination of predicted rating from users who are explicit trusted by him and predicted rating from users who are implicit trusted by him. The degree of trust determines the weight of rating. If the direct trusted users have not rated the target items, we predict a rating for him in the same way as his rating. In this way, trust propagation is considered into RS-exp-imp. Experimental results on two datasets demonstrate that the proposed RS-exp-imp outperforms other state-of-the-art recommender systems and confirms the advantage of combine the explicit trust and implicit trust.