# Review Rating Prediction Based on User Context and Product Context
## 3 RRP Based on User Context and Product Context
### RRP Method Based on Review Content and User Context  
The review content is the most important source of information for RRP. The existing RRP methods that are based on review content mainly use a vector space model to represent the review content, and then implement RRP through a linear regression model. Specifically, user \(u\) has posted a review \(\mathbf{r}_{ui}\) on the item \(i\). The existing RRP function based on the review content is as followed:  
\[\vartheta_{ui}=\mathbf{w}^{T}\mathbf{r}_{ui} \tag{1}\]  
Here, \(\vartheta_{ui}\) is the predicted rating of user \(u\) for item \(i\); \(\mathbf{w}\) is the parameters of the function; and, \(\mathbf{r}_{ui}\) is the vector representation of review content. Due to the differences in sentiment expression of different users in online social media, the general RRP model built for all users cannot accurately understand the special sentiment expression of each user. It is the most intuitive method to design a personalized RRP method for each user by using the personal review content published by each user in the online social media. However, in online social media, the personal review data published by a single user is usually very limited. Therefore, based on the personal review data alone, it is impossible to accurately train a RRP model for each user. Psychology and sociology studies have shown that, although online users express their sentiments in a personalized way, different online users share many of the same sentiment expressions [35]. For example, \"happy\" and \"good\" are often used to express the positive sentiment among different users. Therefore, making full use of the shared sentiment information between different users can help to solve the problem of insufficient data for a single user. Based on the above analysis, we propose a RRP model that is based on the review content and user context. In order to model the sentiment commonality of different users and sentiment personality of individual user, the RRP model is decomposed into two components, a common one and a user-specific one. The common part is shared by all users to characterize the sentiment information shared by different users and to use all user data for training. The user-specific part is unique to each user and it is used to characterize each user's specific sentiment expression and to use a single user's data for learning. Specifically, user \(u\) has posted a review \(\mathbf{r}_{ui}\) on the item \(i\). The RRP model based on the review content and user context is as followed:  
\[\vartheta_{ui}=\left(\mathbf{w}+\mathbf{w}_{u}\right)^{T}\mathbf{r}_{ui} \tag{2}\]  
Here, \(\vartheta_{ui}\) is the predicted rating of user \(u\) for item \(i\); \(\mathbf{w}\) and \(\mathbf{w}_{u}\) are the common and user-specific parameters in RRP model; and, \(\mathbf{r}_{ui}\) is the vector representation of review content. To calculate the parameter vector \(\mathbf{w}\) and \(\mathbf{w}_{u}\), given the training data set and, we use the least squares error loss principle to minimize the objective function in training data set. \[\underset{\mathbf{w},\mathbf{w}_{u}}{\text{min}}\underset{\text{trainsets}}{ \sum}\left(v_{ui}-\left(\mathbf{w}+\mathbf{w}_{u}\right)^{T}\mathbf{r}_{ui} \right)^{2}+\lambda\Big{(}\|\mathbf{w}\|^{2}+\|\mathbf{w}_{u}\|^{2}\Big{)} \tag{3}\]  
Here, \(\lambda\) is the regular coefficient, \(|\,|\,|\,|\,|\,\) and \(\,|\,|\,|\,\mathbf{w}_{u}\,|\,|\,\) are the regular term of the parameter vector \(\mathbf{w}\) and \(\mathbf{w}_{u}\). To estimate the parameter vector \(\mathbf{w}\) and \(\mathbf{w}_{u}\), we use a stochastic gradient descent algorithm to solve this optimization problem. We use the following update rules to learn the parameters \(\mathbf{w}\) and \(\,\mathbf{w}_{u}\).