Comments (2)
Hi @Lyutenant - thank you for raising this up.
You are correct, there were some changes in the DoWhy's API since version 0.9+ and .causal_estimator
object has been removed from the CausalModel
class.
There are two ways of generating predictions on new data using the new API (examples follow the Chapter 09 notebook, S-Learner section):
- Accessing the fitted estimator from the
estimate
object:
estimate._estimator_object.effect(earnings_interaction_test.drop(['true_effect', 'took_a_course'], axis=1))
- Passing new data to the
target_units
parameter while settingfit_estimator
toFalse
:
model.estimate_effect(
identified_estimand=estimand,
method_name='backdoor.econml.metalearners.SLearner',
fit_estimator=False,
target_units=earnings_interaction_test.drop(['true_effect', 'took_a_course'], axis=1),
).cate_estimates
I personally find the second way somehow less intuitive and less clear than the first one.
I also want to share with you that I encountered some unexpected behaviors in version 0.10.1 when using these methods. I raised an issue with the DoWhy team here: py-why/dowhy#1038
If you asked my opinion, I'd recommend that you stick with DoWhy 0.8 at least for now.
I hope this reply will be helpful to you.
Wish you a joyful journey with the book and happy causal learning!
from causal-inference-and-discovery-in-python.
Hi @AlxndrMlk , thanks for your prompt reply.
I switched back to dowhy 0.8 and the issue is gone. I am taking your advice to stick to 0.8 for now, at least until the issue you have raised with the DoWhy team is solved.
p.s. I do enjoy your book a lot!
from causal-inference-and-discovery-in-python.
Related Issues (8)
- Solving environment not completing HOT 3
- Small errata for p27 of book (post-June 2023) HOT 2
- Add bibtex reference to the book in the `README.md` HOT 2
- Chapter 7 notebook array shape error messages HOT 5
- Notebook 13 np.np typo HOT 1
- [Chapter9] Causal_estimator.effect for prediction HOT 1
- Environment for M1 Silicon HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from causal-inference-and-discovery-in-python.