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

Standardize error when calling transform/predict before fit for pipelines #1048

Merged
merged 12 commits into from
Aug 17, 2020

Conversation

angela97lin
Copy link
Contributor

Closes #988

@angela97lin angela97lin self-assigned this Aug 12, 2020
@angela97lin angela97lin marked this pull request as draft August 12, 2020 21:06
@codecov
Copy link

codecov bot commented Aug 13, 2020

Codecov Report

Merging #1048 into main will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1048   +/-   ##
=======================================
  Coverage   99.91%   99.91%           
=======================================
  Files         188      191    +3     
  Lines       10296    10362   +66     
=======================================
+ Hits        10287    10353   +66     
  Misses          9        9           
Impacted Files Coverage Δ
evalml/exceptions/exceptions.py 100.00% <100.00%> (ø)
evalml/pipelines/components/component_base.py 100.00% <100.00%> (ø)
evalml/pipelines/components/component_base_meta.py 100.00% <100.00%> (ø)
evalml/pipelines/pipeline_base.py 100.00% <100.00%> (ø)
evalml/pipelines/pipeline_base_meta.py 100.00% <100.00%> (ø)
evalml/tests/conftest.py 100.00% <100.00%> (ø)
...ation_pipeline_tests/test_binary_classification.py 100.00% <100.00%> (ø)
evalml/tests/pipeline_tests/test_pipelines.py 100.00% <100.00%> (ø)
evalml/utils/base_meta.py 100.00% <100.00%> (ø)
... and 2 more

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 2ecf3bd...bae9f58. Read the comment docs.

@angela97lin angela97lin marked this pull request as ready for review August 13, 2020 18:55
@angela97lin angela97lin added this to the August 2020 milestone Aug 13, 2020
Copy link
Collaborator

@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.

Looks good! Just some suggestion on adding a test case and also how we could move the two metaclasses into one but not blocking.

evalml/pipelines/base_meta.py Outdated Show resolved Hide resolved
evalml/pipelines/base_meta.py Outdated Show resolved Hide resolved
evalml/tests/pipeline_tests/test_pipelines.py Show resolved Hide resolved
evalml/tests/pipeline_tests/test_pipelines.py Show resolved Hide resolved
Copy link
Contributor

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

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

@angela97lin Looks good! I just left two minor comments.

evalml/pipelines/base_meta.py Outdated Show resolved Hide resolved
@wraps(method)
def _check_for_fit(self, X=None, y=None):
klass = type(self).__name__
if not self._is_fitted and klass and self.needs_fitting:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need the and klass?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops we don't, glad you caught this 😅

Copy link
Contributor

@dsherry dsherry left a comment

Choose a reason for hiding this comment

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

@angela97lin looks good!

What do you think of this:

  • Define BaseMeta in evalml/utils/base_meta.py
  • Define ComponentBaseMeta in evalml/pipelines/components/component_base_meta.py
  • Define PipelineBaseMeta in evalml/pipelines/pipeline_base_meta.py

Approved once we confirm organization.

evalml/pipelines/base_meta.py Outdated Show resolved Hide resolved
evalml/pipelines/base_meta.py Outdated Show resolved Hide resolved
evalml/pipelines/base_meta.py Outdated Show resolved Hide resolved
evalml/pipelines/base_meta.py Outdated Show resolved Hide resolved
evalml/pipelines/base_meta.py Outdated Show resolved Hide resolved
@angela97lin
Copy link
Contributor Author

@dsherry Sure, that sounds fine to me, could be useful if we use BaseMeta for anything else. I'll update this PR accordingly.

@angela97lin angela97lin merged commit c0ad9f8 into main Aug 17, 2020
@dsherry dsherry mentioned this pull request Aug 25, 2020
@angela97lin angela97lin deleted the 988_pipeline_err_standarize branch September 24, 2020 15:02
@angela97lin angela97lin restored the 988_pipeline_err_standarize branch September 24, 2020 15:02
@angela97lin angela97lin deleted the 988_pipeline_err_standarize branch September 24, 2020 15:02
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.

Pipelines: standard error when calling transform/predict before fit
4 participants