## 2 Data Collection and Preprocessing
### Preprocessing Methods  
The first of the data reduction preprocessing methods studied was the sampling rate reduction. To do this, sampling was performed from the original dataset. Then, the performance of simple machine learning algorithms was tested for each of the newly created datasets (sampled with different frequency). Independence from the method of data partitioning was obtained by using stratified five-fold cross-validation. The results of the experiment are shown in Figure 4.  
Figure 3: Sample scheme for 5-fold, stratified cross-validation. Another of the proposed processing methods involved averaging the measurements over a period of time. Analogous values of the period to the previous method were carried over so that it would be possible to compare the effectiveness of classification at a certain level of data reduction. It can be seen in Figure 5 that the use of a simple statistic such as the average makes it possible to improve the performance of error identification especially in the lower sampling frequency range, which is desirable from the point of view of the designed system, as it allows for a reduction in data used for modeling. Considering the improvement in the results obtained by using averaging, the authors proposed a method of preprocessing the measurement data, which involved calculating the moving mean and standard deviation of each measurement for a period defined as the width of the time window, and then adding these values as additional features to the dataset. The schematic of the described processing method is presented in Figure 6. With  
Figure 4: Performance metrics for fault classification by linear regression, logistic regression, and decision tree algorithms at limited sampling rate. Figure 5: Performance metrics for fault classification by linear regression, logistic regression, and decision tree algorithms for the averaging processing method. this method, new features were introduced to define the so-called short-term history of the device. For this purpose, it was necessary to choose one value of the sampling frequency for which the trials would be carried out. Therefore, it was decided to analyze the performance of fault classification for sampling frequencies in the range for which the F1 score during previous tests was the highest. Based on the results of the experiment, it was decided to choose a sampling frequency of 2.3 Hz. During further analysis, the effect of the time window width on the failure classification effectiveness was examined. Figure 7 shows a comparison of the F1 score of fault classification by linear regression, logistic regression, and decision tree algorithms using the proposed processing method involving the addition of new variables representing the mean and standard deviation, calculated for different time window widths and a sampling frequency of 2.3 Hz. In the graph, one can notice the different impact of the window width for the linear methods (linear and logistic regression) and the decision tree. This may be due to the instability of the tree generation even with small changes in the input data (visible especially in the range of the time window width from 7 to 8.4 s). Introducing calculated statistics as new features in the dataset increased the number of features three times. However, given that the new features result in a significant improvement in performance for low sampling rates, it is possible to send three times larger portions of data but at much longer intervals.