Forum Discussion

jvandyck's avatar
jvandyck
Helper IV
2 years ago

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

    • sother's avatar
      sother
      New 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

  • Does it have to be Python or can it be Vega Lite/Deneb too?

    • lbendlin's avatar
      lbendlin
      Super 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.

       

       

       

      • jvandyck's avatar
        jvandyck
        Helper 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?

  • 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