# Contextual Background Estimation for Explainable AI in Temperature Prediction
## 1 Introduction
### Significance of Machine Learning in Power Systems
features from \(\mathbf{x}\), including subset of all features \(\{x_{1},\ldots,x_{i_{max}}\}\)--which is equal to \(\mathbf{x}\), and no features \(\{\mathcal{O}\}\). \(\mathbf{x}_{\mathcal{S}}\) is the data point \(\mathbf{x}\) where only features in \(\mathcal{S}\) have been retained. Shapley value is calculated with the following equation:  
\[\varphi_{i}=\sum_{\mathcal{S}|i\
otin\mathcal{S}}\alpha_{\mathcal{S}}\cdot[f( \mathbf{x}_{\mathcal{S}\cup\{i\}})-f(\mathbf{x}_{\mathcal{S}})] \tag{1}\]  
where \(\alpha_{\mathcal{S}}=|\mathcal{S}|!(i_{max}-|\mathcal{S}|-1)/i_{max}!\). This equation tests different subsets of features that the model uses. Each time the feature is not included in a subset, a certain value is used to replace it. Usually, mean values calculated over entire dataset for each feature are used as replacements. Calculating Shapley values is expensive computationally, so Kernel SHAP is used as an approximator. Kernel SHAP is not the only XAI method that can be used with the methods presented in this article. Those two methods could be applied with a different XAI method that uses base values and provides importance for each feature. For each feature \(x_{i}\), Kernel SHAP estimates its importance as Shapley values \(\varphi_{i}\), quantifying the contribution of the feature to the model's predictions. So, if there are \(i_{max}\) features, there are also \(i_{max}\) Shapley values. Shapley values have a unit of target. So, if the model predicts temperature, then each Shapley value provides importance in the unit of temperature. XAI could be employed to explain the prediction of electrical load, one of the most rudimentary challenges in the field of power systems [36; 37; 38]. It would be important to understand what exactly defines and influences power demand, such as how much it depends on the temperature, humidity, or other meteorological features, and how much on geography, seasonality, or changes in energy prices. Understanding the importance and dependency of the features would also make the models safer to use [39; 40; 41]. There are numerous different statistical and machine learning approaches that lead to more accurate predictions of the electrical load [42; 43]. Electrical load prediction is a regression-based problem that is usually divided into four types: very short-term load forecasting (up to one day), short-term load forecasting (up to two weeks), medium-term load forecasting (up to three years), and long-term load forecasting (over three years) [44]. Models that predict electrical load use time-series sequences. Based on several steps from the past, they can forecast several steps forward. Recurrent neural networks, such as Long Short-Term Memory (LSTM) neural networks, are often employed to predict power demand [45]. Meteorological data are the most important data that can be used to predict electrical load, notably temperature, which is highly correlated with electrical load [46]. Building on the above, this article focuses on temperature and meteorological data.