Other

class bayes_opt.ScreenLogger(verbose: int = 2, is_constrained: bool = False) None

Logger that outputs text, e.g. to log to a terminal.

Parameters:
verbose : int

Verbosity level of the logger.

is_constrained : bool

Whether the logger is associated with a constrained optimization instance.

property is_constrained : bool

Return whether the logger is constrained.

update(event: str, instance: BayesianOptimization) None

Handle incoming events.

Parameters:
event : str

One of the values associated with Events.OPTIMIZATION_START, Events.OPTIMIZATION_STEP or Events.OPTIMIZATION_END.

instance : bayesian_optimization.BayesianOptimization

The instance associated with the step.

Return type:

None

property verbose : int

Return the verbosity level.

class bayes_opt.JSONLogger(path: str | PathLike[str], reset: bool = True)

Logger that outputs steps in JSON format.

The resulting file can be used to restart the optimization from an earlier state.

Parameters:
path : str or os.PathLike

Path to the file to write to.

reset : bool

Whether to overwrite the file if it already exists.

update(event: str, instance: BayesianOptimization) None

Handle incoming events.

Parameters:
event : str

One of the values associated with Events.OPTIMIZATION_START, Events.OPTIMIZATION_STEP or Events.OPTIMIZATION_END.

instance : bayesian_optimization.BayesianOptimization

The instance associated with the step.

Return type:

None

class bayes_opt.Events

Define optimization events.

Behaves similar to enums.