## 2 Data Collection and Preprocessing
### Metrics and Validation  
The selection of an appropriate data preprocessing method, as well as the machine learning algorithm and its hyperparameters, is possible after a series of trials testing the performance of the model for different settings. In order to analyze effectiveness, it is required to determine performance metrics that most reliably reflect the actual behavior of the model in the face of new data. In properly functioning systems, faults are sporadic events, the frequency of which depends on the depletion of the device, the maintenance performed, and the intensity of use. It follows that among the operating data of the drive system, failures will be a significant minority of the normal operation samples. In such a case, the algorithm can be trained to obtain a very good percentage of correct classifications (it will correctly classify most samples), but not actually detect a single failure (samples marked as normal operation will be correctly classified). Therefore, verification of the model's performance cannot be obtained only on the basis of accuracy, i.e., the percentage of correctly classified samples. Developing an effective fault identification model requires finding the right compromise between precision and sensitivity. It is essential that the model detects as many faults as possible while generating few false alarms. A measure that reflects the ratio between sensitivity and precision is the F1 score. The F1 score calculated for each label, and finding unweighted mean, was used to analyze the performance of each classifier model. Data preprocessing method tests that allow reducing the amount of data used for modeling were carried out using simple machine learning algorithms, such as linear regression, logistic regression, and decision tree. The selected algorithms form the basis of more advanced methods, which improve them while allowing them to reduce the overfitting and underfitting. It was assumed that if improvements in the performance of simple algorithms are obtained, better results would be obtainable by the methods that constitute their improved versions. In addition, the algorithms used, due to their simplicity, also provided fast learning, which allowed many trials to be carried out in a relatively short time. In order to develop an effective model for identifying faults in cabin door drive systems, it is necessary to carry out a number of trials to identify the data preparation method and the set of hyperparameters of the machine learning algorithm for which the fault detection error will be the smallest. However, it should be borne in mind that if during each trial, the performance of the algorithms will be checked on the same test set, then, as a result, the selected model will become the best but only for this particular set and may prove to be inadequate for predicting new samples. The test set has a certain limited size and will never be able to reflect all the relationships that were present in the training data. Therefore, it can be concluded that the model's ability to generalize will be poor when it is prepared for a specific case of the test set. This means that the model will be biased, and its effectiveness for new test samples will be low. One solution to this problem may be to use a division into three subsets: training, validation (used to select hyperparameter values), and testing. However, the use of this method requires a significant number of samples, and in addition, the accuracy of the predictions may still depend on some random selection of the dataset split points. In practice, cross-validation is the most commonly used and extremely effective method to avoid problems with generalization accuracy. Stratified k-fold cross-validation was used to determine the performance of the model during the conducted tests. This method involves dividing a dataset into k equal parts and then teaching and testing the algorithm k times, with each iteration training the algorithm on k-1 subsets while the remaining subset is used for validation.