# Failure Type Prediction Using Physical Indices and Data Features for Solenoid Valve +
## 4 Experiment and Result Analysis  
In fact, when the solenoid valve could be opened normally, as the number of actions increases, the coil will age and the lubricant will dry up. The final failure type depends on the severity of each of the two failure factors. To predict the failure type before it breaks down, the random forest is applied for prediction and classification based on the comprehensive feature vector extracted in Section 3.2. Based on the accelerated aging test platform, we obtained the driven current data of the full life cycle of 60 high-speed solenoid valves. Among them, 37 high-speed solenoid valves finally failed due to the aged coils and the other 23 broke down because of the dried lubricant. In this section, the random forest is used to predict the failure type of high-speed solenoid valves. To evaluate the prediction performance of the random forest, the model is tested by three-fold cross validation. It means, that in each round of three-fold cross validation, 40 samples are randomly selected as the training set and the remaining 20 samples are used as the test set; then, the average of the three test results is used as the estimate of the model performance. The prediction performance of the random forest model based on the comprehensive feature vector, the physical feature vector, and the data feature vector at cycle 3000 are shown in Table 4.  
The calculation formula for precision, recall, and F1-score are shown as Equations (13)-(15) [32]. \[Precision=\frac{TP}{TP+FP} \tag{13}\] \begin{table}
\begin{tabular}{c c c c} \hline
**Performance Matrices** & **Precision** & **Recall** & **F1-Score** \\ \hline Proposed method & 95.95\% & 94.83\% & 95.39\% \\ \hline Physical index vector & 94.71\% & 91.12\% & 92.88\% \\ \hline Data feature vector & 93.37\% & 92.32\% & 92.84\% \\ \hline \end{tabular}
\end{table} 
Table 4: Prediction performance of aged coils. Figure 7: Algorithm flow of random forest applied to failure type prediction. where _TP_ is the number of coil aged samples predicted to be coil aged and _FP_ is the number of samples with dried lubricant predicted to be coil aged. \[Recall=\frac{TP}{TP+FN} \tag{14}\]  
where _FN_ is the number of coil aged samples predicted to be dried lubricant. \[F1=\frac{2\times Precision\times Recall}{Precision+Recall} \tag{15}\]  
Similar to the prediction of the aged coils for a high-speed solenoid valve, we predict the lubricant failure of the solenoid valve, and the results of its three-fold cross validation are shown in Table 5.  
From Tables 4 and 5, we can see that the comprehensive feature vector combining physical and data features helps the random forest get the best prediction performance. The prediction performance of the aged coils is better than the lubricant failure. In order to study the relationship between the life cycles of the high-speed solenoid valve and the prediction performance, the current data at different stages are used for prediction. We use the accuracy to evaluate the prediction performance of models. The accuracy is calculated as Equation (16). \[Accuracy=\frac{TP+TN}{P+N} \tag{16}\]  
where _TP_ is the number of coil aged samples predicted to be coil aged, _TN_ is the number of samples with dried lubricant predicted to be lubricant failure, \(P\) is the number of coil aged samples, and \(N\) is the number of samples with dried lubricant. The prediction performance comparison result with several common classification algorithms, such as k nearest neighbors (KNN), support vector machine (SVM), and Decision Tree (DT), is shown in Figure 8. We can see that, as the number of cycles increases, the accuracies of all algorithms become higher. The reason is that, with the continuous aging of the high-speed solenoid valve, its failure trend becomes more and more obvious, which means it is getting closer to a certain failure type. The F1-score of random forest is higher than other algorithms at any stage, which means it has the best prediction performance to the compared algorithms.