Reputation: 23
Is there a way in python by which I can get contribution of each feature in probability predicted by my gradient boosting classification model for each test observation. Can anyone give actual mathematics behind probability prediction in gradient boosting classification model and how can it be implemented in Python.
Upvotes: 1
Views: 1726
Reputation: 51
Try Shapley values. There is a python package as well which does the approximation and should provide you a detailed breakdown.
Upvotes: 0
Reputation: 6345
Here you go bud, this is exactly what you're looking for :)
https://github.com/slundberg/shap
One note though, you mention you want to see how each feature contributed to a probability which is going to be very hard to do since it's usually a combination of features that is determining the probability. Either way, I think the package above will show you what you want to see.
Upvotes: 0