This journal contains some information on papers relating to LIME.
I’m finding that I am not the only person discovering issues with the local assumption made by LIME.
Defining Locality for Surrogates in Post-hoc Interpretablity
This paper is interested in “the importance of defining the right locality, the neighborhood on which a local sur-rogate is trained, in order to approximate accurately the local black-box decision boundary.” They propose a new method for sampling around the pertrubations that is not necessarily centered at the prediction of interest.
Notation
| notation | definition |
|---|---|
| \(\mathcal{X}\) | feature space |
| \(b:\mathcal{X}\rightarrow\mathcal{Y}\) | black-box classifier |
| \(b(x)\) | prediction made by \(b\) where \(x\in\mathcal{X}\) |
| \(X\) | training set used to train \(b\) |
| \(s_x\) | surrogate model that can approximate the local decision boundary of \(b\) from which explanations are extracted |
| \(X_{s_x}\) | training set sampled from the feature space |
| \(Y_{s_x}\) | “labels” associated with \(X_{s_x}\) and computed as \(Y_{s_x}=b(X_{s_x})\) |
| \(\mathcal{V}_x\) | neighborhood around \(x\) |
| \(Acc\) | a measure of accuracy (such as the AUC score) |
| \(LocalFid(x, s_x)\) | measure of local fidelity of \(s_x\) to \(b\) |
| \(x_{border}\) | the closest decision boundary of \(b\) to \(x\) (determined as \(b(x_{border})\not=b(x)\)) |
| \(\mathcal{S}\) | hypersphere used to sample training instances in LS procedure |
| \(r_{s_x}\) | radius of \(\mathcal{S}\) |
Steps in a Surrogate Model Explanation
Comments Relating to LIME
Proposed Locality Metric
The authors propose the following definition for Local Fidelity as “the fidelity of \(s_x\) to \(b\) withing a neighborhood \(\mathcal{V}_x\) around \(x\) as \[LocalFid(x,s_x)=Acc_{x_i\in\mathcal{V}_x}(b(x_i), s_x(x_i))\] where \(Acc\) is a measure of accuracy (such as the AUC score) calculated over instances generated uniformly in \(\mathcal{V}_x\).” Note: This is similar to the locality metric proposed in the original paper. Again, it is comparing the black-box model prediction to the explainer model prediction.
They define the \(\mathcal{V}_x\) of \(x\) using a \(l_2\)-hypersphere of radius \(r_{f_{id}}\) centered on \(x\). They say, “This intuitive definition of locality allows us to make the radius \(r_{fid}\) of the fidelity hypersphere a proxy for the degree of locality considered. Since the radius value is heavily linked to the dimension and density of the input space \(\mathcal{X}\),\(r_{fid}\) will be expressed in the rest of the paper as a percentage of the maximum distance between the instances of the dataset andv \(x\), whose prediction is being interpreted.” I don’t really understand their definition of \(r_{fid}\).
You can also compute this value for all observations in a dataset and then compute the mean and standard deviation to get a feel for how the local fidelity compares across the whole dataset.
The figure below shows their locality metric computed for a specific \(r_{fid}\) (they do not explain how they chose this value) . The image shows that LIME has a more difficult time with the local approximation in the regions where a local approximation is more important. They say, “LIME has trouble approximating areas where the local decision boundary of the black-box classifier \(b\) differs from the decision boundary approximating the whole dataset (ie.features with a local influence vs. features with a global influence).”
Proposed Local Surrogate (LS) Sampling Method
The general idea is that instead of sampling across the whole feature space and then weighting the samples, a local region containing the closest decision boundary will be found and samples will only be drawn in this region.
Steps:
Comment: I feel like this will only work well if there is an observation from the other class “close” to the case of interest.
Heike metioned that the sampling method they are doing is similar to what an SVM is doing.
References to Look Into
This section contains my notes from reading through the paper introduction LORE.
Same idea as LIME: whole decision boundary is complex, but simpler at a local level
Difference from LIME:
Notation from the paper:
General Idea:
Genetic Algorithm: Makes use of fitness functions
Fitness function = A fitness function is a particular type of objective function that is used to summarise, as a single figure of merit, how close a given design solution is to achieving the set aims. Fitness functions are used in genetic programming and genetic algorithms to guide simulations towards optimal design solutions. (from Wikipedia)
sessionInfo()
## R version 4.0.2 (2020-06-22)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Catalina 10.15.6
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## loaded via a namespace (and not attached):
## [1] compiler_4.0.2 magrittr_1.5 tools_4.0.2 htmltools_0.5.0
## [5] yaml_2.2.1 stringi_1.5.3 rmarkdown_2.3 knitr_1.29
## [9] stringr_1.4.0 xfun_0.17 digest_0.6.25 rlang_0.4.7
## [13] evaluate_0.14