New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to interpret the Shop force plot? #977
Comments
Hi, I will try to respond in the order of the questions asked.
|
Hi @ibuda - Just a quick question regarding point 1 of your response. Because -2.92 is less than 0, so the final predicted output for this observation (4100) is class 0. Am I right? |
In general, yes and no. Even though it is lower than the base value of 0.6427, it might be 1 for some cases. I've seen this happen when the training dataset is highly unbalanced. |
Hello All, I have just started learning about Explainable AI and was implementing the SHAP algorithm for that. But I am facing difficulty in interpreting the results of the SHAP force_plot. I will be grateful if someone can help me with an intuitive way of interpreting it. 🙂 🙏 Consider, below force_plot for about 43 test samples of heart_data.
Here is the force_plot for the 10th sample individually and how we can relate it with the above: Here is the link to my notebook - Explainable AI using SHAP |
Hi @vinrok, great to hear that you are using shap. The answers to your questions are:
I looked at your notebook, you did use the For I also suggest you play with the left side drop box as well. And try to use it in combination with the above-mentioned dorp box. Hope that answers your question. If not, do let us know what other questions arise. |
Thank you so much this intuitive explanation @ibuda 😊🙏. |
But @ibuda I am still confused regarding the pink and the blue bands. I mean consider sample order by similarity and f(x). Can we say that for this plot we are putting the patients having the most similar features together? Then in that case how to interpret the prediction in terms of pink and blue and by hovering over it? As for samples in range 8-17, from the test dataset, most of them have the label - 1 (heart disease) but from this plot, the SHAP value goes below base value. |
I think you are confusing predictions with Y_test. Shap gives you info on what your model predicted, not what the real value is supposed to be. That is why you get that discrepancy. Anyways, the blue band is what features and how much are dragging the final output value down (to 0 class), and the pink bands are those that increase it (up to 1 class). Try to look at your notebook with this in mind, and let me know if that helps. |
Got it @ibuda The idea is somewhat clear to me now. 😊 |
Hi @SSMK-wq, for the sake of consistency, if your questions were answered, please consider closing this issue. Thank you. |
Hi, you mentioned this -2.92 is the raw output and it can be transformed into probability space. But how can I do such transformation? I encountered the same question. My prediction model is LightGBM and I am using shap.TreeExplainer(). Or maybe you could give me a hint where I can find the transform equation? |
These values are log-odds due to this example being a (binary) classification task. You can easily revert them:
|
How to interpret below shap Force plot ? I am trying to plot a force plot with all points in my data, but having difficulty in its interpretation and understanding below plot. In my case - Demand value in my dependent variable and Adobe Visits is my independent variable. What does the dropdown on x axis means? Can someone please help on this ? |
Hello @prashanthin, Did you find any answer ? Regards |
This answer was the game changer in my case. Thanks a lot! |
Hello Everyone,
I am trying to practice and learn shapley value approach to explain my predictions on a binary classification problem. However am having difficulty in understanding the below plot.
Does it indicate the
day_2_balance
influences prediction to 1? or does blue values leads to prediction 1What about the axis scale?
(-4.357 to 5.643)
. How is this obtained?What does base value mean?
When I hover around the pink color , I see few more column names with some values. What do they indicate?
does the size of features represent their importance? Meaning
PEEP_min=5
has a larger size than other features?What does
higher to lower and lower to higher
indicate?Why is
-2.92
alone is in bold format? If it's predicted value, how can it be because am working on a binary classification problem withlabel 1
andlabel 0
?Can someone help me with this?
The text was updated successfully, but these errors were encountered: