Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
Fix early_stopping=True with BOHB not setting the correct scheduler (
Browse files Browse the repository at this point in the history
…#254)

* Fix `early_stopping=True` with BOHB

Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>

* Enable BOHB tests

Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>

Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
  • Loading branch information
Yard1 committed Oct 5, 2022
1 parent 0ddd93a commit 03342e3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
10 changes: 0 additions & 10 deletions tests/test_randomizedsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ def test_multi_best_classification(self):
scoring = ("accuracy", "f1_micro")
search_methods = ["random", "bayesian", "hyperopt", "bohb", "optuna"]
for search_method in search_methods:
if search_method == "bohb":
print("bobh test currently failing")
continue

tune_search = TuneSearchCV(
model,
parameter_grid,
Expand Down Expand Up @@ -206,9 +202,6 @@ def test_multi_best_classification_scoring_dict(self):
scoring = {"acc": "accuracy", "f1": "f1_micro"}
search_methods = ["random", "bayesian", "hyperopt", "bohb", "optuna"]
for search_method in search_methods:
if search_method == "bohb":
print("bobh test currently failing")
continue
tune_search = TuneSearchCV(
model,
parameter_grid,
Expand Down Expand Up @@ -239,9 +232,6 @@ def test_multi_best_regression(self):

search_methods = ["random", "bayesian", "hyperopt", "bohb", "optuna"]
for search_method in search_methods:
if search_method == "bohb":
print("bobh test currently failing")
continue
tune_search = TuneSearchCV(
model,
parameter_grid,
Expand Down
1 change: 1 addition & 0 deletions tune_sklearn/tune_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ def __init__(self,
if early_stopping is False:
raise ValueError(
"early_stopping must not be False when using BOHB")
early_stopping = "HyperBandForBOHB"
elif not isinstance(early_stopping, HyperBandForBOHB):
if early_stopping != "HyperBandForBOHB":
warnings.warn("Ignoring early_stopping value, "
Expand Down

0 comments on commit 03342e3

Please sign in to comment.