## 2 Materials and Methods
The following are all the meteorological variables available to use as input variables to the models:  
* HS (m): the significant wave height, i.e., the mean of the highest third of the waves in a time series representing a specific sea state. * Hmax (m): the maximum wave height, i.e., the height of the highest wave in a time series representing a specific sea state. This variable is used only in the second dataset and is not available as forecast. * TP (s): the peak wave period, i.e., the period of the waves with the highest energy, extracted from the spectral analysis of the wave energy. * \(\theta\)m (deg): the mean wave direction, i.e., the mean of all the individual wave directions in a time series representing a specific sea state. * WS (km/h): the mean wind speed. * Wd (deg): the mean wind direction. * H0 (m): the sea level with respect to the zero of the port. * H0 state: a calculated variable created to indicate whether the tide is rising, high or low, or falling (1, 0, -1). * H0 min (m): the minimum sea level with respect to the zero of the port achieved during the current tide. * H0 max (m): the maximum sea level with respect to the zero of the port achieved during the current tide. In the datasets based on real historical data for the sea state and weather conditions, the buoy provides H\({}_{\text{S}}\), T\({}_{\text{P}}\), and \(\theta_{\text{m}}\), the weather station provides W\({}_{\text{s}}\) and W\({}_{\text{d}}\), and the tide gauge provides H\({}_{\text{0}}\) and H\({}_{\text{max}}\). The rest of the variables are calculated from the raw data. The Portus system provides all the data for the dataset based on historical forecasted data. The three datasets use whether an overtopping event occurred or not as the model's output. During the field campaigns for collecting overtopping data, the buoy and tide gauge in the outer port malfunctioned several times due to storms and other phenomena. Due to this, there are many overtopping events for which there are no associated real meteorological and sea state conditions, only the historical predicted data. Hence, the dataset based on predicted conditions has more examples than the ones based on real conditions (as shown in Table 1). \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Dataset**} & \multicolumn{2}{c}{**Training (h)**} & \multicolumn{2}{c}{**Testing (h)**} \\ \cline{2-5}  & **Overtopping** & **No Overtopping** & **Overtopping** & **No Overtopping** \\ \hline Real data without hmax & 6656 & 87 & 2219 & 27 \\ Real data with hmax & 6656 & 87 & 2219 & 27 \\ Predicted data & 11,131 & 168 & 3710 & 55 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Wave overtopping datasets: available data for each dataset (real and predicted data) and purpose (training or testing). Creating the datasets based on real data involved joining the data provided by the available data sources (buoy, weather station, and tide gauge). These data sources use different data sampling frequencies, so all the data had to be aggregated to have the same frequency as the frequency of the data with the largest period, the sea state data. These data have a period of 1 h, the same as the forecast systems predictions (the data that will be used as the models' inputs in production). The overtopping events had to be aggregated accordingly. For this, the number of events and their magnitudes were aggregated for every hour, and the output label was set to one if one or more overtopping events happened during the hour and zero otherwise. After merging, the data were preprocessed to improve the models' performance. Since \(\theta_{\text{m}}\) and \(W_{\text{d}}\) are directional variables in the 0-360 degrees range; 0 and 360 represent the same direction. Using this codification for the directional variables would cause the Machine Learning models to create different internal representations for the same state and could negatively impact the models' performance.