Skip to content

Commit 87219c2

Browse files
committed
Merge branch 'dev' into p-release-notes-r-0.5.3
2 parents 236aa59 + db90d65 commit 87219c2

20 files changed

+1299
-147
lines changed

doc/api/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Double machine learning models
3030
DoubleMLLPQ
3131
DoubleMLCVAR
3232
DoubleMLQTE
33+
DoubleMLBLP
3334

3435
Datasets module
3536
---------------

doc/examples/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
:parenttoc: True
33

4+
.. _examplegallery:
5+
46
Examples
57
==========
68

@@ -30,6 +32,7 @@ These are case studies with the Python package :ref:`DoubleML <doubleml_package>
3032
py_double_ml_pension_qte.ipynb
3133
py_double_ml_pq.ipynb
3234
py_double_ml_cvar.ipynb
35+
py_double_ml_learner.ipynb
3336

3437
|start-h3| Sandbox |end-h3|
3538

doc/examples/py_double_ml_cate.ipynb

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
]
1313
},
1414
{
15+
"attachments": {},
1516
"cell_type": "markdown",
1617
"metadata": {
1718
"collapsed": false
1819
},
1920
"source": [
2021
"## Data\n",
2122
"\n",
22-
"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)."
23+
"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)."
2324
]
2425
},
2526
{
@@ -80,33 +81,6 @@
8081
" return te\n",
8182
"\n",
8283
"def create_synthetic_data(n_samples=200, n_w=30, support_size=5, n_x=1):\n",
83-
" \"\"\"\n",
84-
" Creates a simple synthetic example for conditional treatment effects.\n",
85-
"\n",
86-
" Parameters\n",
87-
" ----------\n",
88-
" n_samples : int\n",
89-
" Number of samples.\n",
90-
" Default is ``200``.\n",
91-
"\n",
92-
" n_w : int\n",
93-
" Dimension of covariates.\n",
94-
" Default is ``30``.\n",
95-
"\n",
96-
" support_size : int\n",
97-
" Number of relevant covariates.\n",
98-
" Default is ``5``.\n",
99-
"\n",
100-
" n_x : int\n",
101-
" Dimension of treatment variable.\n",
102-
" Default is ``1``.\n",
103-
"\n",
104-
" Returns\n",
105-
" -------\n",
106-
" data : pd.DataFrame\n",
107-
" A data frame.\n",
108-
"\n",
109-
" \"\"\"\n",
11084
" # Outcome support\n",
11185
" # With the next two lines we are effectively choosing the matrix gamma in the example\n",
11286
" support_y = np.random.choice(np.arange(n_w), size=support_size, replace=False)\n",
@@ -219,12 +193,13 @@
219193
]
220194
},
221195
{
196+
"attachments": {},
222197
"cell_type": "markdown",
223198
"metadata": {
224199
"collapsed": false
225200
},
226201
"source": [
227-
"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)."
202+
"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)."
228203
]
229204
},
230205
{
@@ -241,6 +216,7 @@
241216
]
242217
},
243218
{
219+
"attachments": {},
244220
"cell_type": "markdown",
245221
"metadata": {
246222
"collapsed": false
@@ -262,6 +238,7 @@
262238
]
263239
},
264240
{
241+
"attachments": {},
265242
"cell_type": "markdown",
266243
"metadata": {
267244
"collapsed": false

0 commit comments

Comments
 (0)