Skip to content

Commit 4636257

Browse files
author
Miruna Oprescu
committed
Fix subscript printing in summary
1 parent 28a92b6 commit 4636257

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

econml/dml/dynamic_dml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ def cate_treatment_names(self, treatment_names=None):
682682
slice_treatment_names = super().cate_treatment_names(treatment_names)
683683
treatment_names_out = []
684684
for k in range(self._n_periods):
685-
treatment_names_out += [f"$({t})_{k}$" for t in slice_treatment_names]
685+
treatment_names_out += [f"({t})$_{k}$" for t in slice_treatment_names]
686686
return treatment_names_out
687687

688688
def cate_feature_names(self, feature_names=None):

notebooks/Dynamic Double Machine Learning Examples.ipynb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
{
188188
"data": {
189189
"text/plain": [
190-
"<econml.dml.dynamic_dml.DynamicDML at 0x24466408a48>"
190+
"<econml.dml.dynamic_dml.DynamicDML at 0x1da18865cc8>"
191191
]
192192
},
193193
"execution_count": 7,
@@ -281,13 +281,13 @@
281281
" <td></td> <th>point_estimate</th> <th>stderr</th> <th>zstat</th> <th>pvalue</th> <th>ci_lower</th> <th>ci_upper</th>\n",
282282
"</tr>\n",
283283
"<tr>\n",
284-
" <th>cate_intercept|$(T0)_0$</th> <td>0.711</td> <td>0.041</td> <td>17.224</td> <td>0.0</td> <td>0.643</td> <td>0.779</td> \n",
284+
" <th>cate_intercept|(T0)$_0$</th> <td>0.711</td> <td>0.041</td> <td>17.224</td> <td>0.0</td> <td>0.643</td> <td>0.779</td> \n",
285285
"</tr>\n",
286286
"<tr>\n",
287-
" <th>cate_intercept|$(T0)_1$</th> <td>1.031</td> <td>0.096</td> <td>10.715</td> <td>0.0</td> <td>0.872</td> <td>1.189</td> \n",
287+
" <th>cate_intercept|(T0)$_1$</th> <td>1.031</td> <td>0.096</td> <td>10.715</td> <td>0.0</td> <td>0.872</td> <td>1.189</td> \n",
288288
"</tr>\n",
289289
"<tr>\n",
290-
" <th>cate_intercept|$(T0)_2$</th> <td>0.518</td> <td>0.142</td> <td>3.658</td> <td>0.0</td> <td>0.285</td> <td>0.751</td> \n",
290+
" <th>cate_intercept|(T0)$_2$</th> <td>0.518</td> <td>0.142</td> <td>3.658</td> <td>0.0</td> <td>0.285</td> <td>0.751</td> \n",
291291
"</tr>\n",
292292
"</table><br/><br/><sub>A linear parametric conditional average treatment effect (CATE) model was fitted:<br/>$Y = \\Theta(X)\\cdot T + g(X, W) + \\epsilon$<br/>where for every outcome $i$ and treatment $j$ the CATE $\\Theta_{ij}(X)$ has the form:<br/>$\\Theta_{ij}(X) = \\phi(X)' coef_{ij} + cate\\_intercept_{ij}$<br/>where $\\phi(X)$ is the output of the `featurizer` or $X$ if `featurizer`=None. Coefficient Results table portrays the $coef_{ij}$ parameter vector for each outcome $i$ and treatment $j$. Intercept Results table portrays the $cate\\_intercept_{ij}$ parameter.</sub>"
293293
],
@@ -298,9 +298,9 @@
298298
"=============================================================================\n",
299299
" point_estimate stderr zstat pvalue ci_lower ci_upper\n",
300300
"-----------------------------------------------------------------------------\n",
301-
"cate_intercept|$(T0)_0$ 0.711 0.041 17.224 0.0 0.643 0.779\n",
302-
"cate_intercept|$(T0)_1$ 1.031 0.096 10.715 0.0 0.872 1.189\n",
303-
"cate_intercept|$(T0)_2$ 0.518 0.142 3.658 0.0 0.285 0.751\n",
301+
"cate_intercept|(T0)$_0$ 0.711 0.041 17.224 0.0 0.643 0.779\n",
302+
"cate_intercept|(T0)$_1$ 1.031 0.096 10.715 0.0 0.872 1.189\n",
303+
"cate_intercept|(T0)$_2$ 0.518 0.142 3.658 0.0 0.285 0.751\n",
304304
"-----------------------------------------------------------------------------\n",
305305
"\n",
306306
"<sub>A linear parametric conditional average treatment effect (CATE) model was fitted:\n",
@@ -446,7 +446,7 @@
446446
{
447447
"data": {
448448
"text/plain": [
449-
"<econml.dml.dynamic_dml.DynamicDML at 0x2446689cd08>"
449+
"<econml.dml.dynamic_dml.DynamicDML at 0x1da188e8a08>"
450450
]
451451
},
452452
"execution_count": 17,
@@ -472,13 +472,13 @@
472472
" <td></td> <th>point_estimate</th> <th>stderr</th> <th>zstat</th> <th>pvalue</th> <th>ci_lower</th> <th>ci_upper</th>\n",
473473
"</tr>\n",
474474
"<tr>\n",
475-
" <th>X0|$(T0)_0$</th> <td>0.394</td> <td>0.103</td> <td>3.838</td> <td>0.0</td> <td>0.225</td> <td>0.563</td> \n",
475+
" <th>X0|(T0)$_0$</th> <td>0.394</td> <td>0.103</td> <td>3.838</td> <td>0.0</td> <td>0.225</td> <td>0.563</td> \n",
476476
"</tr>\n",
477477
"<tr>\n",
478-
" <th>X0|$(T0)_1$</th> <td>-0.066</td> <td>0.191</td> <td>-0.345</td> <td>0.73</td> <td>-0.38</td> <td>0.248</td> \n",
478+
" <th>X0|(T0)$_1$</th> <td>-0.066</td> <td>0.191</td> <td>-0.345</td> <td>0.73</td> <td>-0.38</td> <td>0.248</td> \n",
479479
"</tr>\n",
480480
"<tr>\n",
481-
" <th>X0|$(T0)_2$</th> <td>0.04</td> <td>0.2</td> <td>0.199</td> <td>0.843</td> <td>-0.29</td> <td>0.369</td> \n",
481+
" <th>X0|(T0)$_2$</th> <td>0.04</td> <td>0.2</td> <td>0.199</td> <td>0.843</td> <td>-0.29</td> <td>0.369</td> \n",
482482
"</tr>\n",
483483
"</table>\n",
484484
"<table class=\"simpletable\">\n",
@@ -487,13 +487,13 @@
487487
" <td></td> <th>point_estimate</th> <th>stderr</th> <th>zstat</th> <th>pvalue</th> <th>ci_lower</th> <th>ci_upper</th>\n",
488488
"</tr>\n",
489489
"<tr>\n",
490-
" <th>cate_intercept|$(T0)_0$</th> <td>0.579</td> <td>0.052</td> <td>11.242</td> <td>0.0</td> <td>0.495</td> <td>0.664</td> \n",
490+
" <th>cate_intercept|(T0)$_0$</th> <td>0.579</td> <td>0.052</td> <td>11.242</td> <td>0.0</td> <td>0.495</td> <td>0.664</td> \n",
491491
"</tr>\n",
492492
"<tr>\n",
493-
" <th>cate_intercept|$(T0)_1$</th> <td>0.032</td> <td>0.086</td> <td>0.379</td> <td>0.705</td> <td>-0.108</td> <td>0.173</td> \n",
493+
" <th>cate_intercept|(T0)$_1$</th> <td>0.032</td> <td>0.086</td> <td>0.379</td> <td>0.705</td> <td>-0.108</td> <td>0.173</td> \n",
494494
"</tr>\n",
495495
"<tr>\n",
496-
" <th>cate_intercept|$(T0)_2$</th> <td>-0.098</td> <td>0.093</td> <td>-1.048</td> <td>0.294</td> <td>-0.251</td> <td>0.056</td> \n",
496+
" <th>cate_intercept|(T0)$_2$</th> <td>-0.098</td> <td>0.093</td> <td>-1.048</td> <td>0.294</td> <td>-0.251</td> <td>0.056</td> \n",
497497
"</tr>\n",
498498
"</table><br/><br/><sub>A linear parametric conditional average treatment effect (CATE) model was fitted:<br/>$Y = \\Theta(X)\\cdot T + g(X, W) + \\epsilon$<br/>where for every outcome $i$ and treatment $j$ the CATE $\\Theta_{ij}(X)$ has the form:<br/>$\\Theta_{ij}(X) = \\phi(X)' coef_{ij} + cate\\_intercept_{ij}$<br/>where $\\phi(X)$ is the output of the `featurizer` or $X$ if `featurizer`=None. Coefficient Results table portrays the $coef_{ij}$ parameter vector for each outcome $i$ and treatment $j$. Intercept Results table portrays the $cate\\_intercept_{ij}$ parameter.</sub>"
499499
],
@@ -504,16 +504,16 @@
504504
"=================================================================\n",
505505
" point_estimate stderr zstat pvalue ci_lower ci_upper\n",
506506
"-----------------------------------------------------------------\n",
507-
"X0|$(T0)_0$ 0.394 0.103 3.838 0.0 0.225 0.563\n",
508-
"X0|$(T0)_1$ -0.066 0.191 -0.345 0.73 -0.38 0.248\n",
509-
"X0|$(T0)_2$ 0.04 0.2 0.199 0.843 -0.29 0.369\n",
507+
"X0|(T0)$_0$ 0.394 0.103 3.838 0.0 0.225 0.563\n",
508+
"X0|(T0)$_1$ -0.066 0.191 -0.345 0.73 -0.38 0.248\n",
509+
"X0|(T0)$_2$ 0.04 0.2 0.199 0.843 -0.29 0.369\n",
510510
" CATE Intercept Results \n",
511511
"=============================================================================\n",
512512
" point_estimate stderr zstat pvalue ci_lower ci_upper\n",
513513
"-----------------------------------------------------------------------------\n",
514-
"cate_intercept|$(T0)_0$ 0.579 0.052 11.242 0.0 0.495 0.664\n",
515-
"cate_intercept|$(T0)_1$ 0.032 0.086 0.379 0.705 -0.108 0.173\n",
516-
"cate_intercept|$(T0)_2$ -0.098 0.093 -1.048 0.294 -0.251 0.056\n",
514+
"cate_intercept|(T0)$_0$ 0.579 0.052 11.242 0.0 0.495 0.664\n",
515+
"cate_intercept|(T0)$_1$ 0.032 0.086 0.379 0.705 -0.108 0.173\n",
516+
"cate_intercept|(T0)$_2$ -0.098 0.093 -1.048 0.294 -0.251 0.056\n",
517517
"-----------------------------------------------------------------------------\n",
518518
"\n",
519519
"<sub>A linear parametric conditional average treatment effect (CATE) model was fitted:\n",

0 commit comments

Comments
 (0)