## 4 Examples of Application
### Feature Selection  
Since each feature parameter had to be calculated several times during the training and testing process, RF algorithm was complicated and had much calculation. If there were a lot of decision trees, the operation efficiency would be very low. Therefore, in practical applications, in order to improve the execution efficiency of the algorithm, feature selection ways needed to be performed on the initial feature vectors.  
In order to reflect the classification effect of the method described in this paper under the condition of variable speed, the sample database was constructed by mixing the characteristic data under different working conditions. From all normal and faulty data obtained from experimental testing, 70% were randomly selected as the training set, and the remaining 30% as the test set. The training set data was input into the RF algorithm. There were two important parameters in the RF model, which were the number of decision trees and the number of random feature variables. Figure 8 showed the relationship between OOB error and number of decision trees. It could be seen from the figure that, with the increase of the number of decision trees, the OOB error gradually tended to be stable. Taking into account the accuracy and computational efficiency, 100 decision trees were selected. The random feature variable was called mtry which took the default value \(\sqrt{M}=5\), where \(M\) was the total number of features.  
After the establishment of the RF model, random disturbances were applied to the individual characteristic variables of all the samples of the OOB (Out-of-Bag) data, and the importance score of the individual characteristic variable was calculated by Formula (6). Figure 9 showed the importance score's ranking of all the characteristic variables.  
According to Figure 9, the importance scores of the waveform index and the pulse index were very low. In order to reduce the redundancy of the feature parameters, only the first 15 feature parameters with high importance scores were retained. However, the feature dimension could not be too small, otherwise it was difficult to accurately detect the difference between distinct classification targets. Therefore, according to the order of importance scores from big to small, three to 15 dimensional feature vectors were selected in order to identify the abnormal valve condition. Figure 10 showed the average recognition rate of the valve condition in different dimensions of feature.  
reached the maximum and remained basically constant, indicating that the dimension of the optimal feature vector was 8, which could significantly highlight the difference between normal and abnormal valve conditions. Therefore, we chose 0.7 as the threshold to reduce the dimension of the initial 18-dimensional feature vector to obtain the optimal eigenvector. According to the order of importance scores, the D22 spectral energy, D21 spectral energy, D23 spectral energy, skewness, RMS value, K factor, D24 spectral energy, and peak-to-peak value were the characteristic parameters which contributed the most to the RF model's classification effect. Table 5 showed the optimal eigenvectors for each valve state of the diesel engine. Due to space limitations, two samples were listed for each valve state. The optimal eigenvector was input into the RF algorithm to establish a classifier model which could identify the normal and abnormal valve state.