Skip to main content

Package used to find the maximum or minimum of any 2D function using Bayesian optimization

Project description

# Bayesian2D

This package implements Bayesian optimization in Python for any 2D function. It uses Gaussian regression to create a surrogate function and the Maximum Probability of Improvement aquisition function to pick points to evaluate, thus finding the specified extremum of the function in only a few hundred evaluations.

# How to install

The package can simply be installed with ‘pip install Bayesian2D’.

# How to use

The package contains two directories- tools and tests. The tools folder contains all the separate python functions used by the algorithm, with the Bayesian2D function being the main function of the package.

To optimize your function just import ‘from Bayesian2D.tools import Bayesian2D’. The function takes as an input the function you wish to optimize and the bounds in which you wish to search for the extremum (there are a few built in named functions such as ‘Beale’ or ‘Ackley’ with the Rosenbrock function being the default but custom functions can also be inserted). The function also requires you to specify the number of initial points evaluated, the number of optimization cycles run, the number of random points evaluated by the surrogate function each cycle, the exploration constant and whether you want to find the maximum or minimum.

# Testing

Unit tests for all the functions used can be found in the aforementioned tests directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Bayesian2D-0.3.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Bayesian2D-0.3.1-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file Bayesian2D-0.3.1.tar.gz.

File metadata

  • Download URL: Bayesian2D-0.3.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6

File hashes

Hashes for Bayesian2D-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f3d9e8ec7c2a6e3684fd140ed725d4366fb4f443fba2488ee696d98ddf43e999
MD5 df61d778892401f6abdbf1e609c06bb8
BLAKE2b-256 5ddb829d2abe56768e55c3fcea23d520e92e0eff5013de88c7fbcbd08312bc89

See more details on using hashes here.

File details

Details for the file Bayesian2D-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: Bayesian2D-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6

File hashes

Hashes for Bayesian2D-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e77aa73c0323b2e08a162634d246d59137b7db3147516101302a3887909b8dd
MD5 2a32e78d2f576f1e8990ab523546f52c
BLAKE2b-256 18021f8fe4785c4a07d823565a58219a230c7f9d94541f1e135ca09a1175ea2b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page