## 2 Materials and Methods
This work uses the definition:  
\[\text{AP}=\sum_{\text{n}}(\text{R}_{\text{n}}-\text{R}_{\text{n}-1})\text{P}_{ \text{n}} \tag{1}\]  
where \(\text{P}_{\text{n}}\) and \(\text{R}_{\text{n}}\) are the precision and recall at the nth threshold. Calculating the area under the curve does not use linear interpolation of points on the precision-recall curve because it provides an overly optimistic measure of the classifier performance [36; 37]. Another essential aspect when dealing with an imbalanced dataset is appropriately separating the data into folds when using k-fold cross-validation to choose among several models (validation). Using regular k-fold in imbalanced datasets could cause many folds to only have examples of the majority class, negatively affecting the training process. In such cases, it is recommended to use stratified sampling (stratified k-fold) to ensure that the relative class frequencies are (approximately) preserved in each train and validation fold. The variables used to create the wave overtopping prediction models can be classified into meteorological conditions (weather conditions and sea state) and overtopping characteristics (location, number of events, and size). The models use the meteorological conditions as inputs and a binary output that indicates whether an overtopping event will happen. Three dataset variants were created in order to assess which one works better. Two use real historical data for the sea state and weather conditions. The third uses historical data from the Portus forecasting system (the stored predictions instead of real data). The real data present more variation than the predictions, and the model could better capture the relationship between the actual sea state and weather conditions and the overtopping events a priori. The historical data from the forecasting system were used for the third dataset variant because the production system will use the forecast data as input to the models. Thus, training the models on data belonging to the same distribution of the production data could provide better results. For the datasets based on real historical data, the weather conditions and sea state data were gathered using the three measurement systems provided by the port technological infrastructure: a directional wave buoy, a weather station, and a tide gauge. The directional wave buoy is located 1.8 km off the main breakwater of the port (43\({}^{\circ}\)21'00'' N 8\({}^{\circ}\)33'36'' W). This buoy belongs to the Coastal Buoy Network of Puertos del Estado (REDCOS [38]) and has the code 1239 in said network. Due to the sensibility of the buoy data to noise, the system provides its data aggregated in 1 h intervals. This quantisation allows the calculation of some statistical parameters that reflect the sea state while mitigating the noise's effects. The weather station is located on the main port's breakwater. It belongs to the Port Meteorological Stations Network (REMPOR [39]) and provides data aggregated in 10 min intervals. The tide gauge is also placed at the end of the main port's breakwater and belongs to the Coastal Tide Gauges Network of Puertos del Estado (REDMAR [40]), with code 3214 on said network. It provides the data in 1 min intervals. From all the variables these data sources provide, only the ones that were also available in the port's forecast system were chosen to create the first dataset. This work aims to create wave overtopping prediction models that can predict an overtopping event using weather and sea state forecasts as inputs. In order to fulfil this objective, the models' inputs regarding ocean-meteorological variables must be available in the port's forecast system. The second dataset adds the maximum wave height variable to the previous one. This variable is currently unavailable as a forecast, but Portus is currently modifying its forecasting models to include it, so this dataset was created to assess whether the inclusion of this variable will provide better results once this information is available.