The context: explaining a binary classifier XGBoost model.

If we say that we are limited to the LIME and Shapley Additive Explanation aka "shap" package, is there any reason to use LIME? My impression is that LIME is a flawed, half-solution to the problem of explaining machine learning models, that may have been "better than nothing" a few years ago, but has now been superseded Lundberg's shap package/methodology. Which addresses the shortcomings of LIME. Can anyone think of reasons to use LIME?

  • 2
    $\begingroup$ Does this answer your question? Comparison between SHAP (Shapley Additive Explanation) and LIME (Local Interpretable Model-Agnostic Explanations) $\endgroup$ Commented Jul 9, 2021 at 15:24
  • $\begingroup$ It does in that it lacks any definitive defense of LIME, and brings up the consistency property, which I consider to be quite devastating against LIME. I'm hoping someone can make a compelling case for using LIME, to challenge my current prior against it. So far all I have seen are undefended claims that it's good in concert with shap, nothing with a compelling example, of why LIME is useful. $\endgroup$
    – JPErwin
    Commented Jul 9, 2021 at 15:55
  • $\begingroup$ What type of SHAP? Kernel, tree-, deeplift, ... The theoretic SHAP enjoys many nice properties but is unfeasible to calculate in practice. $\endgroup$
    – Michael M
    Commented Jul 12, 2021 at 15:16
  • $\begingroup$ TreeSHAP, will only be working on XGBoost binary classifiers $\endgroup$
    – JPErwin
    Commented Jul 12, 2021 at 19:38
  • 1
    $\begingroup$ Major flaw of any method that try to build an explanation by constructing an other model is so called infinite-regress. That, who is going to explain the explainer model. This is a bit philosophical. But causal models would be preferable where explanations are needed in the first place or models that can answer counterfactual queries. $\endgroup$ Commented Aug 21, 2021 at 13:49

1 Answer 1


I wouldn't say that LIME is a flawed half-solution and that SHAP is a perfect full solution.

If anything, I would say both solutions are inherently flawed but perhaps are the best we have. If you are going to use a locally correct linear approximation of your machine learning model for the purpose of explaining predictions, then I would choose whichever software tool has the least bugs and most features that you like. Perhaps SHAP offers some theoretical properties which LIME doesn't, but it's not clear that these imply correctness of explanation. Perhaps they disallow some kinds of fishy explanations.

Most people are looking for a quick-fix for understanding their models, and LIME and SHAP do that. Sometimes regulators even require it. Does that mean you truly understand your models? I don't think so.

I don't see any reason to use LIME over SHAP unless the idea of locally approximating a function with a linear function and creating augmented examples for the purpose of training appeals to you.

Besides for that, I would recommend not using SHAP or LIME if your data is not always (especially if locally - I can think of some examples like if you're using categorical features with int encoding) linear.

I think a fair approach to model explanations is one which is very broad and approaches the question from many different angles. Are you looking to see whether there are hidden confounders? unfair biases? There are a lot of sources and usually it is recommended to use a broad range of solutions in order to understand your models and it is not as simple as choosing between lime and shap. Here is an example of IBM explaining their approach https://www.ibm.com/watson/explainable-ai


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.