bayes_opt.acquisition.GPHedge¶
- class bayes_opt.acquisition.GPHedge(base_acquisitions: Sequence[AcquisitionFunction], random_state: int | RandomState | None = None) None¶
GPHedge acquisition function.
At each suggestion step, GPHedge samples suggestions from each base acquisition function acq_i. Then a candidate is selected from the suggestions based on the on the cumulative rewards of each acq_i. After evaluating the candidate, the gains are updated (in the next iteration) based on the updated expectation value of the candidates.
- For more information, see:
Brochu et al., “Portfolio Allocation for Bayesian Optimization”, https://arxiv.org/abs/1009.5419
- Parameters:
base_acquisitions (
Sequence[AcquisitionFunction]) – Sequence of base acquisition functions.random_state (
int|RandomState|None) – Set the random state for reproducibility.
- base_acq(*args: Any, **kwargs: Any) NoReturn¶
Raise an error, since the base acquisition function is ambiguous.
- Return type:
NoReturn- Parameters:
args (Any)
kwargs (Any)
- get_acquisition_params() dict[str, Any]¶
Get the current acquisition function parameters.
- Return type:
dict[str,Any]- Returns:
dict – Dictionary containing the current acquisition function parameters.
- set_acquisition_params(params: dict[str, Any]) None¶
Set the acquisition function parameters.
- Parameters:
params (
dict[str,Any]) – Dictionary containing the acquisition function parameters.- Return type:
None
- suggest(gp: GaussianProcessRegressor, target_space: TargetSpace, n_random: int = 10000, n_smart: int = 10, fit_gp: bool = True, random_state: int | RandomState | None = None) ndarray[tuple[Any, ...], dtype[floating[Any]]]¶
Suggest a promising point to probe next.
- Parameters:
gp (
GaussianProcessRegressor) – A fitted Gaussian Process.target_space (
TargetSpace) – The target space to probe.n_random (
int) – Number of random samples to use.n_smart (
int) – Number of starting points for the L-BFGS-B optimizer.fit_gp (
bool) – Whether to fit the Gaussian Process to the target space. Set to False if the GP is already fitted.random_state (
int|RandomState|None) – Random state to use for the optimization.
- Return type:
ndarray[tuple[Any,...],dtype[floating[Any]]]- Returns:
np.ndarray – Suggested point to probe next.