-
Notifications
You must be signed in to change notification settings - Fork 767
treatment featurization #615
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
Conversation
5ee16b8
to
617a0b6
Compare
f5ea2fb
to
64e9b08
Compare
d56d478
to
fa2aca6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. I've reviewed all of the non-test code and it mostly looks good but I've added several small thoughts. I hope to review the tests in a separate pass by the end of the week.
93cb728
to
b310fe1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the changes look great. I've flagged a few remaining issues.
econml/_cate_estimator.py
Outdated
if hasattr(self, 'treatment_featurizer') and self._original_treatment_featurizer: | ||
feat_T = self.transformer.transform(T) | ||
jac_T = self.transformer.jac(T) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think this logic will work but it still looks a bit weird to my eye, because we're checking _original_treatment_featurizer
for non-None-ness when we really care about is that we can use transformer
instead. I guess we can't check that transformer
is non-None because it also exists for discrete treatments but we don't want to transform in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think perhaps it would be worth being more explicit and promoting "should we use the treatment featurizer when getting marginal effects" to a first-class concept stored as a flag at the base estimator level because that would make this logic much more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also a bit odd because currently transformer
is defined as an attribute on the TransformerMixin
class, but you're using it here in LinearCateEstimator
, which might not be a TransformerMixin
instance. So maybe that attribute should also be moved up to be part of the BaseCateEstimator API itself (since you could in principle have TransformerMixins that aren't LinearCateEstimators or vice versa, but we'd now want the attribute in each place).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, as long as applying treatment featurization to multi-column treatments either works or is clearly forbidden; in either case this behavior should be covered by a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
bc57c5c
to
b7ee18f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - just a few minor suggestions.
Co-authored-by: Keith Battocchi <kebatt@microsoft.com>
Co-authored-by: Keith Battocchi <kebatt@microsoft.com> Signed-off-by: AnthonyCampbell208 <78286293+AnthonyCampbell208@users.noreply.github.com>
No description provided.