# Tuning ANN Hyperparameters for Forecasting Drinking Water Demand
## 4 Conclusions  
This article presents a novel in-depth study about the tuning of ANN structure, including nodes and layers, in the field of drinking water forecasting. The four state-of-the-art ANN architectures, which are the Feed Forward Neural Network, the Long Short Term Memory the Simple Recurrent Neural Network and the Gated Recurrent Unit, have been investigated on different short prediction horizon ranging from 1 h and 1 week. At this aim, an iterative grid search procedure has been proposed. This investigation comprises 2 time series, 4 forecasting horizon and several combinations of nodes, layers and set of inputs. The final intent is to identify meaningful indications for a proper build-up of ANN models related to water demand time series. Thus, the final remarks about ANN structure tuning for drinking water demand forecasting are summarised in the following points.  
1. Layers and nodes tuning is affected by variability in the results due to the stochastic character of ANN which use randomness in several ways, such as weight initialisation, sample shuffle and k-fold cross-validation. This causes changes in the models' performance which can lead to the misleading model selection with a traditional tuning search. To overcome this limit, an interactive tuning procedure is recommended with the number of iteration defined with a compromise between accuracy and computational intensity.
2. Generally, both the numbers of inputs and the number of layers and nodes grows with the increasing size of the forecasting horizon. However, this study shows that different number of inputs have to be tested in the hyperparameters tuning because a prior selection is not possible among the various significant time series lags. In addition, the structure of the best ANN models changes depending on the forecasting horizons, showing different trends also depending on the ANN architectures.
3. The tuning of LTSM and GRU provide the best performing models with the lowest variability among models. For the tested time series, 2 layers models provide stable and accurate performance for the different horizons. Instead, FFNN and SRNN have good performance for the 1 h horizons but lose accuracy with the extension of the prevision window. FFNN needs more articulated ANN structures for more complex forecasting problems, while SRNN do not shows clear trends.  
Conceptualisation, A.M., A.Z. and M.R.; Data curation, A.M. and A.Z.; Formal analysis, A.M. and A.Z.; Funding acquisition, M.R.; Investigation, A.M. and A.Z.; Methodology, A.M. and A.Z.; Project administration, M.R.; Software, A.Z.; Supervision, M.R.; Validation, A.M. and A.Z.; Visualisation, A.M. and A.Z.; Writing--original draft, A.M. and A.Z.; Writing--review and editing, A.M., A.Z. and M.R. All authors have read and agreed to the published version of the manuscript.  
Figure 11: MAPE per group of models of \(ts_{2}\) time series for each architectures on the 4 forecasting horizons with the set of inputs 2.  
**Funding:** This research has been funded by the Interfaculty Project of the Free University of Bozen-Bolzano: \"TESES-URB (ID 2019)\".  
**Institutional Review Board Statement:** Not applicable.  
**Informed Consent Statement:** Not applicable.  
**Data Availability Statement:** Data are contained within the article.  
**Conflicts of Interest:** The authors declare no conflict of interest.