## 3 Materials and Methods
### Hyperparameter Optimization  
The optimization of hyperparameters in machine learning models is a process of critical importance, significantly impacting model performance and accuracy. This procedure involves fine-tuning the hyperparameters, which govern the learning algorithm's behavior \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & & & & & & \\ \hline longitude & latitude & altitude & month & weekday & hour \\  & & & **24 h prior meteorological and pollutant variables** & & & \\ \hline \(O_{3}\) & \(NO\) & \(NO_{2}\) & \(NO_{x}\) & Relative humidity (rh) & Temperature (tmp) & Wind direction (wdr) & Wind speed (wsp) \\  & & & & & & \\ \multicolumn{8}{c}{**Solar radiation from EMAs stations 24 h prior**} \\ \hline ECOGUARDAS & TEZONTLE & MOLINODELREY ENCBI & ENCBI & ENCBI & PRESAMADIM \\
**Meteorological variables** & & **Pollutant variables** & & **EMAs Stations** & \\ \hline Mean 00 to03 & Mean 00 to03 & Mean 00 to03 & Mean 04 to07 & Mean 04 to07 & Mean 04 to07 \\ Mean 08 to11 & Mean 08 to11 & Mean 08 to11 & Mean 08 to11 & Mean 08 to11 \\ Mean 12 to15 & Mean 12 to15 & Mean 12 to15 & Mean 12 to15 \\ Mean 16 to19 & Mean 16 to19 & Mean 16 to19 & Mean 16 to19 \\ Mean 20 to23 & Mean 20 to23 & Mean 20 to23 & Mean 20 to23 \\ previous day’s maximum & previous day’s maximum & previous day’s maximum & previous day’s maximum & previous day’s minimum \\ \hline \hline \end{tabular} The feature vector consists of 132 variables.  
\end{table} 
Table 2: Feature vector. and its capability to accurately interpret and learn from underlying data patterns. Optimal hyperparameter settings enhance the model's performance and improve the results obtained. One of the key roles of hyperparameter optimization is to mitigate the risks of overfitting and underfitting, striking a balance where the model is sufficiently complex to elucidate essential data patterns without being excessively tailored to the training data. This balance is crucial in ensuring the model's ability to generalize effectively from training data to new, unseen data. There are different approaches to address this issue, as mentioned by [PERSON] and [PERSON] [19]. In this research, we decided to use GridSearchCV, which has some significant advantages in its implementation but also presents some disadvantages that we need to address. The operational scheme of GridsearchCV is based on the wrapper method proposed by [PERSON] and [PERSON] [20] and is shown in Figure 2.  
GridSearchCV is a systematic approach employed in the field of machine learning for the optimization of model hyperparameters. This method is instrumental in enhancing the performance of a machine learning model by exhaustively searching through a predefined space of hyperparameter values. The fundamental premise of Grid Search is to evaluate and compare the model's performance across different combinations of hyperparameters, thereby identifying the most effective set of parameters. This process of GridSearch involves the following key steps:  
1. Definition of Hyperparameter Space: The first step involves delineating the range or set of values for each hyperparameter under consideration. This set forms a grid of hyperparameter combinations, where each node represents a unique combination. The generation of this grid of options and evaluating all solutions is a task that demands too many resources and is impossible to carry out because many hyperparameters take continuous values. Therefore, it is chosen to define recommended or well-known ranges of values for these hyperparameters, creating a finite space of combinations. 2. Cross-Validation Mechanism: GridSearch is typically coupled with cross-validation to assess the performance of the model for each hyperparameter combination. Cross-validation involves dividing the training dataset into multiple smaller sets or folds. The model is trained on all but one fold (the training set) and validated on the remaining fold (the test set). This process is repeated so that each fold serves as the validation set once, ensuring comprehensive evaluation.