AttributeError: 'CausalModel' object has no attribute 'causal_estimator' (Causal Inference and Discovery in Python)

244 Views Asked by At

I tried to run the notebook provided along with the book (Causal Inference and Discovery in Python - Chapter 10. When I run this specific block

# Compute predictions
effect_pred = model.causal_estimator.effect(earnings_interaction_test.drop(['true_effect', 'took_a_course'], axis=1))

# Get the true effect
effect_true = earnings_interaction_test['true_effect'].values

I got an error: AttributeError: 'CausalModel' object has no attribute 'causal_estimator'

The book states that it uses DoWhy 0.8 and I am currently using DoWhy 0.10.1 (I want to keep my learning experience up-to-date) so I think the library must have changed the way to make prediction on test dataset with a model. The trouble is, I cannot find what the change is.

I have tried searching Dowhy's documentation and Github page but, unfortunately, my limited knowledge of coding and causal inference denied me the answer.

Much appreciate your help!

0

There are 0 best solutions below