**4. Results and discussion**

There was a considerable amount of missing values all across the data. After applying the MICE algorithm the data full fill. In order to confirm that the imputation was successfully checked that the distribution of the data did not change as is shown in **Figures 5** and **6**. These processes will be repeated for each station. This process was repeated for all the stations which were selected getting similar results in all cases. Once the preprocessing was finished, the training was started and by optimizing the model, a search space was stabilized for each hyperparameter of the RNN-LSTM considered. Now, with the model ready and tested, the results of the optimization process can be seen within the network. As is shown in **Figures 7** and **8**, for the LSTM optimized by GP, the loss function during training decreases rapidly in each epoch until it converges and the change between epochs is no longer so noticeable compared with simple LSTM (**Figures 9** and **10**). In both cases when the converges are reached, it means that the network has already stopped learning. Finally, the validation set is used to estimate the skills of the network obtained in its training for the prediction of *PM*2*:*<sup>5</sup> levels. This is shown for the LSTM optimized by GP in **Figures 11** and **12**, and

**Figure 5.** *Data distribution of AJM station before and after being imputed.*

**Figure 6.** *Data distribution of PED station before and after being imputed.*

*Perspective Chapter: Airborne Pollution (PM2.5) Forecasting Using Long Short-Term Memory… DOI: http://dx.doi.org/10.5772/intechopen.108543*

**Figure 7.** *Metrics obtained with LSTM model optimized by Gaussian process for the AJM station.*

**Figure 8.** *Metrics obtained with LSTM model optimized by Gaussian process for the PED station.*

**Figure 9.** *Metrics obtained with simple LSTM model for the AJM station.*

**Figure 10** *Metrics obtained with simple LSTM model for the PED station.*

**Figure 11.** *LSTM optimized by gaussian process, validation forecast for AJM station.*

**Figure 12.** *LSTM optimized by gaussian process, validation forecast for PED station.*

*Perspective Chapter: Airborne Pollution (PM2.5) Forecasting Using Long Short-Term Memory… DOI: http://dx.doi.org/10.5772/intechopen.108543*

**Figure 13.** *Simple LSTM, validation forecast for PED station.*

**Figure 14.** *Simple LSTM, validation forecast for PED station.*

for the simple LSTM the results are shown in **Figures 13** and **14**. The results show are from AJM and PED stations.
