## 5 Experiment and Analysis
### SMOTE + Tomek Link Mixed Sampling Performance Analysis
#### 5.3.2 Evaluation Indicators  
In this experiment, the precision \(P\), recall \(R\), \(F1\)-score, and confusion matrix were selected as evaluation indexes to evaluate the fault diagnosis model of the CNN-BiGRU-Attention plunger pump with dual-channel feature fusion. The following is a detailed introduction to the evaluation indicators.  
Samples can first be divided according to the combination of their true class and the model-predicted class, respectively: a false negative (\(FN\)) is a positive sample that is incorrectly determined to be a negative sample. A false positive (\(FP\)) occurs when a negative sample is incorrectly interpreted as a positive sample. A true negative (\(TN\)), that is, a truly negative sample, is accurately identified as a true negative. A positive sample is considered a true positive (\(TP\)) and is a true positive sample.  
Precision  
The precision rate measures the proportion of successfully predicted operating conditions to all operating cases. It can be expressed by Equation (7).  
\[P=\frac{TP}{TP+FP} \tag{7}\]  
Recall  
The recall rate, also known as detection rate, is the ratio of all successfully detected instances to all true instances. It can be expressed by Equation (8).  
\[R=\frac{TP}{TP+FN} \tag{8}\]  
\(F1\)-score  
In general, there is a contradictory relationship between the accuracy rate and the recall rate: when the accuracy rate is high, the recall rate is often low, and when the recall rate is high, the accuracy rate is often low. To balance the precision and recall, you can use the \(F1\)-score indicator, which is the weighted harmonic average of the precision and recall. The \(F1\)-score determines the accuracy and robustness of a classifier and is often used to evaluate the performance of binary classification models. It can be represented by Equation (9).  
\[F1=\frac{(\alpha^{2}+1)P*R}{\alpha^{2}P+R} \tag{9}\]  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Datasets** & **Normal Working Condition** & **Abnormal Condition** & **Scale** \\ \hline Raw datasets & 4600 & 1339 & 3.4:1 \\ \hline SMOTE + Tomek Link & & & \\ post-equilibrium datasets & 4531 & 4400 & 1.03:1 \\ \hline \hline \end{tabular}
\end{table}
Table 2: A comparison of the imbalanced dataset with the binary classification of the dataset processed based on the SMOTE + Tomek Link integration algorithm.  
where the purpose of the \(F1\) is to merge the scores of the precision and recall into one score, and in the process of merging, the weight of the recall is based on precision \(\alpha\) times.  
When the parameter \(\alpha=1\), this is the most common \(F1\)-score, which is a way to evaluate the performance of a system by looking at its recall rate and accuracy. It can be represented by Equation (10).  
\[F1=\frac{2*P*R}{P+R}=\frac{2 TP}{N+TP-TN} \tag{10}\]  
where \(N\) is total number of examples.  
(4) Confusion matrix  
In order to better describe the classification results of the proposed model, the confusion matrix is usually presented in four forms: _FN_, _FP_, _TN_, and _TP_. If there are \(N\) classes, the confusion matrix is an \(N\times N\) matrix, with the left axis representing the true class and the upper axis representing the predicted classification corresponding to that true class. Each element \(Q\) of the matrix represents the number of elements in class \(A\) that are actually classified as class \(B\). The confusion matrix is shown in Table 3.