*5.5. Comparison of Model Diagnosis Results*

In the same environment of the Huawei Cloud MLS platform, the model constructed by the XGBoost algorithm was compared with the CART Tree classification model and the Random Forests (RFs) algorithm model. The comparison diagram is displayed in Figure 6.

The comparison is made based on the model evaluation indicators such as the precision, the recall rate, and the *F*1 score. Additionally, the comparison results are shown in Table 6.

**Figure 6.** Model comparison analysis.


**Table 6.** Model evaluation comparison.

As shown in Table 6, after the principal component dimensionality reduction of the data, the CART Tree, Random Forests, and XGBoost algorithms are, respectively, used to construct the fault diagnosis model of the hydraulic valve. Afterward, the models are tested through the test set. The test results indicate that the average precision of the XGBoost model is 96.9%0.969, the average recall rate is 96.7%, and the average *F*1 score is96.6%. The values of the evaluation indicators are higher than those of the CART Tree and Random Forests models, which can not only prove the superiority of the algorithm, but also demonstrate the effectiveness of this algorithm for hydraulic valve fault diagnosis.
