Upgrade Optuna (#1321)

This commit is contained in:
Li Jiang
2024-07-23 09:21:20 +08:00
committed by GitHub
parent 67f4048667
commit d24d2e0088
2 changed files with 12 additions and 4 deletions

View File

@@ -561,7 +561,15 @@ class OptunaSearch(Searcher):
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

View File

@@ -65,7 +65,7 @@ setuptools.setup(
"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",
@@ -94,7 +94,7 @@ setuptools.setup(
],
"catboost": ["catboost>=0.26"],
"blendsearch": [
"optuna==2.8.0",
"optuna>=2.8.0,<=3.6.1",
"packaging",
],
"ray": [
@@ -153,7 +153,7 @@ setuptools.setup(
],
"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"],