# Dissolved Gas Analysis for Fault Prediction in Power Transformers Using Machine Learning Techniques
## 4 Results and Discussion
### Case B  
In this case of fault diagnosis with the DRM, the following ratios were used as the dataset: C\({}_{2}\)H\({}_{6}\)/C\({}_{2}\)H\({}_{2}\), C\({}_{2}\)H\({}_{2}\)/CH\({}_{4}\), C\({}_{2}\)H\({}_{2}\)/C\({}_{2}\)H\({}_{4}\), and CH\({}_{4}\)/H\({}_{2}\). The diagnostic performance results of the machine learning classification algorithms are presented in Tables 7 and 8 for training and testing, respectively.  
Figures 10 and 11 illustrate the results chart of the six metrics for MLMs on the case B dataset.  
In the case B dataset, which used the three gas percentages, RF obtained the best accuracy in the training stage (99.8%). In the testing stage, RF and DT obtained the best accuracy (100%). The best values for the other metrics were also obtained when using RF  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Method** & **Accuracy** & **Precision** & **Recall** & **Specificity** & **F1 Score** & **MCC** \\ \hline RF & 99.8\% & 99.8\% & 99.8\% & 99.8\% & 99.8\% & 99.7\% \\ \hline BPNN & 49.3\% & 42\% & 49.3\% & 51.5\% & 33\% & 7.2\% \\ \hline KNN & 92\% & 92\% & 92\% & 96.1\% & 92\% & 88.1\% \\ \hline SVM & 53.9\% & 45.1\% & 53.9\% & 58.7\% & 42\% & 23.6\% \\ \hline Decision Tree & 99.2\% & 99.2\% & 99.2\% & 99.7\% & 99.2\% & 98.8\% \\ \hline Naive Bayes & 87.8\% & 90.7\% & 87.7\% & 96.9\% & 87.6\% & 82.9\% \\ \hline \hline \end{tabular}
\end{table}
Table 7: Machine learning methods’ performance evaluation results: case B training.  
Figure 8: Confusion matrix of case A dataset for DT—testing stage.  
Figure 9: Confusion matrix of case A dataset for NB—testing stage.  
Figure 14: Confusion matrix of case B dataset for BPNN—testing stage.  
Figure 12: Confusion matrix of case B dataset for RF—testing stage.  
Figure 13: Confusion matrix of case B dataset for KNN—testing stage.  
Figure 21: Confusion matrix of case C dataset for DT—testing stage.  
Figure 23: Confusion matrix of case C dataset for NB—testing stage.  
Figure 20: Confusion matrix of case C dataset for RF—testing stage.  
As mentioned above, RF and DT obtained the best accuracy. The confusion matrices of RF and DT in Figures 20 and 21 show that the OH fault has a detection accuracy of 100%.  
In this paper, gas percentages and gas ratios from conventional methods have been used to compare the data inputs for classification algorithms. The highest results for accuracy, precision, recall, specificity, F1 score, and Matthews correlation coefficient diagnostic were obtained for the three gas percentages used in the DRM, with the RF and DT algorithms performing the best.  
A summary of the best diagnostic results for accuracy, precision, recall, specificity, F1 score, and Matthews correlation coefficient for the different testing datasets is given in Table 11.  
Figure 26 shows a comparison of the performance evaluation results obtained between the datasets for all types of faults. This figure illustrates that the best results for accuracy, precision, recall, specificity, F1 score, and Matthews correlation coefficient were obtained with the Doernenburg method (four concentrations) and the RF algorithm, with similar resulted obtained (at testing) by the DT algorithm.  
Figure 27 shows the Orange Data Mining details for the DRM dataset as an example of our work. All Orange Data Mining code is available at [[https://github.com/ahmedtariq71/PowerTransformerCode](https://github.com/ahmedtariq71/PowerTransformerCode)]([https://github.com/ahmedtariq71/PowerTransformerCode](https://github.com/ahmedtariq71/PowerTransformerCode)) (accessed on 13 December 2024).  
Figure 24: Confusion matrix of case C dataset for BPNN—testing stage.  
Figure 25: Confusion matrix of case C dataset for KNN—testing stage.  
Figure 27: Orange Data Mining user interface for our work.  
Figure 26: Diagnostic performance metrics depending on the dataset (test dataset) for the classification algorithm.