Misleading warning for multiple treatments
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.8k
- Forks
- 827
- PR merge metrics
- No merged PRs in 30d
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).
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 https://github.com/py-why/EconML/pull/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 https://github.com/py-why/EconML/pull/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!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at econml/_cate_estimator.py lines 855-858 and compare the two proposed approaches in PRs 784 and 785. Done means the warning no longer misleads users when the base treatment is omitted, while preserving the intended warning behavior for explicitly supplied multiple treatments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100