# Maintenance Prediction through Sensing Using Hidden Markov Models--A Case Study
## 4 Case Study
### Data Preparation  
The data used for the study were collected by six sensors (responsible for measuring current intensity, hydraulic unit level, torque, VAT pressure, rotation speed, and hydraulic unit temperature), which collect an observation every minute. The data collected are from August 2017 to October 2020. Thus, the data used were acquired over three years and three months (Table 2). Table 2 shows that there is a dataset with 10,264,320 observations. However, as we referred above in the theoretical framework, there are always errors in sensor data collection and, therefore, not all data in this dataset are valid. According to [PERSON] et al. [54], data cleansing should be based on knowledge of technical errors and expected ranges of normal values. As such, through a data collection confidence index, it was possible to verify whether the collected values were valid or not. This confidence index is a protection of the data acquisition system, which through just two values (0 or 100) indicates the quality of the data. Regarding the implementation of this system, there are not many details as it was installed by a tertiary company. If the index had a value of 100, it meant that the data had been well collected and they were valid, and when the index had a value of zero, it meant that something had happened with the data collection and, as such, they were considered invalid. Therefore, it was decided to eliminate all points whose confidence index was equal to zero. In addition to this data cleaning, it was also decided to make an imputation of the total mean of the data signal, whose values from the current intensity, torque, VAT pressure, and rotation speed sensors were below a certain threshold. In this way, we guarantee that we can remove the equipment shutdown and to replace them by the respective average of each signal. Therefore, the equipment shutdowns will not affect the prediction of the model. The value imputation was performed, which is the most used, according to the most usual referred in literature, as can be seen, for example, in [23; 31; 55]; the most general opinion supports this approach when the data of a variable is missing. Based on this approach, \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Equipment**} & \multirow{2}{*}{**Sensors**} & \multirow{2}{*}{**Metric**} & \multicolumn{2}{c}{**N\({}^{\circ}\) of Data**} & \multicolumn{2}{c}{**N\({}^{\circ}\) of Data**} & \multirow{2}{*}{**TOTAL of**} \\  & & & **by Day** & & & **by Year** \\  & & & **(Each** & **(Each** & **Data (Each** \\  & & & **Sensor)** & **(Sensor)** & **(Sensor)** \\ \hline \multirow{5}{*}{**Drying**} & Sensor\(-1\) & \multicolumn{2}{c}{Hydraulic unit Temperature} & & & \\  & Sensor\(-2\) & \multicolumn{2}{c}{Hydraulic unit level} & & & \\  & Sensor\(-3\) & \multicolumn{2}{c}{Rotation speed} & & & \\  & Sensor\(-4\) & \multicolumn{2}{c}{Torque Press} & & & \\ \cline{1-1}  & Sensor\(-5\) & \multicolumn{2}{c}{Current intensity} & & & \\ \cline{1-1}  & Sensor\(-5\) & \multicolumn{2}{c}{with endless} & & & \\ \cline{1-1}  & Sensor\(-6\) & \multicolumn{2}{c}{VAT Pressure vat} & & & \\ \cline{1-1}  & & & & & \\ \cline{1-1}  & & & & & \\ \cline{1-1}  & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Used sensors: Number of data collected. some care was considered: when a slice was replaced in one of the signals, the others were all replaced by their respective mean, increasing the integrity of the data set. No further data cleaning is performed as the following data processing models themselves complement the \"filtering\" of the dataset. In Figure 2, we can graphically compare the data set with all the values, with the valid values and without pulp drying press downtimes. Through the confidence index, 69,840 data were eliminated, leaving a data set of 1,640,880 per sensor. Regarding equipment shutdowns, these were replaced by the average of each signal and, therefore, the value of 1,640,880 remained unchanged.