# Deep Learning and Embedding Based Latent Factor Model for Collaborative Recommender Systems
## 4 The Proposed Model
### Latent Factor Model  
The latent factor (LF) model is one of the variants of the CF-based approach that is responsible for capturing users' and items' latent vectors from high-dimensional data. The method uses the inner product to determine the interactions [28]. In our proposed model, we follow the procedure of the LF model to predict the ratings for the sake of overcoming the sparsity problem. In most traditional LF models, they follow the concepts used in SVD as an overall rating prediction. However, here we used the factors as input to the method. According to Ref. [29], the missing values are first filled by taking the average values of the existing ratings, and the latent factors are obtained using SVD techniques. In contrast to this method, we learned the missed values from existing ratings by minimizing the loss function in Equation (8). In addition, Ref. [29] has multiple user latent feature matrix and one-item latent matrix, which increase computational complexity. In this regard, the proposed method has only one user latent factor matrix \(P\) and one item latent factor matrix \(Q\) that are used as feature input vectors for the DNN architectures. The architecture of our proposed scheme, DELCR, is shown in, Figure 1. The details of the proposed method are discussed layer by layer as follows:  
**Input Layer**: The input layer of our model takes explicit feature vectors obtained from past user interactions for items called \"historical interactions\". The rating could be taken as it is since it shows the level of a user's liking for a given item. In this step, we used only known user ratings to determine the dense user and item latent factors as a feature. The proposed method follows the procedure shown in [30]. In their work, they embed user ID to obtain a dense continuous-valued vector. However, in our case, we embed user ratingvalues to obtain the embedding vectors. Here, we initialized the latent factors with random values during the model training to adjust the values. **Embedding layer**: The embedding layer of DELCR projects each high-dimensional input feature vector and sparse data matrix into two dense low-rank matrices. To obtain the user \(u\) and item \(v\) primitive feature vectors in the embedding space, perform the following steps: Let \(P\in\mathbb{R}^{m\times k}\) represent the user embedding matrix and \(Q\in\mathbb{R}^{n\times k}\) represent the item embedding matrix, where \(k\) represents the embedding dimension. The user latent vector \(p_{i}\) and the item latent vector \(q_{j}\) are then computed using Equations (6) and (7), respectively [31]. \[p_{i}=P^{T}u_{i}. \tag{6}\]  
\[q_{j}=Q^{T}v_{j}. \tag{7}\]  
To demonstrate the concepts discussed above, the method first decomposes the rating matrix \(R\) into two low-rank matrices, \(P\) (the user latent matrix) and \(Q\) (the item latent matrix), that satisfy \(R\approx PQ^{T}\). To find the matrices, we used the embedding loss function  
Figure 1: General scheme of the proposed model. The architecture consists of an embedding layer with a dense vector obtained from the input matrix, followed by deep neural network layers. In the output layer, the method generates the latent factors that are used for rating prediction in the prediction layer. (\(L_{EM}\)) using Equation (8) to minimize the difference between the true and approximate values [32]. \[L_{EM}=\min_{P,Q}\left[\sum_{(i,j)\in R_{known}}(r_{ij}-p_{i}q_{j}^{T})^{2}\right]. \tag{8}\]  
**A Dual deep learning layer**: To capture the data's non-linear phenomena and intrinsic abstraction, we map embedded user latent \(p_{i}\) and item latent \(q_{j}\) into the dual deep learning structures independently. This can be illustrated as follows:  
After obtaining the dense feature vectors via the embedding equation, we trained the deep neural network to minimize the loss function (\(L_{DL}\)).