# Contextual Explanations for Decision Support in Predictive Maintenance
## 4 Experiments
### Results  
#### 4.3.1 Basic Representation  
The first part of experiments was performed on the Basic data representation. To verify the quality of the created model, the number of outliers identified in the weeks following model training and preceding machine failure was calculated. The results are presented in Table 1. Common intuition suggests that at the very beginning (just after model training), a relatively small number of outliers should be identified. Whereas, in the period of time preceding a failure the number of identified outliers should be relatively high. The values in Table 1 reflect this intuition only for Failure 1. In case of Failure 2 the number of identified outliers is high from the very beginning. It suggests that the model is not well fitted to the distribution of data registered after Failure 1. Therefore, inferring an impending failure based on the increasing number of reported alarms would be possible for the generated model only before Failure 1. The explanations of selected decisions of the model trained on the Basic data representation are presented in Figure 3. Among the alarms identified by the model, a selection of three cases is presented in Figure 3. Case 1 is an alarm that was reported when the machine was operating correctly, i.e., relatively recently after the model was trained. With insights into the analysed data, it was assumed that an outlier identified after approximately four weeks was reported during correct machine operation. Thus, Case 1 presents example 87 (considering an 8 h aggregation window, 4 weeks correspo \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **T1** & **T2** & **T3** & **F3** & **F2** & **F1** \\ \hline Failure 1 & 3 & 1 & 8 & 21 & 21 & 21 \\ Failure 2 & 21 & 19 & 15 & 21 & 19 & 21 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Number of alarms (outliers) identified in data (Basic 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. instance was identified as the first outlier after four weeks, and the 17 th outlier overall. Case 2 presents the last alarm before Failure 1, and Case 3 presents the last alarm before Failure 2. An explanation of each alarm in Figure 3 consists of four figures (Figure 3A-D). Figure 3A presents a SHAP-based ranking of attribute importance. This is a typical local explanation. It identifies the attributes that have the greatest impact on the model's decision. Figure 3B presents a local context to the SHAP-based explanation presented in Figure 3A. It has the form of a heatmap depicting attribute importance values for the alarm being explained and for the five preceding alarms. This figure (Figure 3B) allows for an assessment of how consistent the explanations for a given data instance are in comparison to those  
Figure 3: Selected SHAP-based explanations of the model decisions and their contexts for Basic data representation—the selected data instances contain the following: alarm from the period of normal machine operation (Case 1), last alarm before Failure 1 (Case 2), last alarm before Failure 2 (Case 3). The figures present SHAP-based attribute importance ranking (**A**), local context heatmap (**B**), global context for the most important attribute indicated by SHAP (**C**), global context for the second most important attribute indicated by SHAP (**D**). of examples that occurred at a similar time. It is of particular importance if the model based on outlier identification is used, as it visualises whether a class labelled as alarm has consistent explanations at a given time. In addition, this figure may help to identify an outlier among the outliers if a particular instance deviates significantly from the alarms immediately preceding it. Finally, Figure 3C,D present the global contexts to the SHAP-based explanation presented in Figure 3A. The global context is generated for each attribute independently.