Forum Discussion
Shap value visualization in power bi
Hi
I am trying to visualize the output of a prediction model.
I have features, and these features produce a probability of the target. The output also includes the shap value of each feature, meaning the influence it has on the probability of the target.
The visualisation looks like this:
Each line is a feature and each bubble represents an observation. The colors indicate the value of the feature. The influence is on the X-axis.
EG. the first feature, seniority in company: red means higher seniority and blue means lower seniority. The chart shows that lower seniority has a positive impact on the probability of the target, whereas higher seniority has a negative impact.
I am not able to find a PBI visualisation capable of showing this? Any siuggestions? Anyone who has developed something alike in python and imported it in pbi?
23 Replies
- jvandyckHelper IV
any update? Thanks!
- sotherNew Member
Hey,
I'd be highly interested in a solution as well!
Has somebody achieved to visualize it?
@@jvandyck: Unfortunately, the sample data is not accessible anymore.
Best
- lbendlinSuper User
Does it have to be Python or can it be Vega Lite/Deneb too?
- jvandyckHelper IV
anyone?
- lbendlinSuper User
in your sample data what is the meaning of positive_probs ?
This is what I have so far. Not sure how you are color coding and how you are sizing the bubbles.
- jvandyckHelper IV
This already looks pretty good!
The postive_probs col lists the probability of the predicted event. The _shap cols give an indication of the influence on the probability. This is what I would like to see on the X axis, as you already did. The thing missing is the color coding on each line, which would have to indicate the value itself. Let's take age as an example. The X axis shows the age_shap value. Color coding should be applied to the bubbles, based on the actual age of each observation. This way the graph would tell me eg whether high age has positive influence on the prediction. I hope this clarifies?
- qqqqqwwwweeerrrSolution Sage
HI jvandyck
Long back i have tried to create this but shap value is model output and even if you use python in power bi, i wont work because the libary does not suppurted by power bi.
Not sure if current version of power bi able to install that libary, if not then it is not possible for create shap value visualisation with current capabilites.
Regards
- jvandyckHelper IV
We did get it working on power bi desktop using python visuals, using the shap package. However on PBI service it does not work, probably because the shap package is not supported on PBI service. I have posted an idea to include it: https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=2e5526e6-50f6-ee11-a73d-000d3a7ade4a. Please vote for it!