# Contextual Background Estimation for Explainable AI in Temperature Prediction
## 1 Introduction  
### Significance of Machine Learning in Power Systems  
Over the past few decades, technology has rapidly advanced in areas such as smart grids, renewable energy sources, and distributed generation [1, 2, 3, 4, 5]. Forecasting has become a critical focus in these fields, gaining significant attention for its potential impact [6, 7, 8]. Machine learning (ML) models have been introduced to enhance system resilience, improve stability, and achieve financial savings [9, 10, 11, 12]. Moreover, these models have been employed to analyze complex phenomena in power systems, leveraging their capability to capture non-linear relationships [13]. There are numerous ML algorithms that can be used for different purposes and different datasets. A few of the most notable branches of ML are deep-learning, classification [14], regression [15], and clustering [16]. They have many applications for computer-vision, safety [17], forecasting [18], and disease detection [19], among many others. All those ML branches are used in power systems; however, regression-based problems for forecasting are the most rudimentary for their capabilities to reduce contingency and enable better planing. A growing body of research underscores the critical importance of explaining ML models [20; 21], with Explainable Artificial Intelligence (XAI) gaining increasing prominence. This is particularly crucial for ML models used in power systems, where a clear and comprehensive understanding is necessary before deploying them in sensitive and fragile networks [22]. Amid the pressing challenges in this field, XAI serves as a vital tool, providing valuable insights and practical information about the factors influencing various phenomena in power systems. XAI methods are being developed at a rapid pace. They can be divided into several categories depending on the purpose and application. The categorization of some of the well-known methods is visualized in Figure 1. The main distinctions are as follows:  
1. **Model-agnostic** or **model-specific**--If the method can be applied to any type of ML model, then the method is model-agnostic. On the other hand, if the method is designed for one type of ML model, then it is model-specific. Examples of the model-specific method include Integrated Gradient [23] and Layer-Wise Relevance Backpropagation (LRP) [24], the latter of which is designed to explain the decisions made by neural networks. The model-agnostic method includes ELI5 [25], Kernel SHAP [26], and LIME [27]. 2. **Local or global--Global XAI methods can explain the entire scope of the decisions the model can make, even for non-existing cases. In other words, it explains the behavior of an entire model. In contrast to that, local XAI methods explain only the particular decision made by the model. The global methods include, for example, Global Surrogate Models [28], Permutation Feature Importance [29], and Partial Dependence Plot [30]. LIME and Kernel SHAP are examples of local methods. **
3. **Intrinsic (ante hoc) or post hoc--Post hoc methods include those methods that can be used after model training to explain its behavior. Contrary to this, a model is intrinsically explainable if it is explainable 'by design'. Simple models such as linear models [31] and decision trees [32] can be explained without any exterior method [33]. Grad-CAM [34], LIME, and Kernel SHAP are examples of post hoc methods. **  
The method that is used much more often than others for power systems is Kernel SHAP [20; 26; 35]. It is a post hoc, local, and model-agnostic method. This article presents results obtained with this method. Kernel SHAP is an approximation method. Its aim is to approximate Shapley values. A Shapley value, calculated for feature \(i\), is defined as follows. Let sample data point \(\mathbf{x}\) from the dataset consist of \(i_{max}\) features. \(\mathcal{S}\) is a set of all combinations (coalitions) of  
Figure 1: Categorization of some XAI methods.