## 2 SSA-XGBoost Model
### Sparrow Search Algorithm  
The Sparrow Search Algorithm (SSA) [30] is a novel swarm intelligence optimization algorithm that was proposed by [PERSON] et al. in 2020 and based on the foraging process of sparrows. A colony of sparrows is composed of three sparrow types: discoverers, joiners, and warners. These types continuously update their positions during foraging to locate the best food source. The optimal food source position represents the most favorable solution. The following assumptions are made:  
1. When a sky enemy approaches a sparrow colony and is detected, the colony shifts position in time;
2. Under certain circumstances, the identities of the discoverers and the joiners are interchangeable;
3. The lower the fitness value of an individual sparrow, the harsher and more dangerous the area in which it forages. Based on the above assumptions, the SSA model is constructed as shown below, with \(X\) representing the current position of the sparrow population, expressed in the form of a matrix:  
\[X= \begin{bmatrix}x_{1,1}&x_{1,2}&\ldots&x_{1,d}\\ x_{2,1}&x_{2,2}&\ldots&x_{2,d}\\ \vdots&\vdots&\vdots&\vdots\\ x_{n,1}&x_{n,2}&\ldots&x_{n,d}\end{bmatrix}  \tag{7}\]  
Figure 2: Schematic diagram of the XGBoost algorithm. where \(n\) is the number of sparrows, and \(d\) is the number of parameters to be optimized. In the SSA, fitness values are used to assess the foraging ability of individual sparrows, and the matrix of fitness values for the entire sparrow population is shown below:  
\[F_{X}= \begin{bmatrix}f(\left[x_{1,1}&x_{1,2}&\ldots&x_{1,d}\right])\\ f(\left[x_{2,1}&x_{2,2}&\ldots&x_{2,d}\right])\\ \vdots&\vdots&\vdots&\vdots&\vdots\\ f(\left[x_{n,1}&x_{n,2}&\ldots&x_{n,d}\right])\end{bmatrix}  \tag{8}\]  
Here, \(f\left(\left[x_{i,1}&x_{i,2}&\ldots&x_{i,d}\right]\right)\) is used to calculate the fitness value of the ith sparrow at the current location. Discoverers have high fitness values in the sparrow flock. They are more capable of foraging and can provide the group with the location and direction of foraging. During each iteration, the location of the discoverer is updated with the following rules:  
\[X_{i,j}^{t+1}=\left\{ \begin{aligned} X_{i,j}^{t}\cdot\exp\left(- \frac{i}{\alpha\cdot\text{1-}t\text{2-}_{max}}\right)&\text{ if }& R_{2}<ST\\ X_{i,j}^{t}+Q\cdot L&\text{ if }& R_{2}\geq ST\end{aligned} \right. \tag{9}\]  
where \(t\) is the number of iterations; \(X_{i,j}^{t}\) denotes the location information of the ith sparrow in the jth dimension; \(\alpha(\alpha\in[0,\,1])\) is a random number; \(iter_{max}\) is the maximum number of iterations; \(Q\) is a random stone obeying a normal distribution; \(L\) is a \(1\times d\) matrix, where each element in \(L_{i}\) is either \(-1\) or \(1\); \(R_{2}(R_{2}\in[0,1])\) denotes the discoverer's optimal individual fitness value at \(t\) time; and \(ST(ST\in[0.5,1])\) denotes the safety value. When \(R_{2}<ST\), it means that there is no natural enemy around the foraging environment at this time, and the discoverer conducts an extensive grid search to find the location of the locally optimal fitness value; when \(R_{2}>ST\), it indicates that there is a natural enemy around the foraging environment at this time and that the sparrow colony needs to go to a new safe location to forage. There are two types of joiners in a sparrow colony: the first are those with high fitness values, which are mainly responsible for monitoring the discoverer, and as soon as they know that the finder has found a better foraging location, they will immediately fly to the vicinity of the discoverer to compete with him; the second are those with low fitness values, which forage elsewhere to increase the fitness value in order to wait for the time when it is suitable to compete with the discoverer, and the position updating rule of the joiners is as follows:  
\[X_{i,j}^{t+1}=\left\{