## 3 Methodology
Furthermore, in fault diagnosis tasks, techniques like k Nearest Neighbors (kNN), Approximate Nearest Neighbors (ANN) and Condensed Nearest Neighbors (CNN) can be employed to classify and identify faults based on similarities with known fault patterns, which contributes to the overall reliability and safety analysis of complex systems. The ML algorithm used in this study is versatile for both classification and regression tasks, utilizing a simple approach to classify new cases based on a majority vote from its nearest neighbors, assessed through a distance function [53]. To determine the final accuracy of the tests, the confusion matrix is used. The confusion matrix is a performance evaluation tool in ML that represents the accuracy of a classification model, particularly for multi-class methods. It assesses the performance of a classification model by comparing predicted and actual class labels [54]. This provides insight into the classification model's operation and the types of errors it makes. The comparison of actual target values with those predicted by the model is displayed within an n \(\times\) n matrix, where n represents the total number of target classes. The difference from the regular confusion matrix was in calculating the final results with the cumulative overall precision accuracy for the test data. In this study, the proposed predicted algorithm is used to make predictions across multiple classes and follows a lifecycle guided by theoretical principles of ML, resulting in an algorithm adhering to this cycle, as depicted in Figure 1.  
Beginning with developing requirements, the problem is stated, and a solution is proposed that emphasizes the purpose and benefits. The analysis evaluates the existing situation and proposes methods and algorithms for problem-solving, often using intuitive graphical representations for clarity. The design involves abstracting the facts from the analysis to realize information and action modeling, while implementation and testing bring the product model to life through programming and debugging. Once completed, the algorithm is deployed for operation, and updates are provided to address issues and improve performance. This life cycle repeats with each iteration of development. In a specific research context, analysis, design and implementation are essential for developing predictive data analysis programs using ML techniques that are adapted from existing works [55; 56]. System analysis identifies critical points and variables, enabling the model's application to various installations and enhancing operational understanding and automation potential [57]. The algorithm further involves data collection from installation sensors and processing raw data to distinguish normal and faulty states through techniques like feature generation. This iterative process ensures a high-quality database, facilitating reliable analysis and results generation [58]. The algorithm creation process involves flexibility in terms of strategy and technique selection, which is tailored to the available data types and volume. Multiple techniques are simultaneously employed to build various predictive models, each offering various solutions to the problem at hand, the notable results will be considered in defining the optimal method. When dealing with large-scale data, kNN can become computationally expensive due to the need to calculate distances between all data points. To address this, we take into account suitable solutions, such as ANN, Dimensionality Reduction, Data Sampling, CNN, Parallel Processing and Efficient Distance Metrics. In high-dimensional datasets, distance calculations become more expensive (curse of dimensionality). To improve computational efficiency without losing too much information, techniques like Principal Component Analysis (PCA) help to reduce the number of dimensions. In our case, PCA projects the data onto a lower-dimensional space while retaining most of the variance, making kNN faster.