Description
If multiple treatments are specified, a warning is given if a scalar is provided as treatment value for the effect estimation, e.g. est.effect(X=X, T0=0, T1=1)
.
EconML/econml/_cate_estimator.py
Lines 855 to 858 in 8d58f37
However, since this check currently includes the base treatment T0
, for which the default is 0, a warning is emitted even if the base treatment is not specified. As a user, this may be misleading because one suspects the provided target treatment T1
to be of undesired shape. (At least for me, it took me quite a while to figure out that the warning was not related to T1
.)
Option 1
I would suggest to suppress the warning if the base treatment has the default value (see PR #784).
Option 2
The alternative that would involve less lines of code would be adding a T != 0
check before emitting the warning (see PR #785), i.e.:
if (ndim(T) == 0) and self._d_t_in and self._d_t_in[0] > 1 and T != 0:
Assuming that there are no reasonable cases where the T1
is 0, this should work as well. Yet, I slightly favor the first approach because the second one is highly implicit.
Thanks!