## 2 Materials and Methods
### Methods
#### 2.3.5 XGBoost Hyperparameter Tuning  
XGBoost is a powerful algorithm; however, this power can be increased if its main hyperparameters are properly tuned to generate an optimized model. It is important to mention that XGBoost usually works well with the default hyperparameter settings, although this is not always true, as on occasion, random forests has outperformed XGBoost [35]. Hyperparameters are parameters that are set before the execution of the algorithm and in the case of XGBoost it is possible to configure the traditional ones based on boosting and trees, together with hyperparameters specific to the algorithm in question, whose function is mainly to reduce overfitting, thus achieving lower variability of predictions and therefore greater accuracy [32]. A simple way to tune XGBoost hyperparameters is with the trial-and-error method, used in the previous research stage [7] and chosen for its ease of implementation as a pilot test to verify the results that would be initially obtained with this test. However, in addition to this strategy whose limitation is being too general, it is also possible to implement hyperparameter optimization algorithms such as Bayesian Optimization (BO), Particle Swarm Optimization (PSO), Hyperband Optimization (HO) and Shapley Additive Explanations (SHAP), which are described in detail in [PERSON] et al. [29] and could be implemented in future research in the proposed area. In this study, we continued with the trial-and-error method for tuning, considering additional hyperparameters to those implemented previously [7], in which the essential hyperparameters for the execution of the algorithm were considered, namely: nrounds, max_depth, colsample_bytree and subsample. Three hyperparameters were added in this study: eta, gamma and min_child_weight. The values set for tuning, together with their definitions, taken from [PERSON] [24], are described in Table 3.  
The above values were determined based on those implemented in the previous stage of this research and on the acceptable ranges for each hyperparameter, as defined in the official documentation of the algorithm (DMLC XGBoost Documentation. Available online: [[https://xgboost.readthedocs.io/en/stable/parameter.html](https://xgboost.readthedocs.io/en/stable/parameter.html)]([https://xgboost.readthedocs.io/en/stable/parameter.html](https://xgboost.readthedocs.io/en/stable/parameter.html)) (accessed on 23 August 2024)). It is important to mention that in general, boosting algorithms have many parameters that \begin{table}
\begin{tabular}{c c c} \hline \hline
**Hyperparameter** & **Definition** & **Values** \\ \hline \hline nrounds & Number of trees built sequentially in the model & (80, 300) \\ max\_depth & Maximum depth levels at which each tree can grow & (1, 9) \\ eta & Learning rate: the contribution of each tree to the final result & (0.01, 0.5) \\ gamma & Minimum amount of division by which a node must improve predictions & (1, 8) \\ colsample\_bytree & Ratio of predictor variables sampled for each tree & (0.01, 1) \\ min\_child\_weight & Minimum degree of impurity required in a node before splitting it & (1, 10) \\ subsample & Proportion of cases to be randomly sampled for each tree. & (0.1, 1) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Hyperparameter settings of XGBoost model to determine the best values. are difficult to implement and the more they are considered, the more complex the algorithm will be. For this reason, only those considered to be the main ones were chosen [29]. The range of nrounds is [1, \(\infty\)]. This parameter does not have a default value; although it is recommended to be 100 or close to it, it depends on the computational characteristics available. The range of max_depth is [0, \(\infty\)]. Although it does not have a standard value, the higher its value, the more complex the model will be and the greater the probability of overfitting. The range of eta is [0, 1] and does not have a standard value; however, the lower this value is, the slower the computation process will be.