-1

I am explaining a HistGradientBoostingRegressor from sci-kit learn. I use the TreeExplainer from the shap package to get the SHAP values. My model has 48 features, some of which are strongly correlated. The beeswarm summary plot of the model looks like this:

enter image description here

How is it possible that the SHAP values of some features are consistently negative (or positive) and not centered at 0?

I never saw this anywhere else. Intuitively it does not make sense to me, since the model could just add a constant to avoid the shift.

Mpala
  • 31
  • 4
  • This means if you observe those features you tend to obtain positive or negative outcome. This might well be due to your data input composition. – Sergey Bushmanov May 17 '23 at 15:14

1 Answers1

1

As is often the case, formulating the question helped to discover the answer. The problem arises because i accidentally scaled the data the model was trained on in a different way than the data i passed to the explanation algorithm.

A similar question has been answered on github: https://github.com/slundberg/shap/issues/553

Mpala
  • 31
  • 4