# Specific-Input LIME Explanations for Tabular Data Based on Deep Learning Models
## 3 Materials and Methods
### Specific-Input LIME
#### 3.4.3 Partial Dependency Plot  
After the feature importance step, we draw the partial dependency plots of the features that have a greater impact on the model. The partial dependency plot (PDP) describes the marginal impact of one or two features on the expected outcome of a machine learning model [15]. A PDP can determine whether the relationship between the target and the features is a linear one, a monotone one or a complex one. For example, when applied to linear regression models, PDPs will always show a linear relationship. The partial dependence function for regression is defined as  
\[\hat{f}_{s}(x_{s})=E_{x_{c}}\Big{[}\hat{f}(x_{s},x_{c})\Big{]}=\int\hat{f}(x_{ s},x_{c})_{d}P(x_{c}) \tag{9}\]  
The characteristics for which partial dependence function should be drawn are \(x_{s}\), and the other features utilised in the machine learning model, \(\hat{f}\), which are represented as random variables here, are \(X_{c}\). In most cases, the set \(S\) contains only one or two features. The feature in \(S\) for which we wish to know the effect on prediction is that in \(S\). The complete feature space \(x\) comprises the feature vectors \(x_{s}\) and \(X_{c}\). The function reveals the association between the features in set SS we are interested in and the expected outcome by marginalising the machine learning model output over the distribution of the features in set \(C\). By marginalising the other features, we obtain a function that depends solely on features in \(S\), including interactions with other features. The partial function \(\hat{f}_{s}\) is calculated using the Monte Carlo approach, which involves calculating averages in the training data:  
\[\hat{f}_{s}(x_{s})=\frac{1}{n}\sum_{i=1}^{n}\hat{f}\Big{(}x_{s},x_{c}^{i}\Big{)} \tag{10}\]  
The partial function shows us the average marginal effect on prediction for a given value of characteristics \(S\). \(x_{c}^{i}\) is the actual feature values from the dataset for the characteristics we are not interested in, and n is the number of instances in the dataset in this formula. The PDP assumes that the features in \(C\) are unrelated to the features in \(S\). The partial dependence plot illustrates the probability for a specific class given different values for the feature in \(S\) for classification when the machine learning model produces probabilities. Drawing one line or plot per class is a simple technique to deal with several classes. We obtain the turning points of the folds of the feature's PDP graph by means of the feature's partial dependency plot (PDP) and analyse and compute the turning points in detail (see Algorithm 1 for the procedure), and present them together with the results of the LIME analysis to obtain the results of the interpretations at both the global and local levels. In fact, this approach also improves the stability of LIME in two ways:  
(1) Feature space partitioning: By dividing the feature space into different intervals and performing the specific-input function separately in each interval, we essentially reduce the complexity of the prediction task within each interval. This leads to a more reliable approximation of the model's behaviour in each interval, as it is less affected by changes that may occur in other regions of the feature space. (2) Capturing local changes: This method also helps to capture local changes in the model behaviour in different intervals. By running the specific-input function on each interval, we are able to capture the effect on the predicted probabilities of specific feature values varying in different regions of the feature space. This allows us to understand the behaviour of the model at a more granular level than when considering the entire feature space as a whole.