# Tuning ANN Hyperparameters for Forecasting Drinking Water Demand
## 3 Results and Discussion
### Results Analysis and Comparison
#### 3.2.3 Within and between Architectures Comparison  
Hereafter, the tuning results of the \(ts2\) are presented and commented on focusing on how the best performing models change within and between ANN architectures varying  
Figure 8: Models’ performance variability within ANN architectures in \(log_{2}(\sigma(R2))\) of \(ts_{1}\) (solid lines and circle markers) and \(ts_{2}\) (solid lines and square markers) for the 4 forecasting horizons (x-axis) with the set of inputs 2 in (**a**). Numbers of nodes of the best models in (**b**).  
Figure 9: MAPE (%) of the best ANN models on the 4 forecasting horizons (x-axis) with two sets of inputs: \(set1\) (smaller number of lags) and \(set2\) (larger number of lags).  
the prediction horizons. All the models are summarised in Figure 10 through the MAPE of the median models resulting 3 iterations.  
Starting from the FFNN, it is clear that this ANN architecture requires more articulated structures to deal with longer forecasting horizons. In fact, the best model for 1 h horizon has 1 layer; instead it has 2 layers for 6 h and for 24 h, while the best model for 168 h comprises 3 layers. On the other side, except for the simplest problem of 1 h, the worst model results are those with 1 layer meaning that FFNN needs a deep structure to perform on the forecasting problem. Generally, the variability between the models of FFNN is marked, making the layers and nodes a tricky step in ANN modelling and forecasting.  
The LSTM and GRU shows similar results both in terms of overall performance and models trends. The best models are identified in simple ANN structures, independently from the horizons size. It means that 1 and 2 layers are recommended over 3 layer models because of better performance, computational time and parsimony in the selection of the configuration numbers. The variability of these models is low with a slight increase at wider horizons ensuring a lower impact in the case of a wrong selection of best model during the tuning. Generally, the worst models of these two architectures are identified among the complex structures with 3 layers for the 2 time series analysed.  
Regarding the SRNN architectures, the models' performance shows quite significant variability for each prediction horizons. No clear trends are detectable which can indicate high variability of SRNN. This is highlighted by the similarity in structure between the best and worst models per each horizons. Specifically, 1 layer nodes results the best for 1 h horizon, whereas low number of nodes on 3 layers or large number of nodes on 2 layers are the best configurations for the others larger horizons. For this ANN architecture, the worst models are generally for the 2 proposed cases the complex ones consisting of 3 layers and high number of nodes.  
The between models comparison of the different ANN architectures is proposed afterwards with the support of Figure 11, which shows a synthesis of Figure 10 by dividing the models in homogeneous groups. The models are grouped according to the ANN layers and nodes configuration into single-layer models, two-layers and low numbers of nodes up to [48; 48], two-layers and high numbers of nodes from [48; 48] onwards, three-layers and low numbers of nodes up to [48; 48; 48] and three-layers and high numbers of nodes from [48; 48; 48] onwards. The tuning shows the LSTM and GRU best results are obtained with 2 layers and low number of nodes independently of the forecasting horizons. On the other side, FFNN has a significant dependence between number of layers, nodes and horizon size. No clear trend is found for SRNN. On the performance point of view, all the  
Figure 10: MAPE of the models of \(t_{\text{22}}\) time series for each architectures on the 4 forecasting horizons with the set of inputs 2.  
ANN architectures are high performance and low variability over 1 h horizon. The other horizons, which refer to more challenging forecasting problems, highlight that the LSTM and GRU are more accurate than FFNN and SRNN.