# Contextual Background Estimation for Explainable AI in Temperature Prediction
## 3 Results
### Evaluation of Mean Background Method  
The datasets from the IMGW stations were used to calculate Shapley in combination with the Mean Background Method to explain the prediction for 15 July 2021 at 01:00:00. To show the difference in explanation between the backgrounds, multiple values of \(y_{b}\) were selected. Different numbers of \(y_{b}\) were used depending on the dataset. For each station and each dataset, only integer temperatures \({}^{\circ}\)C, with the margin of 0.1 were used as \(y_{b}\). The base value changed because only those temperatures present in each dataset were considered. The mean backgrounds were created for each integer temperature in \({}^{\circ}\)C present in the entire dataset, with a margin of 0.1. Shapley values were calculated for each background using Kernel SHAP and timeSHAP. The results for four stations (352140310, 352150300, 351190469, and 351160424) are presented below in Figure 7. The margin could be modified. Ideally, it should be equal to 0 to include only the time-series sequences that result in prediction equal to \(y_{b}\). However, this is not realistic regarding regression-based problems, when predictions are rarely equal to one value. This is why a small margin needs to be added to include backgrounds from the vicinity of \(y_{b}\). The number of backgrounds varied by station. Specifically, for stations 352140310, 352150300, 351190469, and 351160424, the background numbers were 52, 50, 56, and 53, respectively. Each background corresponds to a different base value \(y_{b}\). Additionally, the actual background predictions (Act. bg pred. ), the sum of Shapley values (Shap. vals. sum), and the sum of these two quantities are provided. The actual background prediction refers to the prediction obtained using the created mean background. If a specific mean background (\(b\)) is associated with a particular \(y_{b}\) value, the prediction \(f(b)\) can either closely approximate \(y_{b}\) or be equal to it. This explains why, in all the figures, the actual background prediction exhibits a linear trend with the temperature \(y_{b}\), which is shown on the x-axis. Nevertheless, slight fluctuations are visible, particularly at the extreme values of the predictions, but not exclusively. For instance, in \begin{table}
\begin{tabular}{l c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Metric Name**} & \multicolumn{8}{c}{**Dataset Name**} \\ \cline{2-13}  & **Jena** & **IMGW** & **IMGW** & **IMGW** & **IMGW** & **IMGW** & **IMGW** & **IMGW** & **IMGW** & **IMGW** & **IMGW** \\  & **351180455** & **352200375** & **353170235** & **349190650** & **351190469** & **352140310** & **352150300** & **351160424** & **353200272** & **354160115** \\ \hline Mean Absolute Error & 0.73 & 0.77 & 0.76 & 0.70 & 0.65 & 0.77 & 0.78 & 0.71 & 0.87 & 0.74 & 0.68 \\ Mean Squared Error & 1.04 & 1.11 & 1.12 & 0.94 & 0.81 & 1.15 & 1.12 & 0.93 & 1.39 & 1.06 & 1.01 \\ Root Mean Squared Error & 1.02 & 1.05 & 1.06 & 0.97 & 0.90 & 1.07 & 1.06 & 0.96 & 1.18 & 1.03 & 1.00 \\ \(R^{2}\) & 0.99 & 0.98 & 0.98 & 0.99 & 0.98 & 0.98 & 0.99 & 0.98 & 0.98 & 0.98 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Metrics used for evaluation of the models. Figure 7a, the predictions of the background slightly deviate from \(y_{b}\) in the vicinity of 1.5 \({}^{\circ}\)C.  
However, for the presented datasets, these fluctuations are neither significant nor frequent, so users cannot reliably assume that a mean background created for a given \(y_{b}\) will always result in predictions equal to \(y_{b}\). This introduces potential uncertainties in the explanation of the model.