## 3 Prediction Hybrid Method
### Hybrid Method Testing
It should also be noted that the developed method is a classification method, and the results are presented in a discrete form, while the input data can be both discrete and continuous. In the hybrid method, by determining the ranges of limit values defining the expected technical state, it was possible to determine the correctness of the classification of technical conditions. For this purpose, the percentage share of \(S\) values correctly classified to technical state was calculated. Thus, the correctness of the classification means the number of cases classified to the same technical condition as occurred in reality. Table 5 presents the correctness of the classification of technical conditions obtained by using the presented AI models and the hybrid method. To better illustrate the advantage of the hybrid method, the comparison of the three methods is presented in Figure 12. For State \(S\) = 2 (the most important state), the correct classification for the developed hybrid method was obtained at the level of 93.6%. Despite using a regression method that produces continuous results in Method 1, the results of the regression were transformed into a discrete form by adjusting appropriate value ranges for each class. This transformation allowed for the development of a hybrid model and an objective comparison of the results of all methods. The confusion matrix is a fundamental tool in machine learning evaluation, providing a summary of the performance of classification models. Therefore, in Figure 13, three confusion matrices are presented for three different methods, offering insights into their respective classification accuracies and error rates. Figure 12: Comparison of the accuracy of classifying technical states for 3 methods: AI Model 1 (decision tree), AI Model 2 (ANN), and the hybrid method. For the three class classification problem, the metrics were computed both globally (for all classes combined, i.e., global accuracy), and individually for each class, according to the Equations (11)-(14). * **Global Accuracy:** \[Accuracy=\frac{\text{TP}_{\text{allclasses}}+\text{TN}_{\text{allclasses}}}{ \text{TP}_{\text{allclasses}}+\text{TN}_{\text{allclasses}}+\text{FP}_{\text{ allclasses}}+\text{FN}_{\text{allclasses}}}\] (11)  
To determine the accuracy for individual classes, metrics such as precision, recall, and the F1 score were utilized. These metrics provide information about the quality of classification in the context of individual classes. For each class (_i_), these coefficients were calculated using TP, FP, and FN specific to that class:  
\[Precision_{\text{class}}=\frac{\text{TP}_{\text{class}i}}{\text{TP}_{\text{ class}i}+\text{FP}_{\text{class}i}} \tag{12}\]  
Figure 13: Confusion matrices for three different methods. the frequency of measurements is not significantly costly, and the costs of damaging the inspected element far exceed the costs of measurements. For example, if s2 were incorrectly recorded immediately after the P2 inspection when it was actually s1, according to the procedure, the frequency of P2 measurements would be increased (during the standard P1 measurement, which takes place every 2-3 days, an extended P2 measurement called \"extended P1 inspection\" would be carried out). In that case, the cost of inspections would be twice as high, and instead of 100 euros (cost of P1 per month), it would be 200 euros (cost of extended P1 per month). The cost of replacing the current collector component with a new one in the case of damage is at least 14 times higher than P1 and can range from 1400 euros to 7500 euros for the replacement of the entire pantograph. It should be noted that the aforementioned cost of the extended P1 inspection is the maximum cost that may occur. In the event that s1 is incorrectly classified as s2, for example, halfway between P2 inspections, this cost would only be higher by 50 euros, and in the discussed case, it would be 150 euros instead of 100 euros. Undoubtedly, a better solution would be if all technical states were correctly classified.