Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to generate SHAP values in Stata for a random forest model?

    I am using the `rforest' package in Stata, and would like to generate the SHAP values to understand the contribution of a feature/variable on the prediction. This can be done in Python using SHAP package (https://shap.readthedocs.io/en/latest/), or in R using its R wrapper (https://modeloriented.github.io/shapper/).
    However, I need to do this in Stata. Any suggestions on existing packages that can implement a SHAP summary plot in Stata? My goal is to create a SHAP summary plot like the one below.


  • #2
    Dear Masud,

    I suppose that you have to run Python and the SHAP package from within Stata. I have no experience with that but, maybe, another Stata-lister can provide the required code to do this.
    http://publicationslist.org/eric.melse

    Comment


    • #3
      Dear Eric,
      Apologies for the late reply. I will check this and get back to you if it works.

      Comment

      Working...
      X