skillfed

bayesian-optimization

Bayesian Optimization package

bayesian-optimization v3.3.0 789.7K downloads/30d#5,053 on PyPI
Permissive license The MIT License (MIT) Copyright (c) 2014 Fernando M. F. Nogueira Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) Active released

What it is and what it does

Bayesian Optimization is a constrained global optimization library that finds the maximum of an unknown function by constructing a posterior distribution (Gaussian process) of candidate functions and iteratively selecting the most promising parameter combinations to evaluate. It is designed for scenarios where evaluating the objective function is computationally expensive or time-consuming—such as hyperparameter tuning for machine learning models, experimental design, or simulation-based optimization.

The package works by fitting a Gaussian Process to previously observed function evaluations, then using an acquisition function (such as Upper Confidence Bound or Expected Improvement) to decide which parameters to try next. This approach reduces the number of function evaluations needed compared to grid search or random search. It supports bounded parameter spaces, random initialization phases to diversify exploration, and access to both the best result found and the full history of all trials.

Use it for:

  • Tune hyperparameters of machine learning models when cross-validation is expensive
  • Optimize expensive simulations or physical experiments with limited budget for trials
  • Find optimal configuration parameters for systems where evaluation is time-consuming
  • Explore high-dimensional parameter spaces where grid or random search is infeasible
  • Balance exploration vs. exploitation in sequential decision-making problems

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Bayesian optimization using Gaussian processes to find the maximum of an expensive unknown function with minimal iterations, balancing exploration and exploitation automatically.

Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and uses permissive MIT licensing. It is well-suited for anyone optimizing expensive functions where reducing the number of evaluations matters. The dependency chain (numpy, scipy, scikit-learn) is standard and stable. Start with it if you need Bayesian optimization; the API is straightforward.

Install

bayesian-optimization on PyPI

pip

pip install bayesian-optimization

uv

uv add bayesian-optimization

poetry

poetry add bayesian-optimization

Installing bayesian-optimization

Before you install

Low friction install with pure Python wheels. Actively maintained as of 76 days ago, supports Python 3.9 through 3.14, and depends on well-established scientific libraries (numpy, scipy, scikit-learn).

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and proprietary projects.

Quickstart

pip install bayesian-optimization

from bayesian_optimization import BayesianOptimization

def black_box_function(x, y):
    return -x**2 - (y - 1)**2 + 1

optimizer = BayesianOptimization(
    f=black_box_function,
    pbounds={'x': (2, 4), 'y': (-3, 3)},
    random_state=1,
)
optimizer.maximize(init_points=2, n_iter=3)
print(optimizer.max)

Verify before relying

  • Whether the package handles multi-objective optimization or only single-objective maximization
  • Performance characteristics on high-dimensional parameter spaces (scalability limits)
  • Whether parallel or distributed evaluation of the objective function is supported

Package facts

License The MIT License (MIT) Copyright (c) 2014 Fernando M. F. Nogueira Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 5 — colorama, numpy, packaging, scikit-learn, scipy
Maintenance actively maintained — 76 days since the last release
First released
Downloads 789,659/month — #5,053 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: bayesian_optimization-3.3.0-py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

bayesian optimizationgaussian process optimizationhyperparameter tuningexpensive function optimizationconstrained global optimizationblack-box function optimizationacquisition function maximization
optimizationhyperparameter-tuninggaussian-processes

More Mathematics packages

Further reading