Optimization¶
Run an optimization through vamos.optimize. For a first execution rather than a signature lookup, start with the Quickstart.
Stable public API. The 1.x compatibility policy defines the supported surface; import from the public facade shown below.
from vamos import optimize
Quickstart · Results · Algorithm configuration
max_evaluations is a hard evaluation budget subject to documented algorithm cardinality requirements. An explicit integer seed controls the built-in stochastic path in the same materially relevant environment; cross-backend bitwise equality is not promised. The generated reference below defines the arguments and their defaults.
optimize(problem, *, algorithm='auto', max_evaluations=None, termination=None, pop_size=None, engine=None, seed=DEFAULT_SEED, verbose=False, n_var=None, n_obj=None, problem_kwargs=None, algorithm_config=None, eval_strategy=None, live_viz=None, checkpoint=None)
¶
optimize(problem: str | ProblemProtocol, *, algorithm: AlgorithmName | str = 'auto', max_evaluations: int | None = None, termination: TerminationSpec | None = None, pop_size: int | None = None, engine: EngineName | str | None = None, seed: int | None = 42, verbose: bool = False, n_var: int | None = None, n_obj: int | None = None, problem_kwargs: Mapping[str, object] | None = None, algorithm_config: AlgorithmConfigProtocol | None = None, eval_strategy: EvaluationBackend | str | None = None, live_viz: LiveVisualization | None = None, checkpoint: CheckpointPayload | None = None) -> OptimizationResult
optimize(problem: str | ProblemProtocol, *, algorithm: AlgorithmName | str = 'auto', max_evaluations: int | None = None, termination: TerminationSpec | None = None, pop_size: int | None = None, engine: EngineName | str | None = None, seed: list[int] | tuple[int, ...], verbose: bool = False, n_var: int | None = None, n_obj: int | None = None, problem_kwargs: Mapping[str, object] | None = None, algorithm_config: AlgorithmConfigProtocol | None = None, eval_strategy: EvaluationBackend | str | None = None, live_viz: LiveVisualization | None = None, checkpoint: CheckpointPayload | None = None) -> StudyResult
Unified entry point for VAMOS optimization.
This function consolidates multiple APIs into a single powerful interface: - Accepts problem names (strings) or instances - Supports AutoML with algorithm="auto" - Handles multi-run studies with seed=[0,1,2,...] - Prefer optimize(...) for all runs (explicit options are available).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
problem
|
str | ProblemProtocol
|
Problem name (for registered problems) or a problem instance. |
required |
algorithm
|
AlgorithmName | str
|
Algorithm name or |
"auto"
|
max_evaluations
|
int | None
|
Maximum function evaluations. Auto-determined when omitted. |
None
|
termination
|
TerminationSpec | None
|
Explicit termination pair for advanced runs that also pass
|
None
|
pop_size
|
int | None
|
Population size. Auto-determined when omitted. |
None
|
engine
|
EngineName | str | None
|
Backend engine (for example |
None
|
seed
|
int | None | list[int] | tuple[int, ...]
|
Random seed for one run, |
``42``
|
verbose
|
bool
|
Enable VAMOS logging for the run. |
``False``
|
n_var
|
int | None
|
Override problem dimensions when using a registered string problem key. |
None
|
n_obj
|
int | None
|
Override problem dimensions when using a registered string problem key. |
None
|
problem_kwargs
|
Mapping[str, object] | None
|
Extra keyword arguments forwarded to problem instantiation. |
None
|
algorithm_config
|
AlgorithmConfigProtocol | None
|
Explicit algorithm config object. |
None
|
eval_strategy
|
EvaluationBackend | str | None
|
Evaluation backend name or backend instance. |
None
|
live_viz
|
LiveVisualization | None
|
Live visualization callback. |
None
|
checkpoint
|
CheckpointPayload | None
|
Warm-start checkpoint for compatible algorithms. Multi-seed runs do not accept checkpoints. |
None
|
Returns:
| Type | Description |
|---|---|
OptimizationResult | StudyResult
|
A single-run result for scalar |
Raises:
| Type | Description |
|---|---|
ConfigurationError
|
If inputs are invalid or the algorithm/engine combination is not supported. |
Examples:
|