# Tuning ANN Hyperparameters for Forecasting Drinking Water Demand
## 1 Introduction  
Nowadays the forecasting of water demand is a fundamental task for the proper management of Water Distribution Systems (WDS). The new era of Big Data has made an enormous amount of information available, leading to the development of more precise prediction tools in several fields. At the same time, the increase of water demands from humans and agriculture purposes with the negative effects of climate change on water availability requires sustainable and efficient management of water and energy resources [1, 2, 3]. The scientific community focused on developing new and advanced methodologies to forecast the water consumption in a WDS [4]. In recent years, a plethora of methodologies have been developed for short-term forecasting, e.g., [5, 6]. Early works tackled this topic by using conventional and statistical approaches [7]. For instance, these forecasting techniques include linear regression and time series analysis [8] or the Seasonal AutoRegressive Integrated Moving Average (SARIMA) class of methods [9, 10]. With the growth of computational power from the beginning of this century, many studies started to explore methods that belong to the machine learning field. It was noticed that models based on machine learning have the potential to improve the forecast procedure. It is worth noting that the forecasting of urban water demand is a demanding task due to the stochastic and complex nature of the demand itself [11]. In this frame, machine learning methods appeared a suitable and promising option. In fact, many studies [12, 13] showed how machine learning methods outperform the more classical approaches. Thereafter, the scientific community started to work at the development of new methodologies even more powerful to deal with the complexity of the different water demand time series. For example, [PERSON] et al. [6] proposed a methodology based on a Gated Recurrent Unit (GRU) to predict the water consumption until a time resolution of 15 minutes of two districts in China. The authors made also a comparison with a classic Artificial Neural Network (ANN) model and with a SARIMA one, proving that the GRU model was able to outperform the other 2 in the proposed test cases. Furthermore, [PERSON] et al. [14] proposed a machine learning committee model to combine different techniques to achieve a more robust and performing model. The authors analysed different combinations of techniques as the multilayer perceptron, the support vector machines, the random forest and many others, to show that the resulting committee model was able to outperform single models. Another significant example is given by [PERSON] and [PERSON] [15]. They proposed an ensemble model to predict the consumption of the Southwest of England demonstrating that the performance of the ensemble model overcomes those of single models for both accuracy and reliability. Moreover, they compared different bias correction techniques aimed at the improvement of the model performances. Hence, machine learning can be considered the current state-of-the-art technique in the field of the short-term forecasting of water demand. However, a large part of these methods relies on hyperparameters to achieve high-level performances [16]. For these reasons, it is fundamental to tune properly the hyperparameters of ANN models. Several strategies were developed to find the optimal settings for their machine learning models, which include grid search, random search, Bayesian optimization, gradient-based optimization and evolutionary optimization. One of the widely used technique is the grid search, which consists of a deep evaluation through a specified space of hyperparameters. This method can be computationally slow in case of wide space to explore. However, this method ensures a complete study of the hyperparameters combinations of ANN models due to its excellent explainability. An alternative method is the random search [17], which selects some sets of parameters randomly making the tuning computationally less intensive.