## 2 Materials and Methods
This potential problem was avoided using the sine and cosine for each value, so the 0 and 360 directions are close together (sin and cosine vary continuously from 0 to 360). In the final datasets, the positive examples of overtopping events represent around 1.2% of the total from the two real-data datasets and around 1.5% of the dataset based on predictions. These figures situate these datasets on the lower bound for moderate imbalance datasets, making them almost extremely imbalanced. Due to this, we used the appropriate metrics that consider the data imbalance, as previously explained. Once merged, aggregated, and preprocessed, the data sources were separated into the corresponding training and testing datasets, used to train and test the different models. The test dataset is usually created by randomly choosing data from the whole dataset. However, having imbalanced datasets would cause the test results to be inaccurate, and the models could be trained with just negative examples, potentially giving the models excellent and unrealistic training results. To avoid these problems, the test sets were created so that they contain a proportion of positive overtopping instances similar to the corresponding training dataset; in each dataset, the testing dataset is around 1/3 of the whole dataset, and the proportions of positive and negative examples are similar among the training and testing datasets, as shown in Table 1.  
Hundreds of models based on artificial neural networks were created, trained with the three datasets previously explained, and compared to check which model and dataset combination provided the best results. The models are based on artificial neural networks (ANNs) [41], given the good results this Machine Learning model can achieve for classification problems. Given that these models require choosing multiple hyperparameters (number of layers, nodes per layer, and training parameters, among others explained later), we used an iterative approach to choose the best hyperparameters while reducing the time required to obtain them:  
1. First, several allowed values for each hyperparameter are manually specified, and a hyperparameter grid is created (the outer product of all hyperparameters' values, i.e., all possible combinations). 2. Then, as many individual models as combinations in the grid are created, trained, and compared using cross-validation. 3. The results are analysed, focusing on the grid regions where the best results were obtained to create a new grid to contain that region. 4. Steps 2-3 are repeated several times for each dataset until a satisfactory cross-validation performance is obtained. The hyperparameters and all the values tested with this approach are the following:  
* Network architecture: We tested networks with 1, 2, 3, and 4 layers. They were also tested with 8, 16, 32, 64, 128, and 256 neurons per layer in each case, allowing each layer to use a different number of neurons. All ANNS used fully connected layers. Although the largest networks could seem too complex for the overtopping prediction problem, they were included to use dropout regularisation. Dropout will likely obtain a better performance on a larger network (it will prune the network, resulting in a smaller one). * Weights (kernel) initialisation: Several weights initialisations were used, both the uniform and the normal variations, for random, He [42] and Glorot (also known as Xavier) [43] initialisations. * Optimiser: The Adam [44] optimiser was used. * Training iterations: The optimiser was tested with 500, 1000, 1500, 2000, and 5000 iterations. In the initial tests, the results did not improve from 2500 iterations up, so the 5000 values were discarded for the subsequent iterations of the hyperparameters search approach. * Activation function: All the ANNs used the ReLU activation function for the neurons in the hidden layers and the sigmoid function for the output layer.