-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Add interpretability capabilities trough SHAP #150
Comments
I am not sure if this feature will be released soon, but in the meantime I cannot seem to use SHAP values using the above method.
Perhaps it has something to do with how the models I retrieve using
|
Hey @elisevansartefact. The fitted models are stored in the from functools import partial
def extract_features(df, save_list):
save_list.append(df)
return df
save_list = []
extract_features_callback = partial(extract_features, save_list=save_list)
fcst.predict(..., before_predict_callback=extract_features_callback)
features = pd.concat(save_list) |
Would probably also want to use https://github.com/linkedin/fasttreeshap instead |
Hey folks. We've added a guide which explains how to get the trained models and compute the SHAP values for training and inference. I think this gives full control on how to compute them (sample size, etc). Please let us know if you'd prefer something integrated into the library. |
@jmoralez the guide makes this a lot easier but its probably worth noting that it only works for single model recursive fits. If a model (or models) is fitted with a direct strategy then each model in the list has a different explainer. |
Description
To enhance the interpretability of models trained using
MLForecast
, we propose leveraging SHAP (SHapley Additive exPlanations). SHAP is compatible with XGBoost, LightGBM, and scikit-learn models. Currently, if we want to use it, we need to create the dataset for which we desire forecast explanations (usingpreprocess
) and iterate over each trained model using the following:The goal is to introduce a method, possibly named
shap_values
, to generate SHAP values for the forecasts from all trained models.Use case
No response
The text was updated successfully, but these errors were encountered: