# Application of Artificial Intelligence to Forecast Drought Index for the Mekong Delta
## 2 Materials and Methods
### Methodology
#### 2.3.5 Artificial Intelligence Model Selection
* Weight adjustment and reweighting: The data points' weights are modified to prioritize the previously misclassified or poorly forecasted points. This procedure is iterated, wherein each subsequent model rectifies the inaccuracies of the collective ensemble of preceding models. * Iterative process: Models are incrementally included until the training data are accurately predicted or a predetermined maximum number of models is attained. Every iteration has the objective of minimizing the total prediction error by dealing with the leftover residuals. * Extreme Gradient Boosting (XGBoost):  
XGBoost is a machine learning technique that uses a Gradient Boosting framework to improve the accuracy of predictions. The algorithm lends greater importance to incorrectly classified data pieces, prioritizing their accurate prediction in subsequent iterations [61]. XGBoost enhances existing Gradient Boosting algorithms by integrating regularization approaches to reduce overfitting and employing advanced optimization techniques to improve computational performance [46]. The purpose of the model is simplification through the optimizations of the training loss (\(l\)) and regulations (\(\Omega\)). \(f_{k}\) is the function of the K-tree. The objective function (\(J\)) in round t is given by Equation (12). \[J^{(t)}=\sum\
olimits_{i=1}^{n}{I(y_{i},\hat{y}_{i})}+\sum\
olimits_{k=1}^{K} {\Omega(f_{k})} \tag{12}\]  
Here is a concise summary of its functionality:  
* Model generation: An initial decision tree is constructed using the initial data. The calculation involves determining the discrepancy between the projected values and the actual observations, which is referred to as residuals. * Subsequent models: Additional trees are constructed to forecast the discrepancies from the preceding model. These algorithms prioritize the analysis of data points that were previously misclassified or inaccurately anticipated. * Optimization involves the ongoing addition of new trees, where each tree aims to rectify the mistakes made by the preceding trees. The designated loss function, such as mean squared error, is optimized by utilizing the residuals obtained from each stage. * Iteration and combination: This iterative process is carried out several times. The ultimate model is an amalgamation of all the separate trees, with each tree making a contribution to the overall prediction. * Recurrent Neural Networks (RNNs) RNNs are characterized by their ability to maintain a memory of previous inputs through internal states, which makes them suitable for tasks involving sequences. Unlike traditional feedforward neural networks, RNNs have connections that form directed cycles, allowing information to persist. Given an input sequence \(x_{t}\), the hidden states \(h_{t}\) at time step t are updated as shown in the following equations:  
\[h_{t}=\sigma(W_{h}x_{t}+U_{h}h_{t-1}+b_{h}) \tag{13}\]where  
* \(x_{t}\) is the input at time step \(t\);
* \(h_{t-1}\) is the hidden state from the previous time step;
* \(W_{h}\) and \(U_{h}\) are weight matrices;
* \(b_{h}\) is the bias vector;
* \(\sigma\) is an activation function, typically tanh ReLU. The output \(y_{t}\) at time step \(t\) is given by  
\[y_{t}=\sigma\big{(}W_{y}h_{t}+b_{y}\big{)} \tag{14}\]  
where \(W_{y}\) is the weight matrix and \(b_{y}\) is the bias vector for the output layer. 4. Long Short-Term Memory (LSTM)  
Long Short-Term Memory (LSTM) networks are a specific type of Recurrent Neural Network that excel at learning order dependence in sequence prediction tasks. The output from the previous step is utilized as the input for the following step in a Recurrent Neural Network (RNN). It tackled the problem of long-term reliance in Recurrent Neural Networks (RNNs), where the RNN struggles to predict words that are stored in its long-term memory but can make more precise predictions using the most recent data. As the gap length increases, RNN's performance becomes less efficient. By default, the LSTM has the ability to retain information for an extended period.