Skip to content
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

Suppress misleading base treatment warning (option 2) #785

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions econml/_cate_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ def effect(self, X=None, *, T0, T1):
# of rows of T was not taken into account
if X is None:
eff = np.repeat(eff, shape(T0)[0], axis=0)
m = shape(eff)[0]
dT = T1 - T0
einsum_str = 'myt,mt->my'
if ndim(dT) == 1:
Expand Down Expand Up @@ -852,7 +851,7 @@ def _expand_treatments(self, X=None, *Ts, transform=True):
n_rows = 1 if X is None else shape(X)[0]
outTs = []
for T in Ts:
if (ndim(T) == 0) and self._d_t_in and self._d_t_in[0] > 1:
if (ndim(T) == 0) and self._d_t_in and self._d_t_in[0] > 1 and T != 0:
warn("A scalar was specified but there are multiple treatments; "
"the same value will be used for each treatment. Consider specifying"
"all treatments, or using the const_marginal_effect method.")
Expand Down