# Contextual Background Estimation for Explainable AI in Temperature Prediction
## 2 Materials and Methods
### Summary of Methods and Scenarios of Use  
For now, the traditional XAI methods are usually used only as means to understand certain decisions without context. Both of the methods presented here reveal new ways to enable conscious use of background for **contextualized** situations. Authors of [51] used XAI in contextualized situations. They proposed two methods that do not require backgrounds at all. However, those methods can only be used with propagation-based methods (such as LRP) and neural networks and thus cannot be used with Shapley values. Nevertheless, the authors open an important discussion about contextualized use of XAI. The two methods described in this article are the first methods that enable estimation of impact of background on explanations provided by XAI, which can be used for every ML model as they work with model-agnostic XAI methods such as Kernel SHAP. The methodsaim to provide better explainability and reduce uncertainty regarding black-box models. For example, the methods could be used in the following scenarios:  
* The local power supplier predicts power demand for the next day at 8:00, which is equal to 180 MW. The prediction is unusually high and the supplier wants to make sure that the prediction is valid. The user wants to know why the model changed prediction to 180 MW while the expected level for this hour and time of year is 150 MW. This is a contextualized situation, so it is not possible to simply use XAI method with a default base value to find answers. The user can apply Mean Background Method, assuming \(y_{e}=180\) MW and \(y_{b}=150\) MW. Out of the entire dataset, the mean background is created and XAI method is applied. It turns out that the extreme rise in temperature on the previous day is mainly responsible for the shift; it comprises 80% of the shift. Humidity is second most important variable. It comprises 10% of the shift from 15 MW to 18 MW. Based on the historical data and expertise knowledge, the supplier can believe this prediction. However, the supplier has doubts whether XAI method provides viable results. The background used requires verification, so the Background Estimation Method is applied. The results show that the importance of temperature was not changing radically depending on background used, while the importance of humidity was fluctuating strongly from 2% to 17%. The user still decides to trust the prediction since the utility for temperature is much higher than the utility for humidity. Even though the importance of humidity experiences fluctuations, its importance is low, while temperature is much more important and its importance is stable. The power supplier can use a precise and reliable model to steer efficient power production, thus meeting the demand. * A microgrid is supplied with energy by a local wind farm. It is crucial to predict how much power will be created by the wind farm and how much should be ordered from a utility distribution network to need demand. It is predicted that the wind farm will generate 10 MWh, as opposed to 17 MWh, which was generated a day before. The user wants to know whether this is a viable prediction. XAI method cannot be used for that in a traditional way since this is a contextualized situation and the user wants to know what caused the shift from 17 MWh to 10 MWh. New base value is required. It can be achieved with Mean Background Method. It is applied with \(y_{e}=10\) MWh and \(y_{b}=17\) MWh over entire dataset. It is known that certain features were important to create the shift from 17 MWh to 10 MWh--wind speed (50%), air density (20%), temperature (10%), and humidity (5%). However, after applying Background Estimation Method, all features are assigned with low utility--below 25 a.u. After thorough investigation of results from the Background Estimation Method, it was noted that there are few groups of backgrounds. The user decided to use the Background Estimation Method again but this time using only one group of backgrounds for it--the one that includes the day before the original prediction.