Skip to content

Commit 9ecafbc

Browse files
committed
[BUG] fix cmaes optimizer tests
1 parent 9dd652c commit 9ecafbc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/hyperactive/opt/optuna/_cmaes_optimizer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def get_test_params(cls, parameter_set="default"):
128128
from sklearn.datasets import make_regression
129129
from sklearn.neural_network import MLPRegressor
130130

131+
from hyperactive.experiment.bench import Sphere
131132
from hyperactive.experiment.integrations import SklearnCvExperiment
132133

133134
# Test case 1: Basic continuous parameters (from base)
@@ -165,6 +166,8 @@ def get_test_params(cls, parameter_set="default"):
165166
)
166167

167168
# Test case 3: High-dimensional continuous space (CMA-ES strength)
169+
# Use Sphere benchmark which expects x0, x1, ..., xN params
170+
sphere_exp = Sphere(n_dim=6)
168171
high_dim_continuous = {
169172
f"x{i}": (-1.0, 1.0)
170173
for i in range(6) # 6D continuous optimization
@@ -174,7 +177,7 @@ def get_test_params(cls, parameter_set="default"):
174177
{
175178
"param_space": high_dim_continuous,
176179
"n_trials": 12,
177-
"experiment": mlp_exp,
180+
"experiment": sphere_exp,
178181
"sigma0": 0.7, # Larger initial spread
179182
"n_startup_trials": 3,
180183
}

0 commit comments

Comments
 (0)