Back

Bayesian Optimization

Finding the maximum of an unknown function by balancing promising predictions with uncertainty.

Bayesian optimization searches for the maximum of an unknown, expensive-to-evaluate function. Instead of testing every possible input, it builds a probabilistic model of the function and decides where to sample next. This demo uses one-dimensional test functions so the whole learning process stays visible: observations, the Gaussian process posterior, and the next proposed sample.

Connecting to the NumPy engine… Python · NumPy Deterministic start Article

Optimizer

Target function

Acquisition function

0.15

Shorter length scales allow sharper changes. Longer ones assume the function varies smoothly.

2.0

More exploration favors uncertain locations. More exploitation favors locations with strong predicted outcomes.

Samples

3

Function evaluations

Best x

—

Best sampled input

Best f(x)

—

Highest observed value

Next sample

—

Proposed input

Posterior

Gaussian Process Posterior

The model predicts where the function might be high while remaining uncertain about regions it has not explored.

Acquisition

Where Should We Sample Next?

The acquisition function determines the next point to evaluate by balancing predicted performance with uncertainty.