@ronniemi
I am using an Autoencoder model with 22 input features. Now when I am calculating the shap values for the test dataset using the following lines of code:
explainer = shap.KernelExplainer(model.predict,train_data[:100])
shap_values = explainer.shap_values(test_data_H[:1])
I am getting a 3D output
print(np.asarray(shap_values).shape)
Output: (22, 1, 22)
Is this happening because the explainer is considering an output of "22" classes and so, for a row of 22 features, 22 different class outputs I am getting?
If I want to plot the shap values how should I proceed? Will it be correct if I take the mean of all 22 class outputs? I mean for a row of 22 features, isn't it that I should also expect a row of 22 shap values since, unlike a supervised algorithm, the number of the output of an Autoencoder does not represent the class of the model?
It would be really helpful if you could reply.
Thanks
@ronniemi
I am using an Autoencoder model with 22 input features. Now when I am calculating the shap values for the test dataset using the following lines of code:
explainer = shap.KernelExplainer(model.predict,train_data[:100])
shap_values = explainer.shap_values(test_data_H[:1])
I am getting a 3D output
print(np.asarray(shap_values).shape)
Output: (22, 1, 22)
Is this happening because the explainer is considering an output of "22" classes and so, for a row of 22 features, 22 different class outputs I am getting?
If I want to plot the shap values how should I proceed? Will it be correct if I take the mean of all 22 class outputs? I mean for a row of 22 features, isn't it that I should also expect a row of 22 shap values since, unlike a supervised algorithm, the number of the output of an Autoencoder does not represent the class of the model?
It would be really helpful if you could reply.
Thanks