## 2 SSA-XGBoost Model
### XGBoost
\(G_{j}=\sum_{i\in I_{j}}g_{i}\) and \(H_{j}=\sum_{i\in I_{j}}h_{i}\) are the optimal leaf weights:  
\[\omega_{j}^{*}=-\frac{G_{j}}{H_{j}+\lambda} \tag{4}\]  
Then, the optimal objective function for a given tree structure \(q\) can be obtained as follows:  
\[Obj^{(k)}=\sum_{j=1}^{T}\left[G_{j}\omega_{j}+\frac{1}{2}H_{j}\omega_{j}^{2} \right]+\gamma T=-\frac{1}{2}\sum_{j=1}^{T}\frac{G_{j}}{H_{j}+\lambda}+\gamma T \tag{5}\]  
Then, the greedy algorithm is employed to enumerate all possible tree structures \(q\) to identify the optimal splitting node of the leaf node and attain the maximum gain of the objective function following the split [26]; this greedy algorithm starts from a single leaf node and iteratively adds branches to the tree, assuming that \(\mathrm{I}_{L}\) and \(\mathrm{I}_{R}\) are the sets of instances of left and right sub-trees of the node, respectively, so that \(\mathrm{I}=\mathrm{I}_{L}\cup\mathrm{I}_{R}\). Then, the gain after the splitting of the leaf node \(\mathrm{j}\) is expressed as follows:  
\[Gain=\frac{1}{2}\left[\frac{G_{L}^{2}}{H_{L}+\lambda}+\frac{G_{R}^{2}}{H_{R}+ \lambda}-\frac{\left(G_{L}+G_{R}\right)^{2}}{H_{L}+H_{R}+\lambda}\right]-\gamma \tag{6}\]  
where \(G_{L}\) and \(G_{R}\) are the first-order gradient values of the left and right leaf nodes after splitting; \(H_{L}\) and \(H_{R}\) are the corresponding second-order gradient values. The first, second, and third terms of the formula correspond to the scores of the left leaf node, the right leaf node, and the observed leaf node, respectively, and \(\gamma\) serves as a regularization parameter to prevent the over-splitting of the decision tree. Figure 2 shows a brief schematic of the XGBoost algorithm. The XGBoost algorithm controls the construction of the tree by setting some hyperparameters to limit the complexity and weight of each tree [26]. Table 1 shows several important hyperparameters of the XGBoost algorithm, which have different degrees of influence on the performance of the XGBoost algorithm. Each hyperparameter has a different range of values, resulting in a large number of combinations. The traditional method of finding the optimal hyperparameters is to set a certain range for each hyperparameter based on experience and then perform a grid search within that range, calculate the accuracy of each combination, and select the combination with the highest accuracy, which is a set of optimal hyperparameters. The traditional method is easy to understand and implement, but the disadvantages include the fact that it relies on personal experience, the fact that the grid search calculation is relatively large and time-consuming, and the fact that it is easy to fall into the local optimal solution, leading to the model classification effect, which is difficult to optimize. To address the above problems, this study uses the Sparrow Search Algorithm to find the optimal hyperparameters of XGBoost. \begin{table}
\begin{tabular}{c c} \hline \hline
**Hyperparameters** & **Means** \\ \hline n\_estimators & Iterations \\ max\_depth & Maximum tree depths \\ learning\_rate & Learning rate \\ objective & Objective function \\ \(\gamma\) & Regularization parameter \\ min\_child\_weigh & Minimum leaf weights \\ \hline \hline \end{tabular}
\end{table} 
Table 1: XGBoost algorithm hyperparameters.