| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """Base class for optimizer.""" |
||
| 2 | |||
| 3 | from skbase.base import BaseObject |
||
| 4 | |||
| 5 | |||
| 6 | class BaseOptimizer(BaseObject): |
||
| 7 | """Base class for optimizer.""" |
||
| 8 | |||
| 9 | def __init__(self): |
||
| 10 | super().__init__() |
||
| 11 | |||
| 12 | def add_search(self, experiment, search_config: dict): |
||
| 13 | """Add a new optimization search process with specified parameters. |
||
| 14 | |||
| 15 | Parameters |
||
| 16 | ---------- |
||
| 17 | experiment : BaseExperiment |
||
| 18 | The experiment to optimize parameters for. |
||
| 19 | search_config : dict with str keys |
||
| 20 | The search configuration dictionary. |
||
| 21 | """ |
||
| 22 | self.experiment = experiment |
||
| 23 | self.search_config = search_config |
||
| 24 | |||
| 25 | def run(self, max_time=None): |
||
| 26 | """Run the optimization search process. |
||
| 27 | |||
| 28 | Parameters |
||
| 29 | ---------- |
||
| 30 | max_time : float |
||
| 31 | The maximum time used for the optimization process. |
||
| 32 | """ |
||
| 33 | raise NotImplementedError |
||
| 34 |