Skip to content
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

Merged
merged 5 commits into from Jun 15, 2021

Conversation

angela97lin
Copy link
Contributor

@angela97lin angela97lin commented Jun 9, 2021

I removed _compute_features_during_fit because we called self.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.

@angela97lin angela97lin self-assigned this Jun 9, 2021
@codecov
Copy link

codecov bot commented Jun 9, 2021

Codecov Report

Merging #2359 (0a69cd6) into main (ad921c4) will decrease coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           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             
Impacted Files Coverage Δ
evalml/pipelines/pipeline_base.py 99.7% <ø> (-<0.1%) ⬇️
.../pipelines/time_series_classification_pipelines.py 100.0% <100.0%> (ø)
...valml/pipelines/time_series_regression_pipeline.py 100.0% <100.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad921c4...0a69cd6. Read the comment docs.

@angela97lin angela97lin changed the title ComponentGraph cleanup Minor PipelineBase cleanup Jun 10, 2021
@@ -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)
Copy link
Contributor Author

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.

@angela97lin angela97lin changed the title Minor PipelineBase cleanup Minor PipelineBase cleanup: remove _compute_features_during_fit Jun 10, 2021
Copy link
Contributor

@jeremyliweishih jeremyliweishih left a 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.

Copy link
Contributor

@bchen1116 bchen1116 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@angela97lin angela97lin merged commit 861870e into main Jun 15, 2021
@angela97lin angela97lin deleted the cg_cleanup branch June 15, 2021 23:31
@chukarsten chukarsten mentioned this pull request Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants