## 4 Discussion  
Pulsations observed on geomagnetically quiet days primarily originate from internal processes within the magnetosphere. Most of these waves exhibit lower amplitudes compared to pulsations observed during geomagnetically active days. Figure 2 shows that significant pulsations are observed a few minutes before high-amplitude S4 events are enhanced. It is worth mentioning that the observed Pc5 waves may be a possible excitation mechanism of the ionospheric irregularity. It is interesting to note that both events fall within the frequency range of mHz, which is characteristic of the ULF wave band.  
Figure 5: Regression metric of the out-of-sample testing phase of the models; (**a**) RF model; (**b**) XG-BOST model.  
Geomagnetic activities are good drivers of Pc5 waves, with the Kp index being a preferable parameter for their study. To substantiate the correlation between the Kp index, the Pc5 pulsations, and the S4, a statistical plot, shown in Figure 3, was necessary. The results depict that almost half of the Pc5 events observed at the BJN station may be responsible for driving the observed S4. The events and the Kp index profile were strongly correlated; most occurrences happened in 2012 and fewer in 2016.  
The performance of the ML models constructed in the work was monitored during the training phase on the validation datasets. The results indicate that the RF model demonstrates high training accuracy with an \(R^{2}\) value of 0.94 and an RMSE of 0.005, while the XGBoost has an \(R^{2}\) value of 0.97 with an RMSE of 0.004. The results suggest that both models exhibit good generalization, and the training was consistent with the available data.  
The findings from Figure 5 show how well and precisely the models generalize to predict observed scintillation events. The RF model achieved a prediction accuracy of 0.66 with an RMSE of 0.01, while XGBoost exhibited improved accuracy at 0.74 with the same RMSE. Although both models demonstrated reasonable predictive power, XGBoost outperformed RF in accuracy. A key reason for XGBoost's superior performance is its use of gradient boosting, which iteratively refines predictions by minimizing residual errors from previous trees. This approach allows XGBoost to capture more complex relationships in the data that RF, which relies on bagging and independently generated trees, might overlook.  
Additionally, XGBoost's regularization techniques, such as shrinkage, help prevent overfitting, enabling the model to generalize better to unseen data. While RF also reduces overfitting through its ensemble approach by averaging multiple decision trees, it may not be as effective in capturing deeper patterns in comparison to XGBoost. The careful tuning of hyperparameters, including learning rate, maximum tree depth, and the number of boosting rounds in XGBoost, further contributed to its superior performance.  
Overfitting was effectively mitigated in both models through the use of cross-validation and early stopping mechanisms, ensuring that training proceeded only until optimal performance was reached on the validation set, thus preventing unnecessary overtraining and enhancing the models' ability to generalize to unseen data. These techniques helped balance bias and variance, ensuring that both models maintained generalizability without becoming overly complex.