# Elevator Fault Diagnosis Method Based on IAO-XGBoost under Unbalanced Samples
## 5 Elevator Car Fault Diagnosis Example Analysis
### Analysis of the Results of Sample Balancing Based on RFE-SMOTE-Tomek  
The number of features affect both sample balancing and the fault diagnosis results. In order to select the optimal feature set, different sets of features are inputted into the XGBoost model, and the corresponding fault diagnosis accuracies are obtained. The initial hyperparameters of the XGBoost model are preset as n_estimators = 100; max_depth = 4, learning rate = 0.1; subsample = 1; colsample_bytree = 1. The results of the effect of different numbers of features on fault accuracy are shown in Figure 6.  
Reducing the dimensionality of the data by removing redundant features helps mitigate the impact of such features on the accuracy of fault diagnosis. However, eliminating too many features may lead to the removal of useful ones. It is essential to determine the  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Data Type** & **Training Set** & **Test Set** & **Amount** \\ \hline Normal operation & 217 & 94 & 311 \\ Loose guide shoe & 120 & 51 & 171 \\ Elevator emergency stop & 41 & 18 & 59 \\ Poor car door sliding & 39 & 17 & 56 \\ Wear of traction rope & 37 & 16 & 53 \\ Amount & 455 & 195 & 650 \\ \hline \hline \end{tabular}
\end{table}
Table 2: The case of different types of sample data.  
Figure 6: Effect of different numbers of features on fault accuracy.  
optimal number of features. From Figure 5, when the number of features is 17, the accuracy of fault diagnosis reaches its maximum, which is 94.63%. According to the effect of different numbers of features on fault diagnosis, the top 17 features, in terms of importance ranking, are selected as the preferred feature dataset.  
To validate the effectiveness of the RFE-SMOTE-Tomek sample-balancing method, the original feature dataset, the dataset after feature optimization, and the dataset processed by different sample-balancing methods (SMOTE, Borderline-SMOTE, SMOTE-ENN, SMOTE-Tomek, and SMOTE-Tomek) are selected for comparison. The fault diagnosis model is XGBoost. The sample distribution of the training set before and after sample balancing via RFE-SMOTE-Tomek is shown in Table 3. The comparison of fault diagnosis accuracy under different sample processing methods is shown in Table 4.  
Table 4 show that the accuracy of fault diagnosis is 3.54-4.36% higher for the dataset with the sample-balancing process compared to the dataset without the sample-balancing process. Compared to the sample-balancing methods of SMOTE, Borderline-SMOTE, SMOTE-ENN, and SMOTE-Tomek, the proposed RFE-SMOTE-Tomek sample-balancing method in this study improves the accuracy of fault diagnosis by 2.38%, 1.1%, 1.13%, and 0.41%, respectively. From the results, the accuracy of fault diagnosis is improved by the sample-balancing method proposed in this study. Reducing the feature dimension by eliminating invalid features through the RFE method and reducing the impact of redundant features when sampling via SMOTE-Tomek enable the model to better learn a small number of classes of samples and improve its fault diagnosis ability.