Skip to content

Rework the Guide and add Release Notes for 0.6.0 #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/api/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Double machine learning models
DoubleMLLPQ
DoubleMLCVAR
DoubleMLQTE
DoubleMLBLP

Datasets module
---------------
Expand Down
3 changes: 3 additions & 0 deletions doc/examples/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

:parenttoc: True

.. _examplegallery:

Examples
==========

Expand Down Expand Up @@ -30,6 +32,7 @@ These are case studies with the Python package :ref:`DoubleML <doubleml_package>
py_double_ml_pension_qte.ipynb
py_double_ml_pq.ipynb
py_double_ml_cvar.ipynb
py_double_ml_learner.ipynb

|start-h3| Sandbox |end-h3|

Expand Down
35 changes: 6 additions & 29 deletions doc/examples/py_double_ml_cate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"## Data\n",
"\n",
"We define a data generating process to create synthetic data to compare the estimates to the true effect. The data generating process is based on the Monte Carlo simulation from this [paper](https://arxiv.org/abs/1806.03467) and this implementation from [EconML](https://github.com/microsoft/EconML)."
"We define a data generating process to create synthetic data to compare the estimates to the true effect. The data generating process is based on the Monte Carlo simulation from [Oprescu et al. (2019)](http://proceedings.mlr.press/v97/oprescu19a.html) and this [notebook](https://github.com/py-why/EconML/blob/main/notebooks/Causal%20Forest%20and%20Orthogonal%20Random%20Forest%20Examples.ipynb) from [EconML](https://github.com/py-why/EconML)."
]
},
{
Expand Down Expand Up @@ -80,33 +81,6 @@
" return te\n",
"\n",
"def create_synthetic_data(n_samples=200, n_w=30, support_size=5, n_x=1):\n",
" \"\"\"\n",
" Creates a simple synthetic example for conditional treatment effects.\n",
"\n",
" Parameters\n",
" ----------\n",
" n_samples : int\n",
" Number of samples.\n",
" Default is ``200``.\n",
"\n",
" n_w : int\n",
" Dimension of covariates.\n",
" Default is ``30``.\n",
"\n",
" support_size : int\n",
" Number of relevant covariates.\n",
" Default is ``5``.\n",
"\n",
" n_x : int\n",
" Dimension of treatment variable.\n",
" Default is ``1``.\n",
"\n",
" Returns\n",
" -------\n",
" data : pd.DataFrame\n",
" A data frame.\n",
"\n",
" \"\"\"\n",
" # Outcome support\n",
" # With the next two lines we are effectively choosing the matrix gamma in the example\n",
" support_y = np.random.choice(np.arange(n_w), size=support_size, replace=False)\n",
Expand Down Expand Up @@ -219,12 +193,13 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"To estimate the CATE, we rely on the best-linear-predictor of the linear score as in [Semenova et al.](https://doi.org/10.1093/ectj/utaa027) To approximate the target function $g(x)$ with a linear form, we have to define a data frame of basis functions. Here, we rely on [patsy](https://patsy.readthedocs.io/en/latest/) to construct a suitable basis of [B-splines](https://en.wikipedia.org/wiki/B-spline)."
"To estimate the CATE, we rely on the best-linear-predictor of the linear score as in [Semenova et al. (2021)](https://doi.org/10.1093/ectj/utaa027) To approximate the target function $g(x)$ with a linear form, we have to define a data frame of basis functions. Here, we rely on [patsy](https://patsy.readthedocs.io/en/latest/) to construct a suitable basis of [B-splines](https://en.wikipedia.org/wiki/B-spline)."
]
},
{
Expand All @@ -241,6 +216,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"collapsed": false
Expand All @@ -262,6 +238,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"collapsed": false
Expand Down
Loading