## 4 PCA-IWOA-XGBoost Model Construction and Prediction Result Analysis
### Training Results and Model Evaluation
IWOA-XGBoost further improved this to \(R^{2}\) 0.984, _RMSE_ 15.847, _MAE_ 9.791, and _RPD_ 13.486, highlighting the contribution of  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Test Samples**} & \multirow{2}{*}{**Actual**} & \multicolumn{2}{c}{**XGBoost**} & \multicolumn{2}{c}{**PCA-XGBoost**} & \multicolumn{2}{c}{**IWOA-XGBoost**} & \multicolumn{2}{c}{**PCA-IWOA-XGBoost**} \\ \cline{3-10}  & & **Predicted** & **Accuracy/\%** & **Predicted** & **Accuracy/\%** & **Predicted** & **Accuracy/\%** & **Predicted** & **Accuracy/\%** \\  & & **Value** & **Value** & **Value** & **Value** & **Value** & **Value** & **Value** & **Value** \\ \hline
1 & 123 & 107.7 & 87.6 & 134.8 & 90.4 & 114.5 & 93.1 & 127.8 & 96.1 \\
2 & 41 & 46.2 & 87.3 & 36.8 & 89.7 & 44.1 & 92.4 & 39.9 & 97.2 \\
3 & 743 & 636.8 & 85.7 & 821.0 & 89.5 &  
IWOA in parameter optimization. The comprehensive advantage of PCA-IWOA-XGBoost stems from the PCA reducing \(RMSE\) by approximately 26.3% (from 34.719 to 25.578) and increasing \(R^{2}\) by about 0.030, combined with IWOA further reducing the \(RMSE\) by approximately 38.0% (from 34.719 to 15.847). Together, this resulted in an \(R^{2}\) close to 1, with the \(RMSE\) and \(MAE\) reduced by about 74.8% and 73.8%, respectively, and \(RPD\) increased by nearly 3.97 times, reflecting significant synergistic effects. This indicates the following: (1) XGBoost has strong regression prediction capabilities but is prone to overfitting when input variables are complex and hyperparameters are not optimally selected, leading to significant performance differences between training and test sets. (2) PCA effectively mitigates coupling and redundancy issues among input features, enhancing model predictive performance. (3) Training with hyperparameters optimized by the whale algorithm addresses the randomness and local optima issues in manual hyperparameter selection for XGBoost, improving the model's learning capacity and generalization ability, thereby enhancing prediction accuracy and robustness. To further validate the performance of the PCA-IWOA-XGBoost model in the task of predicting earthquake fatalities, this study introduced Long Short-Term Memory (LSTM) and Random Forest (RF) as comparative models, constructing supplementary experiments for evaluation. The LSTM model adopted a two-layer structure (64 units per layer), with ReLU as the activation function and Adam as the optimizer (learning rate of 0.001), and was trained for 100 epochs with a batch size of 16. Under this configuration, the LSTM model achieved the following performance on the test set: \(R^{2}\) = 0.960, \(RMSE\) = 16.512, and \(MAE\) = 11.124. The RF model was configured with 100 trees, a maximum depth of 10, and a minimum split sample size of 2, yielding a test performance of \(R^{2}\) = 0.978, \(RMSE\) = 13.456, and \(MAE\) = 8.732. To more intuitively assess the actual prediction performance, three representative earthquake events (Tonghai earthquake, actual fatalities: 15,621; Yushu earthquake, 2698; Tangshan earthquake, 242,769) were selected for error comparison analysis. The relative errors of PCA-IWOA-XGBoost were 7.4%, 5.7%, and 4.9%, respectively, significantly lower than those of LSTM (18.7%, 15.5%, 14.3%) and RF (10.1%, 9.6%, 7.7%). The comprehensive experimental results demonstrated that PCA-IWOA-XGBoost, through PCA dimensionality reduction for feature extraction, IWOA for hyperparameter optimization, and XGBoost's regularization mechanism, exhibits superior prediction accuracy and stability in small-sample, high-dimensional, nonlinear earthquake data scenarios. Compared to LSTM's tendency for overfitting and RF's issue with amplified bias, the proposed model is better suited for small-sample earthquake disaster modeling tasks, showcasing excellent robustness and generalizability.