diff --git a/src/hyperactive/__init__.py b/src/hyperactive/__init__.py index 4405d413..f9d63226 100644 --- a/src/hyperactive/__init__.py +++ b/src/hyperactive/__init__.py @@ -13,5 +13,3 @@ __version__ = importlib.metadata.version("hyperactive") __license__ = "MIT" - -__all__ = [] diff --git a/src/hyperactive/base/_optimizer.py b/src/hyperactive/base/_optimizer.py index 7ab8c68a..8dd08df2 100644 --- a/src/hyperactive/base/_optimizer.py +++ b/src/hyperactive/base/_optimizer.py @@ -76,3 +76,26 @@ def solve(self): best_params = self._solve(experiment, **search_config) self.best_params_ = best_params return best_params + + def _solve(self, experiment, *args, **kwargs): + """Run the optimization search process. + + Parameters + ---------- + experiment : BaseExperiment + The experiment to optimize parameters for. + *args : tuple + Positional arguments specific to the optimization backend. + **kwargs : dict + Keyword arguments specific to the optimization backend. + + Returns + ------- + dict with str keys + The best parameters found during the search. + Must have keys a subset or identical to experiment.paramnames(). + """ + raise NotImplementedError( + "abstract method, BaseOptimizer._solve should be implemented by " + "descendant classes" + ) diff --git a/src/hyperactive/opt/random_search.py b/src/hyperactive/opt/random_search.py index e6b1d40c..c6c23e10 100644 --- a/src/hyperactive/opt/random_search.py +++ b/src/hyperactive/opt/random_search.py @@ -1,4 +1,4 @@ -"""Grid search optimizer.""" +"""Random search optimizer.""" # copyright: hyperactive developers, MIT License (see LICENSE file)