# New Vector-Space Embeddings for Recommender Systems
## 3 Proposed Approach
### General Approach  
Each user is represented by a vector, and each item is represented by a vector in the same space (i.e., they have the same dimension). Let \(x_{i}\) denote such vector representation. Assume \(\|x_{i}\|=1\),that is, the vectors lie on the unit sphere. In addition to the sentiment polarity issue, this assumption represents a normalization operation for the vectors, and therefore prevents run-away similarity or distance computations. The distance between any two vectors \(\|x_{i}-x_{u}\|^{2}=\|x_{i}\|^{2}+\|x_{u}\|^{2}-2x_{i}^{T}x_{u}=2-2x_{i}^{T}x_ {u}\) is therefore negatively proportional to their dot product. Rather than using distance as dissimilarity measure, as in many word embedding methods, we use the dot product as a similarity measure. The proposed vector embedding algorithm is supervised in nature, unlike many of the other word embedding methods that are unsupervised or semi-supervised. The algorithm seeks to determine the vectors pertaining to the users and items such that they satisfy given similarity numbers. Thus, it optimizes the locations of the \(x_{i}\)s such that the achieved similarity \(x_{i}^{T}x_{u}\) is as close as possible to the target similarity score \(s_{ui}\). Towards this end, we define the following optimization problem:  
\[E=\sum_{u}\sum_{i}w_{ui}\Big{[}x_{u}^{T}x_{i}-s_{ui}\Big{]}^{2}\] \[\text{subject to}||x||=1,\forall u,\ i, \tag{1}\]  
where \(w_{ui}\) is a weighing coefficient that could potentially put a different emphasis on different terms. There are a number of different versions and similarity terms that could be utilized. A general form that takes into account different possible similarity measures is the following:  
\[E=\sum_{u=1}^{U}\sum_{u^{\prime}=1}^{U}w_{1}\Big{[}x_{u}^{T}x_{u^ {\prime}}-v_{uu^{\prime}}\Big{]}^{2}\] \[\qquad+\sum_{u=1}^{U}\sum_{i=1}^{N}w_{2}\Big{[}x_{u}^{T}x_{i}-r_{ ui}\Big{]}^{2}\] \[\qquad+\sum_{i=1}^{N}\sum_{i^{\prime}=1}^{N}w_{3}\Big{[}x_{i}^{T }x_{i^{\prime}}-o_{ii^{\prime}}\Big{]}^{2}\] \[\text{subject to}||x||=1,\forall u,\ u^{\prime},i,\ i^{\prime}. \tag{2}\]  
We explain this general formulation as follows. Let \(x_{u}\) and \(x_{u^{\prime}}\) be vectors pertaining to the users and let \(x_{i}\) and \(x_{i^{\prime}}\) be vectors pertaining to the items. The first term corresponds to user-user similarity, where the dot product \(x_{u}^{T}x_{u^{\prime}}\) is the computed similarity of the vectors representing user \(u\) and user \(u^{\prime}\), and \(v_{uu^{\prime}}\) is the target similarity to be learned. This term can be used to model the following:  
* Demographic similarities: For example users who have similar demographic features, such as age, gender, country, profession, and so forth, will have assigned target similarities \(v_{uu^{\prime}}\) some number close to 1, while users with only a fraction of the demographic features will have a low target similarity;
* Community-based: Users who are in similar social networks, such as being friends, will have a high target similarity, otherwise it is low;
* Purchase pattern similarities: The target similarity \(v_{uu^{\prime}}\) can be proportional to the amount of items in common in both users' purchasing patterns. The second term corresponds to user-item similarity, where the dot product \(x_{u}^{T}x_{i}\) is the predicted similarity of user \(u\) and item \(i\), and \(r_{ui}\) is the target similarity to be learned. This term can be used to model the following:  
* Rating similarities: For example, the user \(u\) gives a rating for an item \(i\) and this rating would be set as the target similarity \(r_{ui}\). (A high rating will produce a large similarity and vice versa.) This way, we can predict how any user would rate an item, by simply computing the similarity as the dot product after training is complete. This is what we call \"Prediction\";
* Purchase pattern based: The target similarity \(r_{ui}\) can be proportional to the amount of times the user \(u\) purchased this item \(i\) in previous purchases.