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
Remove _needs_fitting
attribute from Components
#398
Conversation
Codecov Report
@@ Coverage Diff @@
## master #398 +/- ##
==========================================
+ Coverage 97.45% 97.47% +0.01%
==========================================
Files 105 105
Lines 3267 3282 +15
==========================================
+ Hits 3184 3199 +15
Misses 83 83
Continue to review full report at Codecov.
|
_needs_fitting
attribute from Components_needs_fitting
attribute from Components
_needs_fitting
attribute from Components_needs_fitting
attribute from Components
evalml/pipelines/components/transformers/feature_selection/feature_selector.py
Show resolved
Hide resolved
evalml/pipelines/components/transformers/feature_selection/feature_selector.py
Outdated
Show resolved
Hide resolved
Good stuff. Left some comments, in particular having to do with |
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.
LGTM! :D I added a few tiny comments that are more suggestions / food for thoughts rather than need for change.
transformer.fit_transform(X) | ||
with pytest.raises(MethodPropertyNotFoundError, match="Transformer requires a transform method or a component_obj that implements transform"): |
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.
Hmm, this test makes me wonder: would it be confusing for a user who tries to call transformer.fit_transform(X)
to instead get an error that says ""Transformer requires a transform method or a component_obj that implements transform" instead? Perhaps stack trace is enough to make this clear? :O
self.fit(X, y) | ||
X_t = self.transform(X, y) | ||
except MethodPropertyNotFoundError as e: | ||
raise e |
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.
+1 to this. Let's make sure we have test coverage for:
- Component has valid
fit_transform
method - Component has
fit_transform
method but it throws an exception, like aRuntimeError
- Component has no
fit_transform
method, but fit and transform work - Component has no
fit_transform
method, andfit
ortransform
throw
|
||
Arguments: | ||
X (pd.DataFrame): Data to transform | ||
y (pd.Series, optional): Input Labels |
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 the optional
should go somewhere after the colon?
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.
@dsherry optional
inside the parentheses is currently our convention in the codebase. It would be easier to keep this as is and keep track of the convention in a separate issue if we want to change it.
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.
Ah cool, didn't know.
Fixes #366