## 3 Classification with Machine Learning  
In the next step, after preprocessing the data, machine learning methods were selected for elevator cabin door drive failure classification. In the research, it was decided to compare the performance of the most popular classification algorithms available in the scikit-learn library of the Python 3.8 language, such as Logistic Regression (LR), Decision Tree (DT), Support vector machine (SVM), Stochastic Gradient Descent (SGD), K-Nearest Neighbors (KNN), Random Forest (RF), and Gradient Boosting (GB). The first comparison criterion was effectiveness in handling complex data (the ability to model intricate decision boundaries). In this regard, logistic regression performed the worst, as it is limited to modeling linear functions. When it comes to generalization capability and resistance to overfitting, these aspects largely depend on the appropriate selection of model parameters. Almost all of the algorithms include built-in regularization mechanisms, but the strength of regularization must be properly tuned. Performance on imbalanced datasets is particularly relevant in the context of fault detection. The k-nearest neighbors (KNN) algorithm is especially vulnerable to issues caused by data imbalance, as it makes decisions based solely on the local neighborhood of a sample. SVM and SGD algorithms are also sensitive to class imbalance; however, they can be adapted by incorporating class weighting mechanisms based on class quantities. Model complexity and possibility of implementation on embedded devices also pose challenges for KNN since the algorithm requires storing the entire dataset in memory. Ensemble algorithms are similarly problematic for embedded environments due to their computational complexity, which is heavily influenced by the number of weak estimators used in classification. In industrial applications related to fault  
Figure 9: Performance of linear regression, logistic regression and decision tree algorithms for processing with aggregation of operation cycles. diagnostics, interpretability is also a crucial factor, as these algorithms are intended to support operators and maintenance personnel. While the principles behind algorithms such as support vector machines (SVM) and KNN are relatively straightforward, interpreting their decision boundaries is significantly more difficult compared to, for instance, decision trees, which can be visualized. An additional advantage of tree-based algorithms is their ability to assess feature importance, which can serve as a valuable diagnostic tool. The final comparison criterion is scalability, which becomes increasingly important when collecting data from multiple devices. For large datasets, the training time of KNN and SVM algorithms is considerably longer compared to other models. A summary of the algorithm comparison is presented in Table 2.  
An important aspect of fault detection modeling is the careful fine-tuning of the model to achieve the best possible performance. To this end, a process of hyperparameter tuning of the algorithms was carried out using random search with cross-validation. It requires defining a continuous or discrete distribution for each of the algorithm's hyperparameters and then randomly sampling from this distribution to create a model, which is then trained and evaluated using stratified cross-validation. Parameter values and results for the tested algorithm configurations are recorded to then select the best settings. A diagram of how the random search method works is shown in Figure 10. It is worth noting that the method used allows the number of iterations to be adjusted to check the performance of the model regardless of the number of existing combinations of parameter values.