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

Add callback for error handling in AutoMLSearch #1403

Merged
merged 16 commits into from Nov 9, 2020
Merged

Conversation

angela97lin
Copy link
Contributor

@angela97lin angela97lin commented Nov 3, 2020

Closes #1217

Questions:

If all objectives fail and AutoMLException is raised, we will raise since it indicates that something is likely wrong. This is the same behavior as what is currently implemented.

@angela97lin angela97lin added this to the November 2020 milestone Nov 3, 2020
@angela97lin angela97lin self-assigned this Nov 3, 2020
@codecov
Copy link

codecov bot commented Nov 3, 2020

Codecov Report

Merging #1403 (15404b2) into main (a5e6c50) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             main    #1403     +/-   ##
=========================================
+ Coverage   100.0%   100.0%   +0.1%     
=========================================
  Files         213      214      +1     
  Lines       13975    14040     +65     
=========================================
+ Hits        13968    14033     +65     
  Misses          7        7             
Impacted Files Coverage Δ
...ediction_explanations_tests/test_user_interface.py 100.0% <ø> (ø)
evalml/automl/automl_search.py 99.7% <100.0%> (-<0.1%) ⬇️
evalml/automl/callbacks.py 100.0% <100.0%> (ø)
evalml/tests/automl_tests/test_automl.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 a5e6c50...15404b2. Read the comment docs.

@angela97lin angela97lin marked this pull request as draft November 4, 2020 18:53
@angela97lin angela97lin marked this pull request as ready for review November 4, 2020 20:22
evalml/automl/automl_search.py Outdated Show resolved Hide resolved
evalml/tests/automl_tests/test_automl.py Show resolved Hide resolved
evalml/automl/callbacks.py Outdated Show resolved Hide resolved
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.

Looks good! I agree with @freddyaboulton that we should add the traceback as part of saving the errors. Could be done in this PR or another but would be great for looking glass.

evalml/automl/automl_search.py Outdated Show resolved Hide resolved
evalml/automl/callbacks.py Outdated Show resolved Hide resolved
evalml/automl/callbacks.py Outdated Show resolved Hide resolved
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 this looks great!

I left a few comments, but there was nothing major.

RE Protocol subclassing, I think we're ok to skip that for now, but its a good idea.

docs/source/api_reference.rst Show resolved Hide resolved
evalml/automl/automl_search.py Outdated Show resolved Hide resolved
@@ -674,22 +680,14 @@ def _compute_cv_scores(self, pipeline, X, y):
logger.debug(f"\t\t\tFold {i}: {self.objective.name} score: {scores[self.objective.name]:.3f}")
score = scores[self.objective.name]
except Exception as e:
if self.error_callback is not None:
self.error_callback(e, self, fold_num=i, pipeline=pipeline)
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, so because we pass self back in the callback, someone could theoretically write a callback which responds to failure and calls automl.search again. So this is implementing one part of an asynchronous API (#1047 ). Neat!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes!!

evalml/automl/callbacks.py Outdated Show resolved Hide resolved
evalml/automl/callbacks.py Outdated Show resolved Hide resolved
evalml/automl/callbacks.py Outdated Show resolved Hide resolved
evalml/automl/callbacks.py Show resolved Hide resolved
evalml/automl/automl_search.py Outdated Show resolved Hide resolved
@angela97lin angela97lin merged commit 554102c into main Nov 9, 2020
@angela97lin angela97lin deleted the 1217_error_callbacks branch November 9, 2020 16:41
@dsherry dsherry mentioned this pull request Nov 24, 2020
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.

AutoML search: Add callback for error handling
4 participants