# Explaining Deep Learning Models for Tabular Data Using Layer-Wise Relevance Propagation
## 3 Proposed Approach
### Validating the Correctness of LRP's Highlighted Subset of Features  
We used three XAI techniques for an explanation of features. LRP uses a heatmap to highlight the processed features that have most contributed to the model decision. To validate that the set of features highlighted by XAI techniques (mainly LRP) are genuinely influential on model decisions, we use the highlighted features, with the original dataset labels, to train a simple classifier e.g., Logistic Regression, RF, SVM, and see whether the 1D-CNN and/or some simple classifier can generate better or equal results with the subset of discriminative features highlighted by XAI techniques. Achieving comparative prediction results will prove that the features highlighted by LRP represent the decision-driving features in the dataset. Rather than manually selecting the highlighted features in the heatmaps, we propose a method that takes account of LRP values for each instance in the dataset, summing to a global ranking for each feature at a dataset level. Our approach assumes that all classes are equal weight--i.e., that both labels TP and TN are of equal importance when producing the final feature ranking. In this approach, we first ranked the features and then did a subset selection of features using a threshold as explained below:  
Let \(M\) be an \(nxm\) matrix composed by row vectors \(v_{i}=\langle l_{1}^{i},...,l_{m}^{i}\rangle\), \(i=\{1,...,n\}\). Each vector \(v_{i}\) represents the LRP values \(\langle l_{j}^{i}\rangle\) of each one of the \(n\) records from the test set for each feature \(j\) of the model, where \(j=\{1,...m\}\). For each feature \(j\) (column), the coefficient of variation \(CV_{j}=\frac{sd(\langle l_{j}^{i}\rangle-l_{j}^{n})^{T})}{mean(\langle l_{j}^ {i}\rangle-l_{j}^{n})^{T})}\) is calculated. Then the threshold is the mean (\(\mu_{j}\)) of the feature \(j\) with the smallest positive \(CV\). The idea is to define a value that represents the positive mean of the feature with the lowest dispersion. Initially, the selection was done by visualising the boxplot chart by columns of the matrix of LRP values. We then set out the method in the following steps to pave the way to automation:  
1. Set a threshold value \(t\) to be used. This threshold represents a cut-off LRP value above which a feature is determined to have contributed to an individual correct test instance. 2. Select all instances (with their LRP vectors) that were correctly classified as True Positive (TP). 3. Apply the threshold \(t\) to the relevance values of each feature \(j\) of a record in the true positives and true negatives, converting the feature value to 1 if at or above the threshold, else 0. This is \(\{l_{j}^{i}\}\geq t\Rightarrow 1\) and \(\{l_{j}^{i}\}<t\Rightarrow 0\). 4. Sum the rows which have had features converted with 0 or 1, resulting in one vector \(r\) of dimension \(m\), where \(m\) is the number of features. \(r=\langle\sum_{i=1}^{n}l_{1}^{i}...\sum_{i=1}^{n}l_{j}^{i}...\sum_{i=1}^{n}l_{m}^ {i}\rangle\)
5. Sort this vector based on the summed values for the features, to produce a numeric ranking of features
6. Repeat Steps 2-5 for the True Negative (TN) records
7. Select a total of 16 features (top 8 from TP vector and top 8 from TN vector). In case of an odd number, more are selected from TP (one less from TN features). This is the approach that we have adopted for the thresholding and selection of the features. However, more sophisticated techniques, such as allowance for class weighting or merging of LRP values across classes prior to ranking, can be adopted for selecting the features. The relevance values are all in the range of 0 and 1 (note, the relevance values are all in 0 and 1, whereas the heatmaps in Figures 4 and 5 shows between \(-1\) and \(1\), this is only for better visualisation purposes. Otherwise the values are all in 0 and 1). Therefore, the threshold must be with in the range of 0 and 1 e.g., 0.4, 0.5.