(4) Confusion Matrix

The confusion matrix is used for evaluating the model when faced with a multi-classification problem, and the weight of each category is almost equal. Each column of the confusion matrix represents a prediction category, and the total number of data for each column represents the number of data predicted to be in the category. Each row represents the true attribution category of the data, and the total number of data for each row represents the number of data instances belonging to that category. For a confusion matrix, the larger the value on the diagonal is, the better the matrix. The smaller value of other locations are better.

The above-mentioned the Principal Component Analysis and eXtreme Gradient Boosting (PCA-XGBoost) model trained in the Huawei Cloud MLS is tested by the test set, and its specific indicators are shown in Table 5.

**Table 5.** Evaluation indexes of the model using test samples.


It can be seen from Table 5 that the diagonal value of the confusion matrix in the hydraulic valve fault diagnosis model is much larger than the value of the non-diagonal line. The precision and recall rate of the model are all above 88%, and the *F*1 score is higher than 93%. The above results show that the PCA-XGBoost model has high accuracy.
