Hey <@U06HEUYHE05> <@U06MLAGV2BW> to generate the...
# neural-forecast
a
Hey @Marco @Olivier to generate the feature_importances for TFT do we need to create predictions everytime?
m
It has to be trained (using
fit()
) but you don't need to make predictions.
a
@Marco @Olivier I have a pickle file and I am trying to get feature importance and I am getting an error.
m
Did you save and load your model using neuralforecat, as detailed here? On my end, I tested only fitting a TFT model, and I'm able to access all of the feature importance methods. Also, no need to tag us every time, we get the notifications and check reguarly the community Slack 🙂
a
Thanks for getting back to me and I will take a look at it
Hello, I am trying to do feature importance for tft and I have saved and loaded as per nixtlas requirement. Can you please help why it tells
Copy code
No interpretability_params. Make a prediction using the model to generate them.
Please find the attached screenshot
o
I guess you do need to make a prediction, e.g. with the training set.
a
After having a conversation with Marco he told me if you save the model as per nixtlas requirement we will able to get the feature importance after fitting the model
m
I only tried initializing the model, fitting it, and getting feature importance. I haven't done the saving and loading portion. Let me try that and get back to you.
Indeed, when saving/loading the model, you have to run predictions to get the feature importance.
a
Thank you Marco and Oliver for helping me.!!
Is there a way in Nixtla where we can pass ranking to the features and pass those ranking in stats, ml and deep learning?
m
I'm not sure what you mean by a "ranking" of features. I guess if we consider that ranking as a feature itself, then yes, you can pass features to models in stats, ml and dl.
a
For example: If I give ranking to variable A as 1, variable 2 as 2 and so on. Depending on the ranking I want to tell models. Is there any wany to do it in Nixtla?
m
Hmmm, so it sounds like static features. You can handle them the same way as we do with AirPassengersStatic
Copy code
from neuralforecast.utils import AirPassengersPanel, AirPassengersStatic
AirPassengersStatic
Then, just pass it in stats_exog_list. just make sure the model supports static features
✅ 1
a
Thank you Marco.!!
Marco if possible can you share the link for it
m
We use in a bunch of places, but here's an example using NHITS: https://nixtlaverse.nixtla.io/neuralforecast/models.nhits.html#usage-example