## 2 Materials and Methods
### Feature Engineering and Selection  
The Pearson correlation coefficients were calculated to investigate linear relationships between chlorophyll-a concentration and the other variables (Table 2). All correlation coefficients were lower than 0.5, indicating no strong linear correlation between chlorophyll and any other variable.  
Prediction is a major task of time series data mining, which uses known historical values to estimate future values, and feature selection and engineering is essential and crucial for accurate predictions [32]. To seek improvement, 15 days lagged predictors were generated, totalizing 211 features [33]. The choice of lags was based in a two-week period where all the predictors supposedly influence chlorophyll-a concentration, including chl-a past values, i.e., the lagged target values were used as predictors (t - 1,..., t - n; with t as the current time and n = 15). As there are significant seasonal differences, e.g., summer and winter nutrients uptake, the definition of two weeks seemed reasonable for this work to input information, considering that the machine learning algorithms are data-driven and they are not mechanistic models [34]. Additionally, date features were generated, namely,  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Predictors** & **Code** & **Correlation** \\ \hline year & year & \(-\)0.05 \\ sin (days) & sin (days) & 0.04 \\ cos (days) & cos (days) & \(-\)0.46 \\ Secchi depth & SD & 0.15 \\ Sea Surface Temperature & SST & 0.27 \\ Salinity & Salinity & \(-\)0.22 \\ Silicate & SiO\({}_{4}\) & \(-\)0.31 \\ Phosphate & PO\({}_{4}\) & \(-\)0.29 \\ Nitrate & NO\({}_{3}\) & \(-\)0.09 \\ Sunlight duration & Sunlight & 0.31 \\ NAO index & NAO & 0.06 \\ sin (wind direction) & sin & 0.02 \\ cos (wind direction) & cos & 0.10 \\ Wind Speed & Speed & \(-\)0.20 \\ Zooplankton Abundance & Abundance & 0.22 \\ Chlorophyll-a & Chl & 1.00 \\ \hline \end{tabular}
\end{table}
Table 2: Pearson correlation among predictors and the target chlorophyll-a concentration.  
Figure 2: The train and test partition in chlorophyll-a concentration target (black solid and gray solid lines, respectively), and the HPLC chl-a validation dataset (black dashed). After the split, the testing dataset will remain untouched, to guarantee no leakage of information to the training step. The validation dataset is the independent validation.  
\"year\" and \"day of year\" from 1 to 365 or 366. The cyclic variables \"day of year\" and \"wind direction\" were transformed with  
\[\sin\left[2\pi\left(\text{day of year}\right)/\text{(number of days in year)}\right] \tag{1}\]  
\[\cos\left[2\pi\left(\text{day of year}\right)/\text{(number of days in year)}\right] \tag{2}\]  
\[\sin\left[2\pi\left(\text{wind direction ($\lx@arcdegree$)}\right)/\text{(360)}\right] \tag{3}\]  
\[\cos\left[2\pi\left(\text{wind direction ($\lx@arcdegree$)}\right)/\text{(360)}\right] \tag{4}\]  
to ensure that the last day of a year was understood to be in sequence with the first day of the next year and 0\(\lx@arcdegree\) degree in direction was equal to 360\(\lx@arcdegree\)[35].  
A large number of features in the dataset drastically affects both the training time as well as the accuracy of machine learning models. One means to limit model complexity from multiple variables is to reduce the model by selectively eliminating predictors. Feature selection procedure was conducted applying a combination of Recursive Feature Elimination. We used Scikit-Learn module Recursive Feature Elimination with cross-validation (Scikit-Learn feature.selection RFECV module) and Ridge estimator, to estimate the best number of features balanced with accuracy (Figure 3). After the best number of features were defined with the Ridge cross-validation method, we applied Recursive Feature Elimination (Scikit-Learn feature.selection RFE module) with SVR linear estimator, this way selecting the 17 best parameters to model chl-a in a robust manner (Table 3) [36].