How to plot Shap Dependence plot from causal model in python?

Viewed 19

I have this code which is suppose to create a dependence plot:

outcome='sales'
treatment='price'

shap_values = causal_estimator.shap_values(X_test)
shap.dependence_plot('feature_1', shap_values[outcome][treatment], X_test)

I get error: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

What is the issue here? Any advise is very appreciated. Thanks!

0 Answers
Related