# A Cross-Platform Personalized Recommender System for Connecting E-Commerce and Social Network
## The Proposed CPRec
### Recommendation Subdivisions
#### 3.3.3 Recommendations Based on Collaborative Filtering Algorithm Using User Profiles  
If the proposed cross-platform recommender system starts to work by recommending different commodities to different users, a user-commodity-feedback score matrix will be obtained. We apply the collaborative filtering (CF) method to produce the predicted likeness score of a given item for a given user with the help of the user-commodity-feedback score matrix. As for CF, it is the most successful recommendation technique to date. The basic idea of CF-based algorithms is to provide item recommendations or predictions based on the opinions of other like-minded users, and CF characterizes consumers and products implicitly by their previous interactions. Considering that we have user interest profiles, we want to improve the traditional collaborative filtering algorithm by combining it with the similarity of user profiles between users. Suppose that we have a list of m users \(U=\{u_{1},u_{2},u_{3},\ldots,u_{m}\}\) and a list of \(n\) commodities \(\mathcal{C}=\{c_{1},c_{2},c_{3},\ldots,c_{n}\}\). The user-commodity-score matrix is denoted as \(R_{m\times n}\). \[\mathrm{R}= \begin{bmatrix}R_{1,1}&\cdots&R_{1,n}\\ \vdots&\ddots&\vdots\\ R_{m,1}&\cdots&R_{m\times n}\end{bmatrix}  \tag{10}\]  
where \(R_{i,j}(1\leq i\leq m,1\leq j\leq n)\) represents the feedback score that user \(i\) gives to commodity \(j\). \(R_{m\times n}\) will always be a sparse matrix while the recommendation method aims to predict the unknown score in \(R_{m\times n}\). Measuring the similarity between users is quite important in CF. There are three popular methods of measurement used in CF, which are Cosine Similarity, Pearson Correlation Coefficient Similarity and Modified Cosine Similarity. In our paper, Pearson Correlation Coefficient Similarity has been used. The formula is shown below. \[\mathrm{sim}(u_{a},u_{b})=\frac{\sum_{i_{k}\in\mathcal{C}_{a}\cap\ \mathcal{C}_{b}}\big{(}R_{a,k}-\overline{R}_{a}\big{)}\times\big{(}R_{b,k}- \overline{R}_{b}\big{)}}{\sqrt{\sum_{\mathcal{C}_{c}\in\mathcal{C}_{a}\cap \mathcal{C}_{b}}\big{(}R_{a,k}-\overline{R}_{a}\big{)}^{2}}\sqrt{\sum_{ \mathcal{C}_{c}\in\mathcal{C}_{a}\cap\ \mathcal{C}_{b}}\big{(}R_{b,k}-\overline{R}_{b}\big{)}^{2}}} \tag{11}\]  
where \(\mathrm{sim}(u_{a},u_{b})\in(0,1)\) denotes the similarity of user \(a\) and user \(b\). \(R_{a,k}\) and \(R_{b,k}\) denote the scores that \(u_{a}\) and \(u_{b}\) give to commodity \(c_{k}\). \(\overline{R}_{a}\) and \(\overline{R}_{b}\) are the average score that \(u_{a}\) and \(u_{b}\) give to commodities. \(\mathcal{C}_{a}\cap\ \mathcal{C}_{b}\) denotes the set of commodities to which have both given a score \(u_{a}\) and \(u_{b}\). \(P_{a,j}\) indicates the predicted score that \(u_{a}\) gives to \(c_{j}\), which means that \(u_{a}\) has never given a score to \(c_{j}\). Firstly, we need the set \(S\) of users who have given scores to \(c_{j}\). Then \begin{table}
\begin{tabular}{c c} \hline \hline
**User Action** & **Emotion** \\ \hline Click recommended item, browse it and buy it finally. & Very high positive \\ \hline Click recommended item, browse it but do not buy it. & Moderate positive \\ \hline Do not click recommended item. & Negative \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Different action and different emotion. we calculate the similarity between \(u_{a}\) and every user in \(S\), choose \(k\) users with the greatest similarity as the set of neighbor users \(S(u_{a})\) and calculate \(P_{a,j}\) by  
\[P_{a,j}=\overline{R}_{a}+\frac{\sum_{u_{b}\in S(u_{a})}(R_{b,k}-\overline{R}_{b} )\times\sin(u_{a},u_{b})}{\sum_{u_{b}\in S(u_{a})}\sin(u_{a},u_{b})} \tag{12}\]  
Considering that each user has his or her own profiles, we make some improvements to the similarity formula and propose a collaborative filtering algorithm based on the user profiles (CFUP). \(u_{a}\) and \(u_{b}\) have n profiles \(A_{u_{a}}=(a_{u_{a},1},a_{u_{a},2},\ldots,a_{u_{a},n})\) and \(A_{u_{b}}=\left(a_{u_{b},1},a_{u_{b},2},\ldots,a_{u_{b},n}\right)\).