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
Add label encoder component to EvalML #2853
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2853 +/- ##
=======================================
+ Coverage 99.8% 99.8% +0.1%
=======================================
Files 303 305 +2
Lines 28226 28353 +127
=======================================
+ Hits 28145 28272 +127
Misses 81 81
Continue to review full report at Codecov.
|
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 to me @angela97lin !
y_ww = infer_feature_types(y) | ||
y_t = self._component_obj.transform(y_ww) | ||
y_t = pd.Series(y_t, index=y_ww.index) | ||
return X, ww.init_series(y_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.
Makes sense to use init_series
. This transformation would almost always change the schema.
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.
Nice, LGTM!
y_t = pd.Series(y_t, index=y_ww.index) | ||
return X, ww.init_series(y_t) | ||
|
||
def fit_transform(self, X, y): |
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.
Is there a reason we don't just use the parent Transformer
's implementation for this?
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 nope, except we want a different docstring 😅 (which was incorrect, updating!)
Closes #2852