Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions examples/hyperactive_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,11 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "59dd4715",
"metadata": {},
"outputs": [],
"source": [
"from hyperactive.experiment.toy import Parabola\n",
"\n",
"parabola = Parabola(42, 3, 4)"
]
"source": "from hyperactive.experiment.bench import Parabola\n\nparabola = Parabola(42, 3, 4)"
},
{
"cell_type": "markdown",
Expand Down
6 changes: 3 additions & 3 deletions examples/optimization_techniques/grid_search_sk.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import numpy as np
from hyperactive.opt import GridSearchSk
from hyperactive.experiment.toy import Sphere
from hyperactive.experiment.bench import Sphere

# Define the optimization problem using a toy sphere function
# Define the optimization problem using a benchmark sphere function
# The sphere function f(x,y) = x² + y² has its minimum at (0,0)
sphere_experiment = Sphere(n_dim=2)

Expand All @@ -29,5 +29,5 @@
experiment=sphere_experiment,
)

best_params = grid_search.run()
best_params = grid_search.solve()
print(f"Best params: {best_params}, Score: {grid_search.best_score_:.6f}")
11 changes: 11 additions & 0 deletions src/hyperactive/experiment/bench/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Benchmark experiments."""

from hyperactive.experiment.bench._ackley import Ackley
from hyperactive.experiment.bench._parabola import Parabola
from hyperactive.experiment.bench._sphere import Sphere

__all__ = [
"Ackley",
"Parabola",
"Sphere",
]
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Ackley(BaseExperiment):

Example
-------
>>> from hyperactive.experiment.toy import Ackley
>>> from hyperactive.experiment.bench import Ackley
>>> ackley = Ackley(a=20)
>>> params = {"x0": 1, "x1": 2}
>>> score, add_info = ackley.score(params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Parabola(BaseExperiment):

Example
-------
>>> from hyperactive.experiment.toy import Parabola
>>> from hyperactive.experiment.bench import Parabola
>>> parabola = Parabola(a=1.0, b=0.0, c=0.0)
>>> params = {"x": 1, "y": 2}
>>> score, add_info = parabola.score(params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Sphere(BaseExperiment):

Example
-------
>>> from hyperactive.experiment.toy import Sphere
>>> from hyperactive.experiment.bench import Sphere
>>> sphere = Sphere(const=0, n_dim=3)
>>> params = {"x0": 1, "x1": 2, "x2": 3}
>>> score, add_info = sphere.score(params)
Expand Down
11 changes: 0 additions & 11 deletions src/hyperactive/experiment/toy/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/hyperactive/opt/_adapters/_gfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def get_test_params(cls, parameter_set="default"):
"n_iter": 100,
}

from hyperactive.experiment.toy import Ackley
from hyperactive.experiment.bench import Ackley

ackley_exp = Ackley.create_test_instance()
params_ackley = {
Expand Down
2 changes: 1 addition & 1 deletion src/hyperactive/opt/gridsearch/_sk.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def get_test_params(cls, parameter_set="default"):
"param_grid": param_grid,
}

from hyperactive.experiment.toy import Ackley
from hyperactive.experiment.bench import Ackley

ackley_exp = Ackley.create_test_instance()
param_grid = {
Expand Down
4 changes: 2 additions & 2 deletions src/hyperactive/opt/random_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ def _solve(

@classmethod
def get_test_params(cls, parameter_set: str = "default"):
"""Provide deterministic toy configurations for unit tests."""
"""Provide deterministic benchmark configurations for unit tests."""
from hyperactive.experiment.bench import Ackley
from hyperactive.experiment.integrations import SklearnCvExperiment
from hyperactive.experiment.toy import Ackley

# 1) ML example (Iris + SVC)
sklearn_exp = SklearnCvExperiment.create_test_instance()
Expand Down
Loading