# Elevator Fault Diagnosis Method Based on IAO-XGBoost under Unbalanced Samples
## 5 Elevator Car Fault Diagnosis Example Analysis
### Analysis of Results of XGBoost Parameter Optimization Method Based on IAO Algorithm
#### 5.3.2 Analysis of Fault Diagnosis Results Based on IAO-XGBoost  
XGBoost model hyperparameters have a significant effect on the effectiveness of the model in classification training. During training, the max_depth parameter determines the depth of the decision trees in the model. Setting it too high allows the model to learn more features but increases the risk of overfitting and complexity; conversely, a max_depth that is too low results in a simplistic model that fails to capture the full features of the data, leading to underfitting. Additionally, n_estimators, learning_rate, subsample, and colsample_bytree collectively influence the model's learning performance and classification ability. The IAO algorithm is utilized for iterative optimization of the above five hyperparameters. The number of populations is 20, the maximum number of iterations is 15, and the fitness function is the error rate of the model. The adaptation degree change curve is shown in Figure 8.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Function** & **Formulas** & **Dimension** & **Realm** & **Optimum Value** \\ \hline F1 & \(f_{1}(x)=\sum\limits_{i=1}^{n}x_{i}^{2}\) & 30 & \([-100,100]\) & 0 \\ \hline F2 & \(f_{2}(x)=\sum\limits_{i=1}^{n}(\sum\limits_{j-1}^{i=1}x_{j})^{2}\) & 30 & \([-100,  
Figure 8: Fitness curve.  
Figure 7: Comparison of fitness curves of different test functions.  
The fitness change curve shows that when the iteration reaches six times, the fitness value is 0.01316 and the algorithm converges. The optimal hyperparameter combination is obtained, and the parameters are shown in Table 6.  
To validate the effectiveness of the IAO-XGBoost model in elevator car fault diagnosis, experiments are conducted using AO-XGBoost, PSO-XGBoost, GWO-XGBoost, and IAO-XGBoost on the same training and test sets. The results of the fault diagnosis are presented in Figure 9.  
From Figure 9, the fault diagnosis accuracy of the IAO-XGBoost model reaches 99.06%. The fault diagnosis accuracies of AO-XGBoost, PSO-XGBoost, and GWO-XGBoost are 98.11%, 97.88%, and 98.35%, respectively. The results show that the AO algorithm, which incorporates Tent chaotic mapping, nonlinear inertia weights, and nonlinear convergence factor strategies, has superior optimization-seeking ability compared to the other algo  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter Name** & **Optimum Value** \\ \hline n\_estimators & 47 \\ max\_depth & 11 \\ learning rate & 0.28 \\ subsample & 1 \\ colsample\_bytes & 0.76 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Optimized parameters.  
Figure 9: Fault diagnosis results of different algorithm optimization models.  
rithms. The proposed IAO-XGBoost model demonstrates better classification ability than the other three models, highlighting its higher reliability and superiority for elevator car fault diagnosis.  
To further illustrate the reliability and accuracy of the IAO-XGBoost model, the IAO-XGBoost model is compared with XGBoost, LightGBM, and RF, and the fault diagnosis results are shown in Table 7.  
As shown in Table 6, the fault diagnosis accuracy of the IAO-XGBoost model proposed in this study can reach 99.06%, which improves by 2.37%, 2.13%, and 1.18% compared to RF, LightGBM, and XGBoost models, respectively. Moreover, it has a significant advantage in diagnosis time. Compared to RF, LightGMB, and XGBoost models, the training time has been saved by 93.3%, 69.2%, and 15.3%, respectively. The reduction of training time can help reduce the performance requirements for computer hardware. The kappa coefficient, combined with accuracy and recall, can comprehensively evaluate the diagnostic performance of the model. The higher the kappa coefficient, the more consistent the judgment of fault diagnosis results and the better the model stability. The IAO-XGBoost model proposed in this article is used for fault diagnosis, and the Kappa coefficient is the highest among the five methods, reaching 0.988, and indicating that the proposed model has a more reliable fault diagnosis effect.