From fdd506c9f3a54628a16cce428295f8a9768cbfce Mon Sep 17 00:00:00 2001 From: Amit Sharma Date: Mon, 11 May 2020 21:19:55 +0530 Subject: [PATCH] Bumping up version number and updating docs in prep for release (#143) * added cate estimator to causal estimator and one specific estiamtor for linear regression * Started with a better error message for estimators that do not support CATE as yet, but then generalized to add error messages for when any specific method is not implemented for an estimator. * added docstrings for the new functionality * added a warning if effect modifiers provided are extra from the ones specified before, and fixed a bug for discrete variables * updated files in prep for release of v0.4 --- Makefile | 2 +- docs/source/code_repo.rst | 52 ++++++++++++++++++++----- docs/source/conf.py | 2 +- docs/source/dowhy.causal_estimators.rst | 22 +++++++++-- docs/source/dowhy.causal_refuters.rst | 16 ++++++++ docs/source/dowhy.rst | 1 + dowhy/VERSION | 2 +- setup.py | 10 ++--- 8 files changed, 86 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 524446bd2d..6fc6d6d58f 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ init: test: py.test tests check: - python setup.py checka + python setup.py check sdist: python setup.py sdist jupyter: diff --git a/docs/source/code_repo.rst b/docs/source/code_repo.rst index 4c35949e14..194041c81b 100644 --- a/docs/source/code_repo.rst +++ b/docs/source/code_repo.rst @@ -1,19 +1,53 @@ Code repository & Versions -================= +========================== DoWhy is hosted on GitHub. You can browse the code in a html-friendly format `here `_. -Version 0.2-alpha (WIP) ------------------------ -This version includes breaking changes. -* The CausalModel import is now simpler. `from dowhy import CausalModel`. -* do_why.py is renamed to causal_model.py. This should not change any external - usage. +v0.4-beta: Powerful refutations and better support for heterogeneous treatment effects +-------------------------------------------------------------------------------------- -Version 0.1.1-alpha -------------------- +* DummyOutcomeRefuter now includes machine learning functions to increase power of the refutation. + * In addition to generating a random dummy outcome, now you can generate a dummyOutcome that is an arbitrary function of confounders but always independent of treatment, and then test whether the estimated treatment effect is zero. This is inspired by ideas from the T-learner. + * We also provide default machine learning-based methods to estimate such a dummyOutcome based on confounders. Of course, you can specify any custom ML method. + +* Added a new BootstrapRefuter that simulates the issue of measurement error with confounders. Rather than a simple bootstrap, you can generate bootstrap samples with noise on the values of the confounders and check how sensitive the estimate is. + * The refuter supports custom selection of the confounders to add noise to. + +* All refuters now provide confidence intervals and a significance value. + +* Better support for heterogeneous effect libraries like EconML and CausalML + * All CausalML methods can be called directly from DoWhy, in addition to all methods from EconML. + * [Change to naming scheme for estimators] To achieve a consistent naming scheme for estimators, we suggest to prepend internal dowhy estimators with the string "dowhy". For example, "backdoor.dowhy.propensity_score_matching". Not a breaking change, so you can keep using the old naming scheme too. + * EconML-specific: Since EconML assumes that effect modifiers are a subset of confounders, a warning is issued if a user specifies effect modifiers outside of confounders and tries to use EconML methods. + +* CI and Standard errors: Added bootstrap-based confidence intervals and standard errors for all methods. For linear regression estimator, also implemented the corresponding parametric forms. + +* Convenience functions for getting confidence intervals, standard errors and conditional treatment effects (CATE), that can be called after fitting the estimator if needed + +* Better coverage for tests. Also, tests are now seeded with a random seed, so more dependable tests. + +Thanks to @Tanmay-Kulkarni101 and @Arshiaarya for their contributions! + +v0.2-alpha: CATE estimation and integration with EconML +------------------------------------------------------- + + +This release includes many major updates: + +* (BREAKING CHANGE) The CausalModel import is now simpler: "from dowhy import CausalModel" +* Multivariate treatments are now supported. +* Conditional Average Treatment Effects (CATE) can be estimated for any subset of the data. Includes integration with EconML--any method from EconML can be called using DoWhy through the estimate_effect method (see example notebook). +* Other than CATE, specific target estimands like ATT and ATC are also supported for many of the estimation methods. +* For reproducibility, you can specify a random seed for all refutation methods. +* Multiple bug fixes and updates to the documentation. + + +Includes contributions from @j-chou, @ktmud, @jrfiedler, @shounak112358, @Lnk2past. Thank you all! + +v0.1.1-alpha: First release +--------------------------- This is the first release of the library. diff --git a/docs/source/conf.py b/docs/source/conf.py index 8383554a10..c7460c455c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,7 +20,7 @@ # -- Project information ----------------------------------------------------- project = 'DoWhy | Making Causal Inference Easy' -copyright = '2018, Microsoft' +copyright = '2020, Microsoft' author = 'Amit Sharma, Emre Kiciman' # The short X.Y version diff --git a/docs/source/dowhy.causal_estimators.rst b/docs/source/dowhy.causal_estimators.rst index 527dfd5021..4932794ff8 100755 --- a/docs/source/dowhy.causal_estimators.rst +++ b/docs/source/dowhy.causal_estimators.rst @@ -4,10 +4,18 @@ dowhy.causal\_estimators package Submodules ---------- -dowhy.causal\_estimators.econml\_cate\_estimator module -------------------------------------------------------- +dowhy.causal\_estimators.causalml module +---------------------------------------- -.. automodule:: dowhy.causal_estimators.econml_cate_estimator +.. automodule:: dowhy.causal_estimators.causalml + :members: + :undoc-members: + :show-inheritance: + +dowhy.causal\_estimators.econml module +-------------------------------------- + +.. automodule:: dowhy.causal_estimators.econml :members: :undoc-members: :show-inheritance: @@ -28,6 +36,14 @@ dowhy.causal\_estimators.linear\_regression\_estimator module :undoc-members: :show-inheritance: +dowhy.causal\_estimators.propensity\_score\_estimator module +------------------------------------------------------------ + +.. automodule:: dowhy.causal_estimators.propensity_score_estimator + :members: + :undoc-members: + :show-inheritance: + dowhy.causal\_estimators.propensity\_score\_matching\_estimator module ---------------------------------------------------------------------- diff --git a/docs/source/dowhy.causal_refuters.rst b/docs/source/dowhy.causal_refuters.rst index 6b5747ec9b..82012f6e06 100644 --- a/docs/source/dowhy.causal_refuters.rst +++ b/docs/source/dowhy.causal_refuters.rst @@ -12,6 +12,14 @@ dowhy.causal\_refuters.add\_unobserved\_common\_cause module :undoc-members: :show-inheritance: +dowhy.causal\_refuters.bootstrap\_refuter module +------------------------------------------------ + +.. automodule:: dowhy.causal_refuters.bootstrap_refuter + :members: + :undoc-members: + :show-inheritance: + dowhy.causal\_refuters.data\_subset\_refuter module --------------------------------------------------- @@ -20,6 +28,14 @@ dowhy.causal\_refuters.data\_subset\_refuter module :undoc-members: :show-inheritance: +dowhy.causal\_refuters.dummy\_outcome\_refuter module +----------------------------------------------------- + +.. automodule:: dowhy.causal_refuters.dummy_outcome_refuter + :members: + :undoc-members: + :show-inheritance: + dowhy.causal\_refuters.placebo\_treatment\_refuter module --------------------------------------------------------- diff --git a/docs/source/dowhy.rst b/docs/source/dowhy.rst index 5cbb3d4782..753a6a1297 100644 --- a/docs/source/dowhy.rst +++ b/docs/source/dowhy.rst @@ -5,6 +5,7 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 dowhy.api dowhy.causal_estimators diff --git a/dowhy/VERSION b/dowhy/VERSION index 3b04cfb60d..bd73f47072 100755 --- a/dowhy/VERSION +++ b/dowhy/VERSION @@ -1 +1 @@ -0.2 +0.4 diff --git a/setup.py b/setup.py index 161be44c8b..aecdb75e26 100755 --- a/setup.py +++ b/setup.py @@ -31,21 +31,19 @@ license='MIT', long_description=long_description, url='https://github.com/microsoft/dowhy', # Optional - download_url='https://github.com/microsoft/dowhy/archive/v0.2.tar.gz', + download_url='https://github.com/microsoft/dowhy/archive/v0.4.tar.gz', author='Amit Sharma, Emre Kiciman', classifiers=[ # Optional - 'Development Status :: 3 - Alpha', + 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT License', - - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', ], keywords='causality machine-learning causal-inference statistics graphical-model', packages=find_packages(exclude=['docs', 'tests']), - python_requires='>=3.4', + python_requires='>=3.5', install_requires=install_requires, include_package_data=True, package_data={'dowhy':['VERSION']}