Request Advice on Feature Importance

Hi,

Will anyone give some advice on how to get feature importance out of a model? I have seen partial dependence plots used in tree based models but I need to be able to use it with a pytorch model I have developed.

Any advice on how I can figure out which of my variables are the most important?

2 Likes

Hi,

I assume that the prediction of your model is differentiable with respect to the input. If so, you can compute the expectation of the absolute value of the gradient for the variables. Check this paper out: https://ieeexplore.ieee.org/document/8999179.

I haven’t yet tried it, but github has pytorch/captum project for this, https://captum.ai/

2 Likes

After two years, is still captum the to-go framework to decide what the best features are? thanks

https://pytorch.org/tutorials/beginner/introyt/captumyt.html