# Contextual Explanations for Decision Support in Predictive Maintenance
## 4 Experiments
### Results
#### 4.3.2 Extended Representation  
For the Extended data representation, similar analyses to those presented above were performed. Table 2 presents the number of outliers identified in the weeks following model training and preceding machine failure. The model based on the Extended data representation did not improve the distinction between the period of normal machine operation and the period prior to the machine failure. In the case of Failure 1, the number of alarms is only slightly lower during normal operation, and there are no significant differences between the two periods in the case of Failure 2. The Extended representation contains many attributes that are hardly informative to the machine operator. Consequently, additional processing is required to derive explanations of the model decisions that are understandable to the user. Therefore, the explanations generated by SHAP as the importance value of the derived attributes were aggregated to the basic attributes associated with the recorded measurements. Different aggregation functions were applied and evaluated. To select the best method of aggregation, the SHAP rankings determined for the Basic representation were chosen as a reference point. Table 3 presents Pearson correlation and root mean square error (RMSE) values assessing the similarity of the SHAP rankings for the two representations. The worst of the methods compared in Table 3 was Median, while the most stable quality results were obtained for Max. Among the best results obtained were those generated for the Sum function and this aggregation function was used in further analyses. The explanations for selected decisions of the model trained on the Extended data representation are presented in Figure 4. The analysis procedure mirrors that of the Basic representation (Figure 3). Therefore, a selection of three cases is presented in Figure 4. Case 1 is an alarm reported when the machine was operating correctly, i.e., relatively recently after the model was trained (approximately four weeks). For Extended representation, Case 1 refers to example 87, which was identified as the first outlier after four weeks, and the 48 th outlier overall. Case 2 presents the last alarm before Failure 1, and Case 3 presents the last alarm before Failure 2. The SHAP-based explanations of the true alarms (Case 2 and 3) presented in Figure 4 A are not perfectly correlated with the conclusions drawn from the analysis of the measurement characteristics. For Case 2, the attribute associated with the C122 sensor is the most important. The attributes associated with the C123 sensor (which, based on measurement characteristics, seemed to be important before Failure 1) are ranked next but their importance is significantly lower. In Case 3, as expected, the attributes associated with the vibration measurements from the C122 sensor are the most important. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **T1** & **T2** & **T3** & **F3** & **F2** & **F1** \\ \hline Failure 1 & 4 & 13 & 17 & 19 & 20 & 17 \\ Failure 2 & 21 & 20 & 20 & 21 & 21 & 21 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Number of alarms (outliers) identified in data (Extended representation) collected before Failure 1 and afterwards until Failure 2; \(Ti\) represents week number after model training (when the machine is operating correctly), \(Fi\) represents week number before failure. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & \multicolumn{4}{c}{**Correlation**} & \multicolumn{4}{c}{**RMSE**} \\ \cline{2-9}  & **Sum** & **Max** & **Mean** & **Median** & **Sum** & **Max** & **Mean** & **Median** \\ \hline Failure 1 & 0.22 & 0.54 & 0.22 & \(-\)0.05 & 8.50 & 7.11 & 8.51 & 9.29 \\ Failure 2 & 0.87 & 0.48 & 0.87 & 0.06 & 2.92 & 7.28 & 2.91 & 8.27 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Evaluation of similarity between attribute importance rankings determined for Basic and Extended data representations. The local context of the SHAP-based explanations is presented in Figure 4B.