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
Minor PipelineBase
cleanup: remove _compute_features_during_fit
#2359
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2359 +/- ##
=======================================
- Coverage 99.7% 99.7% -0.0%
=======================================
Files 281 281
Lines 24926 24923 -3
=======================================
- Hits 24829 24826 -3
Misses 97 97
Continue to review full report at Codecov.
|
@@ -78,7 +78,10 @@ def fit(self, X, y): | |||
X, y = self._convert_to_woodwork(X, y) | |||
self._encoder.fit(y) | |||
y = self._encode_targets(y) | |||
X_t = self._compute_features_during_fit(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.
I thought this was confusing because we called self.input_feature_names = self.component_graph.input_feature_names
in _compute_features_during_fit
and then again below! Moving just these two lines here helps remove the redundancy.
PipelineBase
cleanup: remove _compute_features_during_fit
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 like it! Allows for easier reading for sure.
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.
Good catch!
I removed
_compute_features_during_fit
because we calledself.input_feature_names = self.component_graph.input_feature_names
in_compute_features_during_fit
and then again before returning in the time-series regression pipelines'fit
method. Moving just these two lines here helps remove the redundancy and avoid bugs with setting the attribute twice.