# Modeling Implicit Trust in Matrix Factorization-Based Collaborative Filtering
## 3 Model
### Approach 1: Use Estimated Trust  
One of the simplest ways to incorporate trust into the preference calculation is to aggregate both the trust matrix and predicted preference matrix into one matrix. However, the trust matrix is very sparse, as it is derived from a sparse original preference matrix. Consequently, the trust values can only be aggregated with non-empty entries in the original preference matrix. This problem can be solved by learning the latent factors of trust, and then aggregating them with the latent factors of the preference matrix. To this end, the trust matrix is factorized into two low-dimensional trust vectors, \(tp_{u}\) and \(tq_{i}\), which are associated with the users and items, respectively. Similar to the SVD, we determine \(tp_{u}\) and \(tq_{i}\) by minimizing the estimation error as:  
\[min\sum_{u,i\in R}\left(t_{u,i}-tq_{i}^{T}tp_{u}\right)^{2}+\lambda \tag{11}\]  
where \(tq_{i}^{T}tp_{u}\) is the inner product of the two trust vectors, and \(\lambda\) is the regularization constant, which prevents overfitting of the model to the training data. As previously mentioned, \(p_{u}\) and \(q_{i}\) capture the general latent features of both the users and items. Similarly, the trust-related features are captured via \(tp_{u}\) and \(tq_{i}\). The primary goal of combining the general latent features with the trust features is to obtain two final latent vectors to create a model that can capture the best aspects of the trust-related and general hidden features. As the latent vectors can be combined in several ways, we tested the following three combination methods:  
1. Subtract trust In this method, the two final trust latent vectors are derived by deducting the trust latent vectors from \(p_{u}\) and \(q_{i}\) as follows: \[pu_{final} = p_{u}-tp_{u},\] (12) \[q_{final} = q_{i}-\ tq_{i},\] (13) where \(pu_{final}\) and \(q_{final}\) are the final user and item latent vectors, respectively. Intuitively, this operation can be viewed as adding the trust as a type of bias to the latent features. The same results can be achieved even if the trust vectors are concatenated with \(p_{u}\) and \(q_{i}\). However, this operation would change the length of the final vectors, and therefore, the dimensions of the vectors in the prediction formula must be adjusted accordingly. 2. Weight by trust In this method, weight latent preference vectors are determined with the latent trust vector as follows: \[pu_{final} = p_{u}\times\ tp_{u};\] (14) \[q_{final} = q_{i}\times\ tq_{i}.\] (15) Similar to the method of adding the vectors, this method does not change the length of the final vectors. 3. Add mean trust Unlike the previous two methods, in this method, the length of the two final vectors are different. Therefore, the user-implicit feedback vector in the final prediction needs to be padded with a zero. The final two latent vectors are derived as follows: \[pu_{final} = concat(p_{u}+\ mean(tp_{u}))\] (16) \[q_{final} = concat(q_{i}+mean(tq_{i}))\] (17)For the three above-mentioned methods, the final predictions can be made using the following equation:  
\[\widehat{r_{u,i}}=\mu+b_{u}+b_{i}+qi_{final}^{T}\left(pu_{final}+|l_{u}|^{-\frac{ 1}{2}}\sum_{j\in l_{u}}y_{j}\right)\]  
where \(qi_{final}^{T}\) and \(pu_{final}\) are the combined trust and latent vectors of the items and users, respectively. The remaining parameters are the same as those in the SVD++, as defined in Equation (3). The concept behind the combination of the trust and feature matrices is that each entry in the approximated matrix also accounts for the trust degree. It is trivial to use the same algorithm with different inputs (i.e., trust for trust features and ratings for the item and user features). However, reusing the same algorithm twice increases the computational cost by two times. Since the extraction of the latent features for both the trust model and the SVD model are similar, they can be combined into one, as presented in Algorithm 2, which illustrates the latent vector approximation.