# H2o interpretability - LIME

I have trained a model to predict heart attacks using random forest algorithm using H2O.

I have good performance in cross validation.

Now, I want to give more interpretation to the predictions in a test set, I used Lime and I followed this tutorial: https://kkulma.github.io/2017-11-07-automated_machine_learning_in_cancer_detection/

Everything works fine, now the issue is that I want to understand each explanation for each case, which means:

1. What means Support?
3. Interpret each rule given by the explanation example (2800 < dias_patologia_diabetes).
4. What means explanation fit?

Attached the plot of 2 cases (those that have) more probability.

• Hi, @Jasam, I don't think I'll have time to write a neat answer before the weekend, but have you checked Thomas Pedersen's overview of the LIME package? It gives you a very detailed description of how LIME works and what different metrics refer to. It should be a good start, at least Commented Jun 27, 2018 at 21:39

3. LIME will discretize numerical features internally. Here, the continuous feature dias_patologia_diabetes was discretized in such way that we have a new variable (2800 < dias_patologia_diabetes) that when it is true, the feature dias_patologia_diabetes is above $2800$. Because this variable is true, the estimate for Case 1 is driven approx. 0.075 lower than the average predicted probability in the whole sample. Similarly, because fuma=N the estimate for Case 1 is driven approx. 0.0125 higher than the average predicted probability in the whole sample, etc. When we add all the contributions together on the average performance we get our final estimate.
4. "Explanation fit" refers to the $R^2$ of the linear model that is fitted locally to explain the variance in the neighbourhood of the examined case. An $R^2$ of about 0.25 is generally OK to get a basic idea but I would not trust that explanation too much. Remember that using LIME we are fitting a "simple" model on top of "complex" model. We then assume that our local approximation of the simple model is faithful to the behaviour of the complex in the vicinity of the case we examine. If that approximation is bad, then our explanation is unreliable.