# State Evaluation of Electrical Equipment in Substations Based on Data Mining
## 2 Methodology
### Case Study
The predicted results were organized into a 3 \(\times\) 3 confusion matrix in Figure 7a. To evaluate the classifier's performance, the project adjusted the statistical form to compare predicted and actual states, as shown in Figure 7b-d. The confusion matrix has four metrics:  
1. True positive (TP): Both actual and predicted states belong to this state. 2. True negative (TN): Neither actual nor predicted states belong to this state. 3. False positive (FP): The predicted state belongs to this state, but the actual state does not. 4. False negative (FN): The actual state belongs to this state, but the predicted state does not. The performance metrics are calculated as follows: \[ \begin{split}\text{Precision}=\frac{\text{TP}}{\text{TP+FP}}\\ \text{Recall}=\frac{\text{TP}}{\text{TP+FN}}\\ \text{Accuracy}=\frac{\text{TN+TP}}{\text{TN+TP+FN+FP}}\\ \text{F1-score}=2\times\frac{\text{Precision+Recall}}{\text{Precision+Recall}} \end{split} \] (15) \begin{table}
\begin{tabular}{c c c c} \hline
**Rule** & _Conf_ (\%) & **Reasons** & **Result** \\ \hline
1 & 95.442 & L1 = 1A and L9 = 9A and L10 = 10A & A \\ \hline
2 & 80.124 & L1 = 1B and L9 = 9B & C \\ \hline
3 & 100 & L1 = 1C & C \\ \hline
4 & 100 & L2 = 2C & C \\ \hline
5 & 94.358 & L4 = 4A and L9 = 9A and L9 = 9A & A \\ \hline
6 & 89.951 & L4 = 4B and L9 = 9B & A \\ \hline
7 & 82.022 & L4 = 4C and L5 = 5C & C \\ \hline
8 & 93.573 & L7 = 7A and L9 = 9A and L10 = 10A & A \\ \hline
9 & 86.559 & L7 = 7C and L9 = 9B & A \\ \hline
10 & 82.537 & L7 = 7C and L9 = 9C & A \\ \hline \end{tabular}
\end{table} 
Table 7: Association rules extracted from Table 6 (excerpt). Figure 7: The confusion matrix of this method: (**a**) 3 \(\times\) 3 confusion matrix; (**b**) normal state confusion matrix; (**c**) attention state confusion matrix; (**d**) abnormal state confusion matrix. In the ROC curve, horizontal axis represents the false positive rate (FPR), proportion of incorrect predictions among samples with negative actual state. And vertical axis represents the true positive rate (TPR), proportion of correct predictions among samples with positive actual state. Performance is quantified by AUC, with higher values indicating better performance. The multiclass problem was transformed into three binary classification problems. For each category, the other categories were grouped together and an AUC value was calculated for each binary problem. These individual AUC values were combined to evaluate overall performance [35]. To compare the classifier's performance with other models (e.g., Support Vector Machine (SVM) and K-Nearest Neighbor (KNN)), all experiments were conducted using MATLAB 2023a. Figures 8 and 9 display the confusion matrices for KNN and SVM, respectively. Figure 10 presents the ROC curves and AUC values for each model. Table 8 summarizes the performance metrics across three states (normal, attention, and abnormal) for each model, with Figure 11 illustrating these metrics as a bar chart. Figure 10: ROC curves: (**a**) the proposed method; (**b**) the SVM model; (**c**) the KNN model. Figure 9: The confusion matrix of the KNN model: (**a**) 3 \(\times\) 3 confusion matrix; (**b**) normal state confusion matrix; (**c**) attention state confusion matrix; (**d**) abnormal state confusion matrix. The proposed method demonstrates superior classification performance in normal and attention states. While its performance in abnormal states is marginally lower than the SVM model, it still outperforms in terms of accuracy and recall for abnormal states. The method's superior performance is evidenced by higher AUC values and improved ROC curves, showing reduced FPR and enhanced TPR. This performance provides a reliable foundation for assessing electrical equipment reliability and informing decisions on shutdown, inspection, or maintenance requirements.