API Reference¶
Scikit-Optimize, or skopt, is a simple and efficient library to minimize (very) expensive and noisy black-box functions. It implements several methods for sequential model-based optimization. skopt is reusable in many contexts and accessible.
skopt
: module¶
Base classes¶
|
Bayesian optimization over hyper parameters. |
|
Run bayesian optimisation loop. |
|
Initialize a search space from given specifications. |
Functions¶
|
Random search by uniform sampling within the given bounds. |
|
Store an skopt optimization result into a file. |
|
Compute the minimum over the predictions of the last surrogate model. |
|
Minimum search by doing naive random sampling, Returns the parameters that gave the minimum function value. |
|
Sequential optimisation using decision trees. |
|
Sequential optimization using gradient boosted trees. |
|
Bayesian optimization using Gaussian Processes. |
|
Reconstruct a skopt optimization result from a file persisted with skopt.dump. |
skopt.acquisition
: Acquisition¶
User guide: See the Acquisition section for further details.
|
A wrapper around the acquisition function that is called by fmin_l_bfgs_b. |
|
Use the expected improvement to calculate the acquisition values. |
|
Use the lower confidence bound to estimate the acquisition values. |
|
Use the probability of improvement to calculate the acquisition values. |
skopt.benchmarks
: A collection of benchmark problems.¶
A collection of benchmark problems.
User guide: See the Benchmarks section for further details.
Functions¶
A benchmark function for test purposes. |
|
Same as bench1 but returns the computation time (constant). |
|
A benchmark function for test purposes. |
|
A benchmark function for test purposes. |
|
A benchmark function for test purposes. |
|
A benchmark function for test purposes. |
|
|
Branin-Hoo function is defined on the square \(x1 \in [-5, 10], x2 \in [0, 15]\). |
|
The six dimensional Hartmann function is defined on the unit hypercube. |
skopt.callbacks
: Callbacks¶
Monitor and influence the optimization procedure via callbacks.
Callbacks are callables which are invoked after each iteration of the optimizer
and are passed the results “so far”. Callbacks can monitor progress, or stop
the optimization early by returning True
.
User guide: See the Callbacks section for further details.
|
Save current state after each iteration with |
|
Stop the optimization before running out of a fixed budget of time. |
|
Stop the optimization when |
|
Stop the optimization if the |
Decide to continue or not given the results so far. |
|
Log the elapsed time between each iteration of the minimization loop. |
|
|
Callback to control the verbosity. |
skopt.learning
: Machine learning extensions for model-based optimization.¶
Machine learning extensions for model-based optimization.
User guide: See the Learning section for further details.
|
ExtraTreesRegressor that supports conditional standard deviation. |
|
GaussianProcessRegressor that allows noise tunability. |
Predict several quantiles with one estimator. |
|
RandomForestRegressor that supports conditional std computation. |
skopt.optimizer
: Optimizer¶
User guide: See the Optimizer, an ask-and-tell interface section for further details.
|
Run bayesian optimisation loop. |
|
Base optimizer class |
|
Random search by uniform sampling within the given bounds. |
|
Sequential optimisation using decision trees. |
|
Sequential optimization using gradient boosted trees. |
|
Bayesian optimization using Gaussian Processes. |
skopt.plots
: Plotting functions.¶
Plotting functions.
User guide: See the Plotting tools section for further details.
|
Calculate the partial dependence for dimensions |
|
Calculate the partial dependence for a single dimension. |
|
Calculate the partial dependence for two dimensions in the search-space. |
|
Plot one or several convergence traces. |
|
Visualize the order in which points were sampled during optimization. |
|
Plots the optimization results and the gaussian process for 1-D objective functions. |
|
Plot a 2-d matrix with so-called Partial Dependence plots of the objective function. |
|
Create and return a Matplotlib figure and axes with a landscape contour-plot of the last fitted model of the search-space, overlaid with all the samples from the optimization results, for the two given dimensions of the search-space. |
|
Create and return a Matplotlib figure with a histogram of the samples from the optimization results, for a given dimension of the search-space. |
|
Plot one or several cumulative regret traces. |
skopt.utils
: Utils functions.¶
User guide: See the Utility functions section for further details.
|
Cook a default estimator. |
Cook a default initial point generator. |
|
|
Convert a dict representation of a search space into a list of dimensions, ordered by sorted(search_space.keys()). |
|
Compute the minimum over the predictions of the last surrogate model. |
Minimum search by doing naive random sampling, Returns the parameters that gave the minimum function value. |
|
|
Store an skopt optimization result into a file. |
|
Reconstruct a skopt optimization result from a file persisted with skopt.dump. |
|
Convert the list representation of a point from a search space to the dictionary representation, where keys are dimension names and values are corresponding to the values of dimensions in the list. |
|
Convert a dictionary representation of a point from a search space to the list representation. |
|
Wrapper / decorator for an objective function that uses named arguments to make it compatible with optimizers that use a single list of parameters. |
skopt.sampler
: Samplers¶
Utilities for generating initial sequences
User guide: See the Sampling methods section for further details.
|
Latin hypercube sampling |
|
Generates a new quasirandom Sobol vector with each call. |
|
Creates |
|
Creates |
skopt.space.space
: Space¶
User guide: See the Space section for further details.
|
Search space dimension that can take on categorical values. |
Base class for search space dimensions. |
|
|
Search space dimension that can take on integer values. |
|
Search space dimension that can take on any real value. |
|
Initialize a search space from given specifications. |
|
Turn a provided dimension description into a dimension object. |
skopt.space.transformers
: transformers¶
User guide: See the Transformers section for further details.
OneHotEncoder that can handle categorical variables. |
|
Identity transform. |
|
|
Base N logarithm transform. |
|
Scales each dimension into the interval [0, 1]. |
|
A lightweight pipeline to chain transformers. |
Base class for all 1-D transformers. |
|
LabelEncoder that can handle categorical variables. |
|
|
StringEncoder transform. |