To optimize the XGBoost hyperparameters in our classification models, we use the Optuna library , an advanced open-source optimization tool recognized for its effectiveness in the rigorous and systematic selection of hyperparameters . With Optuna, we perform an exhaustive search for critical parameters such as 'n_estimators', 'max_depth' and 'learning_rate'. The choice of these parameters is crucial as they directly modulate the complexity of the model and its ability to generalize from complex patterns in the data. For example, the 'max_depth' parameter, which defines the maximum depth of the trees, is crucial because an appropriately high value allows the model to capture more subtle and complex details in the data, improving the model's ability to discriminate. However, setting 'max_depth' too high can lead to overfitting, where the model overfits the training data at the expense of generality . Optuna's ability to adjust these parameters iteratively and based on model performance in cross-validation allows us to find an optimal balance that maximizes accuracy and minimizes the risk of overfitting, tuning the model to perform robustly on unseen data.