Skip to content

Commit

Permalink
Upgrade Optuna (#1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkall authored Jul 23, 2024
1 parent 67f4048 commit d24d2e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion flaml/tune/searcher/suggestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,15 @@ def __init__(
self._space = space

self._points_to_evaluate = points_to_evaluate or []
self._evaluated_rewards = evaluated_rewards
# rewards should be a list of floats, not a dict
# After Optuna > 3.5.0, there is a check for NaN in the list "any(math.isnan(x) for x in self._values)"
# which will raise an error when encountering a dict
if evaluated_rewards is not None:
self._evaluated_rewards = [
list(item.values())[0] if isinstance(item, dict) else item for item in evaluated_rewards
]
else:
self._evaluated_rewards = evaluated_rewards

self._study_name = "optuna" # Fixed study name for in-memory storage

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"catboost>=0.26,<1.2; python_version<'3.11'",
"catboost>=0.26; python_version>='3.11'",
"rgf-python",
"optuna==2.8.0",
"optuna>=2.8.0,<=3.6.1",
"openml",
"statsmodels>=0.12.2",
"psutil==5.8.0",
Expand Down Expand Up @@ -94,7 +94,7 @@
],
"catboost": ["catboost>=0.26"],
"blendsearch": [
"optuna==2.8.0",
"optuna>=2.8.0,<=3.6.1",
"packaging",
],
"ray": [
Expand Down Expand Up @@ -153,7 +153,7 @@
],
"synapse": [
"joblibspark>=0.5.0",
"optuna==2.8.0",
"optuna>=2.8.0,<=3.6.1",
"pyspark>=3.2.0",
],
"autozero": ["scikit-learn", "pandas", "packaging"],
Expand Down

0 comments on commit d24d2e0

Please sign in to comment.