dreamquark-ai / tabnet

PyTorch implementation of TabNet paper : https://arxiv.org/pdf/1908.07442.pdf
https://dreamquark-ai.github.io/tabnet/
MIT License
2.61k stars 485 forks source link

visualizing feature importance score with pretrained model #411

Closed sunggukcha closed 2 years ago

sunggukcha commented 2 years ago

Feature request

visualizing feature importance score with pretarined model. for now, following https://www.kaggle.com/code/optimo/tabnet-with-loop-feature-engineering-explained/notebook and https://github.com/dreamquark-ai/tabnet/issues/392 we may can plot feature importance along with training process, however, with model loading using load_model I got trouble in getting the feature importance score though I have put X_train appropriately (the same as in the training process).

What is the expected behavior? Loaded model returns feature importances.

What is motivation or use case for adding/changing the behavior? feature analysis is always important.

How should this be implemented in your opinion? I will take a look at the codes, but if it is the same as which in the training process, it will be enough.

Are you willing to work on this yourself? yes

Optimox commented 2 years ago

The features importance calculated on train are not saved with the model, so you would need to use the explain method to recompute them.