# Application of Artificial Intelligence to Forecast Drought Index for the Mekong Delta
## 2 Materials and Methods
### Methodology
#### 2.3.5 Artificial Intelligence Model Selection  
The accuracy of the models utilized is crucial for forecasting the SPEI. Scientists have investigated many Artificial Intelligence (AI) methods, such as machine learning models and deep learning models, to make precise predictions of the SPEI. According to the results of the literature review, the machine learning methods widely employed for SPEI prediction include machine learning models (Gradient Boosting, Extreme Gradient Boosting) and deep learning models (RNN and LSTM). Gradient Boosting algorithms such as XGBoost and Gradient Boosting can be effectively used to predict the Standardized Precipitation Evapotranspiration Index. These algorithms are powerful machine-learning methods that can handle complex relationships between input variables and the SPEI [57]. By utilizing the principles of Gradient Boosting, these algorithms can iteratively refine the predictions and incorporate the strengths of multiple weak models into a strong predictive model. Moreover, research studies have shown that the XGBoost and LightGBM outperform traditional machine learning algorithms, such as decision trees, neural networks, and random forests, in terms of prediction accuracy for the SPEI [58]. Additionally, the incorporation of specific characteristics of each variable through weighting distance based on sensitivity coefficients was found to further improve the performance of these algorithms in predicting the SPEI. Furthermore, these Gradient Boosting algorithms have shown promising results in forecasting different seasons and multi-month-ahead reference evapotranspiration. In summary, Gradient Boosting algorithms, specifically XGBoost and Gradient Boosting, were highly effective in predicting the SPEI. 1. Gradient Boosting algorithms  
Gradient Boosting algorithms are a collection of strategies that improve the performance of weaker models (learners) by progressively combining them to decrease bias and variation in supervised learning situations [59]. Gradient Boosting leverages the advantages of several models to construct a resilient predictive model that outperforms any individual poor learner [46]. The Gradient Boosting algorithm is an iterative method for optimizing a predictive model by minimizing a loss function [60]. This section details the step-by-step process of applying Gradient Boosting, including the relevant mathematical Formulas (7)-(11):  
\[F_{0}(x)=\text{arg}min_{c}\sum_{i}^{N}L(y_{i},c) \tag{7}\]  
where L is the loss function, \(y_{i}\) is the target values, and \(N\) is the number of data points. For \(m=1\) to M (number of boosting rounds):  
\[r_{int}=-\left[\frac{\partial L(y_{i},\ F_{m-1}(x_{i})}{\partial F_{m-1}(x_{i} )}\right]\ \ for\ i=1,\ldots n \tag{8}\]  
where \(\mathbf{r}_{\text{im}}\) represents the residual for the i-th data point at the m-th iteration. Fit a base learner \(h_{m}(x)\) to the residuals:  
\[h_{m}(x)=\text{arg}min_{h}\sum_{i}^{N}(r_{int}-h(x_{i}))^{2} \tag{9}\]  
Update the model with the new learner:  
\[F_{m}(x)=F_{m-1}(x)+v.h_{m}(x) \tag{10}\]  
where \(v\) is the learning rate, controlling the contribution of each learner. After M iterations, the final model is as follows:  
\[F_{M}(x)=F_{0}(x)+\sum_{m=1}^{M}v.h_{m}(x) \tag{11}\]Below is a thorough analysis of the functioning of Gradient Boosting:  
* Model initialization: The procedure commences by constructing an initial model utilizing the training data. The model generates predictions based on the training data, and subsequently calculates the residual errors, which represent the discrepancies between the actual values and the anticipated values. * Sequential model addition: A novel model is trained to forecast the discrepancies between the preceding model's predictions and the actual values. The newly introduced model is incorporated into the ensemble, and the collective predictions of all existing models are utilized to revise the residuals.