Conversation
Codecov Report
@@ Coverage Diff @@
## main #2833 +/- ##
=====================================
Coverage 99.8% 99.8%
=====================================
Files 297 297
Lines 27741 27741
=====================================
Hits 27664 27664
Misses 77 77
Continue to review full report at Codecov.
|
angela97lin
left a comment
There was a problem hiding this comment.
Love these cleanup PRs, keep them coming 😂 ! LGTM, thank you! 👍
| if ( | ||
| issubclass(component_class, BaseSampler) | ||
| or issubclass(component_class, TargetTransformer) | ||
| or hasattr(component_class, "inverse_transform") |
There was a problem hiding this comment.
Open question: Do you think this will hold true long term? It's true for our components now but... 👀
There was a problem hiding this comment.
Hmm, I do think that if we have an inverse_transform method, then it'll modify the target rather than the features. It doesn't seem to make sense to have a transformer have an inverse_tranform method for the features. I also don't think it'd make sense to introduce an inverse_transform method if we don't alter the target at all. Logically, it seems like this should still hold long term.
There was a problem hiding this comment.
Should we add inverse_transform as a method to Transformer? The "default" behavior is a no-op and if we want to enforce that transformers that modify the target override that behavior we can do something like
def inverse_transform(self, y):
if self.modifies_target:
raise NotImplementedError("Transformers that modify the target must override inverse_transform")
return yThat way this behavior always holds. Or we don't make this change? Maybe I was being crazy when I filed the issue lol
There was a problem hiding this comment.
I think Freddy's suggestion is a good one!
fix #2687