base#
Optimizer class definition
Classes
|
Base class for obsidian optimizer, which fits a surrogate model to data and suggests optimal experiments |
- class obsidian.optimizer.base.Optimizer(X_space: ParamSpace, seed: int | None = None, verbose: int = 1)[source]#
Bases:
ABC
Base class for obsidian optimizer, which fits a surrogate model to data and suggests optimal experiments
- X_space#
obsidian ParamSpace object representing the allowable space for optimization.
- Type:
- seed#
Randomization seed for the optimizer and stochastic surrogate models.
- Type:
int | None
- verbose#
Flag for monitoring and debugging optimization output.
- Type:
int
- Raises:
ValueError – If verbose is not set to 0, 1, 2, or 3.
TypeError – If X_space is not an obsidian ParamSpace
- property X_space#
The parameter space defining the search space for the optimization.
- Type:
- abstract fit(Z: DataFrame, target: Target | list[Target])[source]#
Fit the optimizer’s surrogate models to data
- hypervolume(f: Tensor, ref_point: list | None = None, weights: list | None = None) float [source]#
Calculates the hypervolume of the given data points.
- Parameters:
f (Tensor) – The data points to calculate the hypervolume for.
ref_point (list, optional) – The reference point for the hypervolume calculation. Defaults to
None
.weights (list, optional) – The weights to apply to each objective. Defaults to
None
.
- Returns:
The hypervolume value.
- Return type:
float
- Raises:
UnsupportedError – If the number of objectives is less than or equal to 1.
- pareto(f: Tensor) list[bool] [source]#
Determines the Pareto dominance of a given set of solutions.
- Parameters:
f (Tensor) – The input series containing the solutions.
- Returns:
A list of boolean values indicating whether each solution is Pareto optimal or not.
- Return type:
list[bool]
- pf_distance(y: Series) Tensor [source]#
Calculates the pairwise distance between the given input y and the Pareto front.
- Parameters:
y (pd.Series) – The input data.
- Returns:
The minimum distance between y and the Pareto front.
- Return type:
Tensor