Skip to content

What is the output number of shap values generated using an Autoencoder with 22 inputs and 22 outputs?  #5

@SupriyaAsutkarIITB

Description

@SupriyaAsutkarIITB

@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions