# Contextual Background Estimation for Explainable AI in Temperature Prediction
## 3 Results
### Evaluation of Mean Background Method
For example, if a user aims to explain why the model predicted 25 \({}^{\circ}\)C instead of 0 \({}^{\circ}\)C, a background created for \(y_{b}=0\) \({}^{\circ}\)C that produces an actual prediction \(f(y_{b})=1\) \({}^{\circ}\)C may not effectively capture the importance of the features driving the change from 0 \({}^{\circ}\)C to 25 \({}^{\circ}\)C.  
The sum of Shapley values also exhibits a linear trend, but it is oriented in the opposite direction. This occurs because the Shapley values indicate how much the base value \(y_{b}\) shifts toward the given prediction \(y_{e}\) that the user aims to explain. As \(y_{b}\) approaches \(y_{e}\), the Shapley values do not need to be large to represent the extent of the prediction shift. The sum of all the Shapley values and the actual background prediction is always equal to a single value--the real prediction for 15 July 2021 at 01:00:00 (\(y_{e}\)). This serves as a verification to ensure that all the calculations have been performed correctly. The value \(y_{e}\) differs for each station as the temperature (and hence the prediction) varies slightly across stations. It is important to note that, when \(y_{b}\) crosses \(y_{e}\), the Shapley values change signs. Prior to the crossing, they were shifting the prediction from a smaller \(y_{b}\) toward a larger \(y_{e}\). After crossing, they shift the prediction from a larger \(y_{b}\) toward a smaller \(y_{e}\) and therefore become negative. It might be easier to interpret after referring to Figure 2 again, knowing that the base value shifts from the lowest values to the highest values, passing \(y_{e}\) along the way. The Shapley values assigned to each of the 12 features are also presented. Additionally, there is a feature labeled 'Pruned Events', which represents insignificant time steps, subtracted by timeSHAP and treated as a separate feature. These 'Pruned Events' do not have any significance but can be used to determine whether timeSHAP was applied correctly. The three most significant features for each station are air temperature, vapor pressure, and relative humidity. For stations (a) and (b) in Figure 7, sunshine duration is also slightly important. What is the most significant in these results is that they clearly demonstrate the high importance of the \(y_{b}\) selection in the calculation of Shapley values. For every station, the Shapley values differ significantly when, for example, \(y_{b}=2\)\({}^{\circ}\)C compared to \(y_{b}=-2\)\({}^{\circ}\)C. The importance of features changes depending on whether the prediction is being shifted from one of these two points toward \(y_{c}\). It is also evident that the importance of features changes gradually over the backgrounds. When \(y_{b}\) is low and the Shapley values need to push the prediction toward a higher \(y_{e}\), air temperature is the most important feature, followed by vapor pressure. Neither relative humidity nor sunshine duration are significant at this point. As \(y_{b}\) increases, vapor pressure, relative humidity, and sunshine duration gain importance. In some cases, vapor pressure becomes more important than air temperature. When the Shapley values become negative, relative humidity becomes more important, sometimes surpassing air temperature, while vapor pressure remains positive. The proposed method, can be used to provide a more thorough understanding of the overall importance of the features during a feature selection. It clearly outlines which features should be kept and which removed. Keras SHAP could also be used to determine that the most important features are air temperature, vapor pressure, and relative humidity. Nevertheless, the Mean Background Method enables understanding how this importance changes with different backgrounds. Each significant feature exhibits minor fluctuations, introducing some uncertainty. This method also does not provide certainty regarding the Shapley values between \(y_{e}\) and \(y_{b}\) predicted with the real time-series sequence from the dataset but only with the average background.