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

Fix broken properties when search has not been run #894

Merged
merged 11 commits into from Jun 30, 2020

Conversation

jeremyliweishih
Copy link
Contributor

@jeremyliweishih jeremyliweishih commented Jun 29, 2020

Fixes #744.

@codecov
Copy link

codecov bot commented Jun 29, 2020

Codecov Report

Merging #894 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #894   +/-   ##
=======================================
  Coverage   99.79%   99.79%           
=======================================
  Files         195      195           
  Lines        9085     9132   +47     
=======================================
+ Hits         9066     9113   +47     
  Misses         19       19           
Impacted Files Coverage Δ
evalml/automl/data_splitters/__init__.py 100.00% <ø> (ø)
evalml/automl/automl_search.py 98.78% <100.00%> (+0.03%) ⬆️
evalml/tests/automl_tests/test_automl.py 100.00% <100.00%> (ø)
.../automl_tests/test_automl_search_classification.py 100.00% <100.00%> (ø)

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 704fe03...02df829. Read the comment docs.

@jeremyliweishih jeremyliweishih marked this pull request as ready for review Jun 29, 2020
Copy link
Collaborator

@dsherry dsherry left a comment

Awesome! I left a few suggestions. Nothing blocking except adding a docstring to has_searched. Once that's in will be 🚢 -able!

evalml/automl/automl_search.py Outdated Show resolved Hide resolved
evalml/automl/automl_search.py Show resolved Hide resolved
evalml/automl/automl_search.py Outdated Show resolved Hide resolved
evalml/automl/automl_search.py Outdated Show resolved Hide resolved
evalml/automl/automl_search.py Outdated Show resolved Hide resolved
evalml/tests/automl_tests/test_automl.py Outdated Show resolved Hide resolved
evalml/tests/automl_tests/test_automl.py Outdated Show resolved Hide resolved
evalml/tests/automl_tests/test_automl.py Outdated Show resolved Hide resolved
@@ -669,12 +668,21 @@ def add_to_rankings(self, pipeline, X, y):
if not isinstance(y, pd.Series):
y = pd.Series(y)

if not self.has_searched:
raise RuntimeError("Please run automl search before calling `add_to_rankings()`")
Copy link
Collaborator

@dsherry dsherry Jun 30, 2020

Choose a reason for hiding this comment

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

👍

mock_score.return_value = {'Log Loss Binary': 0.1234}
test_pipeline = dummy_binary_pipeline_class(parameters={})
with pytest.raises(RuntimeError, match="Please run automl"):
automl.add_to_rankings(test_pipeline, X, y)
Copy link
Collaborator

@dsherry dsherry Jun 30, 2020

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@dsherry dsherry left a comment

@jeremyliweishih jeremyliweishih merged commit 2ebe223 into master Jun 30, 2020
2 checks passed
@angela97lin angela97lin mentioned this pull request Jun 30, 2020
@dsherry dsherry deleted the js_744_before branch Oct 29, 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.

KeyError for automl.rankings when no search is ran
3 participants