GPyOpt.models package¶
Submodules¶
GPyOpt.models.base module¶
-
class
GPyOpt.models.base.
BOModel
¶ Bases:
object
The abstract Model for Bayesian Optimization
-
MCMC_sampler
= False¶
-
analytical_gradient_prediction
= False¶
-
get_fmin
()¶ Get the minimum of the current model.
-
predict
(X)¶ Get the predicted mean and std at X.
-
predict_withGradients
(X)¶ Get the gradients of the predicted mean and variance at X.
-
updateModel
(X_all, Y_all, X_new, Y_new)¶ Augment the dataset of the model
-
GPyOpt.models.gpmodel module¶
-
class
GPyOpt.models.gpmodel.
GPModel
(kernel=None, noise_var=None, exact_feval=False, optimizer='bfgs', max_iters=1000, optimize_restarts=5, sparse=False, num_inducing=10, verbose=True, ARD=False)¶ Bases:
GPyOpt.models.base.BOModel
General class for handling a Gaussian Process in GPyOpt.
Parameters: - kernel – GPy kernel to use in the GP model.
- noise_var – value of the noise variance if known.
- exact_feval – whether noiseless evaluations are available. IMPORTANT to make the optimization work well in noiseless scenarios (default, False).
- optimizer – optimizer of the model. Check GPy for details.
- max_iters – maximum number of iterations used to optimize the parameters of the model.
- optimize_restarts – number of restarts in the optimization.
- sparse – whether to use a sparse GP (default, False). This is useful when many observations are available.
- num_inducing – number of inducing points if a sparse GP is used.
- verbose – print out the model messages (default, False).
- ARD – whether ARD is used in the kernel (default, False).
Note
This model does Maximum likelihood estimation of the hyper-parameters.
-
analytical_gradient_prediction
= True¶
-
copy
()¶ Makes a safe copy of the model.
-
static
fromConfig
()¶
-
get_fmin
()¶ Returns the location where the posterior mean is takes its minimal value.
-
get_model_parameters
()¶ Returns a 2D numpy array with the parameters of the model
-
get_model_parameters_names
()¶ Returns a list with the names of the parameters of the model
-
predict
(X)¶ Predictions with the model. Returns posterior means and standard deviations at X. Note that this is different in GPy where the variances are given.
-
predict_withGradients
(X)¶ Returns the mean, standard deviation, mean gradient and standard deviation gradient at X.
-
updateModel
(X_all, Y_all, X_new, Y_new)¶ Updates the model with new observations.
-
class
GPyOpt.models.gpmodel.
GPModel_MCMC
(kernel=None, noise_var=None, exact_feval=False, n_samples=10, n_burnin=100, subsample_interval=10, step_size=0.1, leapfrog_steps=20, verbose=False)¶ Bases:
GPyOpt.models.base.BOModel
General class for handling a Gaussian Process in GPyOpt.
Parameters: - kernel – GPy kernel to use in the GP model.
- noise_var – value of the noise variance if known.
- exact_feval – whether noiseless evaluations are available. IMPORTANT to make the optimization work well in noiseless scenarios (default, False).
- n_samples – number of MCMC samples.
- n_burnin – number of samples not used.
- subsample_interval – sub-sample interval in the MCMC.
- step_size – step-size in the MCMC.
- leapfrog_steps –
??
- verbose – print out the model messages (default, False).
Note
This model does MCMC over the hyperparameters.
-
MCMC_sampler
= True¶
-
analytical_gradient_prediction
= True¶
-
copy
()¶ Makes a safe copy of the model.
-
get_fmin
()¶ Returns the location where the posterior mean is takes its minimal value.
-
get_model_parameters
()¶ Returns a 2D numpy array with the parameters of the model
-
get_model_parameters_names
()¶ Returns a list with the names of the parameters of the model
-
predict
(X)¶ Predictions with the model for all the MCMC samples. Returns posterior means and standard deviations at X. Note that this is different in GPy where the variances are given.
-
predict_withGradients
(X)¶ Returns the mean, standard deviation, mean gradient and standard deviation gradient at X for all the MCMC samples.
-
updateModel
(X_all, Y_all, X_new, Y_new)¶ Updates the model with new observations.
GPyOpt.models.input_warped_gpmodel module¶
-
class
GPyOpt.models.input_warped_gpmodel.
InputWarpedGPModel
(space, warping_function=None, kernel=None, noise_var=None, exact_feval=False, optimizer='bfgs', max_iters=1000, optimize_restarts=5, verbose=False, ARD=False)¶ Bases:
GPyOpt.models.gpmodel.GPModel
Bayesian Optimization with Input Warped GP using Kumar Warping
The Kumar warping only applies to the numerical variables: continuous and discrete
- space : object
- Instance of Design_space defined in GPyOpt.core.task.space
- warping_function : object, optional
- Warping function defined in GPy.util.input_warping_functions.py. Default is Kumar warping
- kernel : object, optional
- An instance of kernel function defined in GPy.kern. Default is Matern 52
- noise_var : float, optional
- Value of the noise variance if known
- exact_feval : bool, optional
- Whether noiseless evaluations are available. IMPORTANT to make the optimization work well in noiseless scenarios, Default is False
- optimizer : string, optional
- Optimizer of the model. Check GPy for details. Default to bfgs
- max_iter : int, optional
- Maximum number of iterations used to optimize the parameters of the model. Default is 1000
- optimize_restarts : int, optional
- Number of restarts in the optimization. Default is 5
- verbose : bool, optional
- Whether to print out the model messages. Default is False
-
analytical_gradient_prediction
= False¶
GPyOpt.models.rfmodel module¶
-
class
GPyOpt.models.rfmodel.
RFModel
(bootstrap=True, criterion='mse', max_depth=None, max_features='auto', max_leaf_nodes=None, min_samples_leaf=1, min_samples_split=2, min_weight_fraction_leaf=0.0, n_estimators=500, n_jobs=1, oob_score=False, random_state=None, verbose=0, warm_start=False)¶ Bases:
GPyOpt.models.base.BOModel
General class for handling a Ramdom Forest in GPyOpt.
Note
The model has beed wrapper ‘as it is’ from Scikit-learn. Check
http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html for further details.
-
analytical_gradient_prediction
= False¶
-
get_fmin
()¶ Get the minimum of the current model.
-
predict
(X)¶ Predictions with the model. Returns posterior means and standard deviations at X.
-
updateModel
(X_all, Y_all, X_new, Y_new)¶ Updates the model with new observations.
-
GPyOpt.models.warpedgpmodel module¶
-
class
GPyOpt.models.warpedgpmodel.
WarpedGPModel
(kernel=None, noise_var=None, exact_feval=False, optimizer='bfgs', max_iters=1000, optimize_restarts=5, warping_function=None, warping_terms=3, verbose=False)¶ Bases:
GPyOpt.models.base.BOModel
-
analytical_gradient_prediction
= False¶
-
get_fmin
()¶ Get the minimum of the current model.
-
predict
(X)¶ Get the predicted mean and std at X.
-
updateModel
(X_all, Y_all, X_new, Y_new)¶ Augment the dataset of the model
-