# A Two-Phase Deep Learning-Based Recommender System: Enhanced by a Data Quality Inspector
## 3 Materials and Methods
### Deep Learning-Based Product Recommender  
Three inputs are used to generate an accurate product recommendation: (a) user identification, (b) item identification, and (c) \(r^{pref}\), which is an integer value between 1 and 5 derived by Equation (3). Formally, let \(\mathbf{u}_{j}\) be the user ID vector of record \(j\), \(\mathbf{i}_{j}\) be the item ID vector of record \(j\), and \(r_{j}^{pref}\) be the preference rating of record \(j\). The vectors \(\mathbf{u}_{j}\) and \(\mathbf{i}_{j}\) are then projected to a dense vector space as real-value vectors \(\mathbf{p}_{\mathbf{u}_{j}}\) and \(\mathbf{q}_{\mathbf{i}_{j}}\), respectively, through an embedding layer. The interaction between the characteristics of \(u\) and \(i\) is then  
Figure 4: Visualization guide regarding the process, and terminology used, to create a quality inspector model. modeled and captured by an interaction function. This is the input for the deep neural network. The deep learning-based rating predictor of a product recommender can then be modeled as follow:  
\[p_{j}^{pref}=\phi_{out}\Big{(}\phi_{x}\Big{(}\ldots\phi_{2}\Big{(}\phi_{1}\Big{(} \phi_{int}\Big{(}\phi_{embedding}\big{(}\mathbf{u}_{j},\ \mathbf{i}_{j}\big{)}\big{)}\Big{)}\Big{)}\ldots\Big{)}\Big{)} \tag{5}\]  
where \(\mathbf{i}_{j}^{pref}\) is the predicted preference rating, \(\phi_{embedding}\) is the embedding mapping function, \(\phi_{int}\) is the mapping function to model the interaction between a user and an item, \(\phi_{x}\) is the mapping function for the MLP \(x\)-th layer, and \(\phi_{out}\) is the mapping function for the MLP output layer. The rating predictor of a recommender also utilizes for training, a backpropagation supervised learning technique, where it tries to minimize the pointwise loss between the predicted preference rating \(\mathbf{p}_{j}^{pref}\) and its target \(\mathbf{r}_{j}^{pref}\). Figure 5 shows the framework of the proposed deep learning-based product recommender. Lastly, to recommend a product \(i\) to a user \(u\), two criteria must be fulfilled: (a) the predicted preference rating \(\mathbf{p}_{j}^{pref}\) must be equal or higher than 4, and (b) the user \(u\) must have not rated product \(i\) before. Only if these two conditions are satisfied, product \(i\) is recommended to user \(u\). Two deep learning-based recommender models are applied in this study: (1) NNMF, and (2) DLbR. * Model 1: Neural Network Matrix Factorization  
Neural Network Matrix Factorization (NNMF) is an adapted version of the neural collaborative filtering-based recommender model [21]. The model is composed of a Generalized Matrix Factorization (GMF) component, and a Multi-Layer Perceptron (MLP) module, unifying linearity strength with non-linearity characteristics. Therefore, it was selected as the base, and slightly modified, to create the first deep-learning recommender. The following are the performed tweaks done to the NNMF model: (a) the explicit ratings were directly used as the inputs, instead of converting them to implicit information, (b) the model addresses a 5 label, instead of a binary, classification problem, (c) it uses a categorical, instead of a binary, cross-entropy loss function, (d) it utilizes softmax, instead of sigmoid, as the activation function of the output layer, and (e) it realizes a direct training with random weight initializations of the global model, instead of previously pre-train the two components separately. Figure 6 summarizes the architecture of the recommender. As a collaborative filtering approach, the inputs for the two components are just basic information: a user ID and a product ID. Note that each component has its own embedding layer, and thus, a different user latent feature  
* Model 2: Deep Learning-based Recommender  
Deep Learning-based Recommender (DLbR) model is a neural network approach for movie recommenders [56]. It is suggested to take a product ID and a user ID as inputs. Both IDs are just single numbers and are turned into dense vector representations with an embedding layer.