I want to do a SHAP analysis of a model. The model is a RNN that takes a whole timeseries as input, where every time series is in the format (101, 12). However, the SHAP package won’t accept 3-dimensional data, the training data is in the format (101, 74, 12).
Is there a way around that or another package which solves that?
I get the error “shap.utils._exceptions.DimensionError: Instance must have 1 or 2 dimensions!”
When I am trying to run:
explainer = shap.KernelExplainer(model.predict,data=timeseries_training)
shap_values = explainer.shap_values(X=timeseries_test)
I was expecting this to work since it worked with all my other models, but they take a single (1,12) array as input.
I get the error:
shap.utils._exceptions.DimensionError: Instance must have 1 or 2 dimensions!
I am trying to do this on a RNN that takes whole time series as input. Every series has 101 timestamps with 12 features.
My question is, then, is it possible for the explainer to handle 3D data in any way? If not, does there exist another Python package that can do just that?
user26420675 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3