# Space-Time Prediction of PM\({}_{2.5}\) Concentrations in Santiago de Chile Using LSTM Networks
## 4 Pre-Processing of Data and Selection of Neural Model
### Training Net Selection
#### 4.3.1 Network Selection  
For the selection of the architecture of the LSTM network, a group of networks with different architectures were generated, where the dropout values varied between 0 and 0.3 with steps of 0.05 and the number of neurons per layer was between 100 and 250 (both included) in multiples of 50, except for the last LSTM layer, for which there were 25, 50, 75, 100, 150, 200 or 250 neurons. The activation functions of the intermediate-layer neurons correspond to hyperbolic tangent functions. Finally, a final time distribution layer was added using a linear activation function. This layer is very important because the input variables are not only directly related to their previous values, but they are also related to the previous observations of the other meteorological stations. The mean square error was used as the objective function, optimizing the cost function with the adaptive moment estimation (Adam) algorithm [50]. We used a greedy strategy for the architecture selection of the neural network to reduce the search space of the structure due to the exponential number of possible configurations. We started by optimizing the first layer and after finding the best configuration according to the 7 neuron values and 6 dropout values. We optimized the network by adding a second layer and fixing the configuration of the first, and we continued until a third layer. In this way, we tested a total of 39 neural network configurations according to the number of neurons and the dropout operator. In this case, we used as the network input data configuration the schema given in Table 4. Eleven meteorological stations were used. The variables temp and PM\({}_{2.5}\) of the last 24 h were used as input, and PM\({}_{2.5}\) forecast 1 h ahead was output. Next, Table 5 provides a summary of the 6 networks with the highest values of \(R^{2}\) of the 39 tested in total. The networks that stand out in terms of \(R^{2}\) in their training set are identified. Finally, although the values of \(R^{2}\) do not suffer variations of more than 2 points, we selected R36 (Table 5) as our candidate because, in addition to having the highest values of \(R^{2}\) in training and validation, we grant the possibility that being a deep network, it can learn a greater number of relationships that exist between the data. \begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline \multirow{2}{*}{\begin{tabular}{c} **E** \\ **(Es-01)** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **N** \\ **(Es-01)** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **PM\({}_{2.5}\)** \\ **(Es-01)** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **PM\({}_{2.5}\)** \\ **(Es-01)** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **E** \\ **(Es-02)** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **N** \\ **(Es-02)** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **PM\({}_{2.5}\)** \\ **(Es-02)** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **PM\({}_{2.5}\)** \\ **(Es-02)** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **...** \\ **(Es-02)** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **...** \\ **(t-0)** \\ \end{tabular} } & \multirow{2}{*}{\begin{tabular}{c} **(Es-02)** \\ **(t-1)** \\ \end{tabular} } & \multirow{2}{*}{\
\begin{tabular}{c} **...** \\ **(t-1)** \\ \end{tabular} } & \multirow{2}{*}{
\begin{tabular}{c} **(Es-01)** \\ \end{tabular} } \\ \hline A & B & \(-1\) & \(\cdots\) & \(-1\) & C & D & \(36.5\) & \(\cdots\) & \(40.2\) & \(\cdots\) & \(36.0\) \\ A & B & \(34.0\) & \(\cdots\) & \(33.0\) & C & D & \(-1\) & \(\cdots\) & \(-1\) & \(\cdots\) & \(22.0\) \\ A & B & \(27.0\) & \(\cdots\) & \(28.6\) & C & D & \(30.2\) & \(\cdots\) & \(36.0\) & \(\cdots\) & \(25.0\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Structure of the data expressed in time series. The columns to predict are indicated using padding with value \(-1\).