## 2 Materials and Methods  
The wave overtopping events data were collected in six field campaigns in the outer port of Punta Langosteira (A Coruna) from 2015 until 2020. During these campaigns, 3098 individual overtopping events were identified. The overtopping events data were integrated with data about the environmental conditions (weather conditions and sea state) the port was subject to during the overtopping events to assemble the datasets used to create several Machine Learning overtopping prediction models. In the production of their predictions, the models will use the weather conditions and sea state forecasts provided by the Portus platform of the Spanish ports system [31] as inputs and output the probability of an overtopping event for a given input. The Portus system forecasts the weather and sea state for 72 h. Several variables characterise the sea state, and the sea state forecast is provided as a single hourly data point for that set of variables, i.e., Portus provides a single hourly value for the variables that describe the sea state for the following 72 sea states. The models created in this work use a single time value of the meteorological conditions and the sea state (the single value for a specific hour, not a time window) as inputs and indicate, as output, whether or not there will be an overtopping event with these conditions. Thus, given that we have a 72 h weather state and sea conditions forecast, we can predict overtopping events for each of the next 72 h.  
The overtopping prediction is a classification problem: a model predicts a positive event (overtopping) if the model output exceeds the decision threshold and a negative one (no overtopping) if not. Besides creating the models, the decision threshold must be studied to evaluate how its value impacts the tradeoff between security and economic cost: a low decision threshold would capture many overtopping events, providing more security, but would have many false positives incurring in higher costs due to stopping port operations, while having a higher decision threshold would capture less overtopping events but with more certainty (less false positives), providing less security, but incurring lower operational costs due to stopping port operations only with a higher certainty of an overtopping event. In a classification problem, the model's accuracy is usually used as the metric to evaluate its performance, but this is not the best approach if the data are not balanced (when there are several times more samples from one target class (majority class) than from the other (minority class)). There are several more appropriate metrics (than the accuracy) when dealing with unbalanced datasets that mainly rely on precision and recall, such as the F\({}_{1}\) score (theharmonic mean of the precision and recall) or the more general F-measure is the weighted harmonic mean of the precision and recall. No consensus exists on which prevalence values make a dataset imbalanced. In this work, we consider the ranges defined in [32] that indicate the degree of imbalance of a dataset given the percentage of examples belonging to the minority class on the dataset: 20-40% mild, 1-20% moderate, and \(<\)1% extreme imbalance. In order to study how a classifier will behave when changing the decision threshold, more advanced metrics, such as the ROC curve and the associated AUROC [33; 34], can be used. However, these metrics are inappropriate when working with imbalanced datasets [35]. In this case, it is better to use the precision-recall curve, which computes a curve from the raw classifier output by varying the decision threshold and calculating the precision and recall at every threshold value. The area under the precision-recall curve can be estimated using the average precision (AP, with values between 0 and 1; the higher, the better). There are multiple ways of calculating the AP.