A question from Asad Shoaib &lt;<mailto:asad.shoai...
# support
t
A question from Asad Shoaib <asad.shoaib@wecrunch.com> on SHAP values. He asked a question and then figured things out himself, and then asked a follow up. So those in the thread. Thanks so much!
I am trying to compute SHAP values (to gauge feature importances) for Nixtla's Statsforecast (AutoARIMA), AutoMLForecast (rf, linear etc.) and AutoNeuralForecast libraries. I started off by following the tutorial given at (https://nixtlaverse.nixtla.io/mlforecast/docs/how-to-guides/analyzing_models.html) for ML Forecast, however, I am not able to generate the SHAP values properly.
I am using the Auto family of functions, and the error I get is that I am passing a dataframe instead of an integer. I believe that corresponds to how the predict function expects an integer for the horizon. In the shared tutorial, however, a dataframe is being passed instead. Can you please advise on how I need to modify this?
1
I figured out the issue - I believe it arises from my passing a MLForecast object as opposed to the model itself when calling the function. Now figuring out how to call the model itself.
Figured that out too. Just need to understand how to access and use the hyperoptimized parameters (such as lag_features as given in the SS in my last email etc.) when calculating shap_values. Can you please advise how one may do that?
Maybe this one is for @Olivier Sprangers @Marco or @José Morales. Thank you!
m
I'm not sure I understand his question. He wants the optimized parameters to calculate shap values, but shap values only use features, we don't pass model parameters to that. Again, maybe I'm just very confused, but I don't understand what he needs.
j
In the auto models it's just nested, so it's
auto_mlf.models_['linear'].models_['linear']