Open Lejboelle opened 11 months ago
but I would like the individually transformed contributions.
Could you please elaborate on this? What do you mean by individually transformed?
but I would like the individually transformed contributions.
Could you please elaborate on this? What do you mean by individually transformed?
So similarly to using other objective functions like psuedohubererror, I would like the sum of the contributions to be equal to 0.2877181 to see how each feature contributed to the predicted value. Edit: Some years ago there was ongoing work on implementing this in SHAP: https://github.com/shap/shap/pull/1041, however, it seems like it never got merged.
TreeSHAP in XGBoost is calculated on "raw" scale, which is the link scale. Like Poisson and Gamma, Tweedie objective uses the log link, so the SHAP values will sum up to the log prediction minus the baseline.
I've trained a model using tweedie regression and would like to make predictions that output the different feature contributions. However, it seems like the contributions are not transformed:
If I run np.exp(np.sum(mdl.get_booster().predict(dmatrix_test, pred_contribs=True))) i get the same result as mdl.predict(), but I would like the individually transformed contributions.
Not sure if it is a bug or it is just not possible?
Thanks.
Environment: Python 3.9 Xgboost 1.7.6