This message was deleted.
# mlforecast
s
This message was deleted.
j
Hey. I think you need the features used to compute the predictions as well. You can use the before_predict_callback argument of the predict method to save them and use these to compute the shap values afterwards
m
@Rehan Javed, were you able to solve this?
j
I can provide a full example in a few of hours, but my idea is something like:
Copy code
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)
# pass this callback to predict
features = pd.concat(save_list)
You need to pass the one with the partial applied, the extract_features_callback
Yes, those are sorted by id and date. Glad it worked, I'll add a callaback to the library that does this so that you can use it in the future
🙌 1