# Recommendation System Using Autoencoders
## 3 Methodology
### Modelling
#### 3.4.1 Autoencoder Overview  
An autoencoder is an unsupervised deep learning method that learns how to effectively compress and encode data, and then reconstructs data from a reduced encoded representation to a representation that is identical to the original input. In another words, an autoencoder is a neural network that applies back-propagation, setting the target values (outputs) to be equal to the inputs [30; 44].  
Hence, an autoencoder is typically a neural network of three layers, as demonstrated in Figure 5.  
The layers that constitute a basic autoencoder are: input layer, hidden layer, and output layer. The input layer and the hidden layer construct an _encoder_. The hidden layer and the output layer construct a _decoder_. Between these two, there is a _code_. Their description is the following:  
* **Encoder** has the function of compressing input information into a different latent space;
* **Code** is a part of the network that represents the compressed input which is fed to the decoder;
* **Decoder** does the reverse work and reconstructs the original information, moving from the latent space to the original information space.  
The encoder encodes the high-dimensional input data \(x=\{x_{1},x_{2},...,x_{n}\}\) into a low dimensional hidden representation \(h=\{h_{1},h_{2},...,h_{m}\}\) by a function \(f\):  
\[h=f(x)=S_{f}(W_{x}+b), \tag{1}\]  
\begin{table}
\begin{tabular}{l c c} \hline \hline  & **ML-1M** & **ML-10M** \\ \hline
**Items** & 3043 & 8940 \\ \hline
**Users** & 6022 & 69,838 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Final number of items and users of datasets MovieLens.  
Figure 5: Typical structure of an autoencoder.  
where \(S_{f}\) is an activation function, \(n\) is the number of neurons in the input layer, and \(m\) is the number of neurons in the hidden layer. The encoder is parameterized by a \(m\times n\) weight matrix \(W\) and a bias vector \(b\in R^{m}\)[27, 44].  
Then, the decoder maps the hidden representation \(h\) back to a reconstruction \(x^{\prime}=\{x^{\prime}_{1},x^{\prime}_{2},...,x^{\prime}_{n}\}\) by a function \(g\):  
\[x^{\prime}=g(h)=S_{g}(W^{\prime}_{h}+b^{\prime}), \tag{2}\]  
where \(S_{g}\) represents the decoder's activation function. The decoder's parameters are comprised of a bias vector \(b^{\prime}\in R^{n}\) and a \(n\times m\) weight matrix \(W^{\prime}\)[27, 44].  
The purpose of an autoencoder is to obtain \(d\) dimensional representation of data such that an error measure between \(x\) and \(u(x)=decode(encode(x))\) is minimized [45].  
Autoencoders have been widely used for its outstanding performance in data dimensionality reduction, noise cleaning, feature extraction, and data reconstruction [46].  
Over the years, recommendation systems have been extensively used to deliver personalized suggestions on products and/or services to users. Nonetheless, most recommendation systems still face challenges in dealing with the enormous volume and complexity of the data. In order to address this challenge, as discussed in Section 2, several researchers have dedicated their investigation to improving recommendation systems by integrating deep learning techniques. The scientific literature contains recent studies that demonstrate a high efficiency of autoencoders in information retrieval and recommendation tasks. Hence, constructing a recommendation system based on an autoencoder would improve the accuracy of the recommendations due to a clearer understanding of the needs and characteristics of the users given its ability to learn the non-linear user-item relationship efficiently and to encode complex abstractions into data representations [27].