Skip to main content

Epistemic Nearest Neighbors

Project description

Epistemic Nearest Neighbors

A fast, alternative surrogate for Bayesian optimization

ENN estimates a function's value and associated epistemic uncertainty using a K-Nearest Neighbors model. Queries take $O(N lnK)$ time, where $N$ is the number of observations available for KNN lookups. Compare to an exact GP, which takes $O(N^2)$ time. Additionally, measured running times are very small compared to GPs and other alternative surrogates. [1]

Contents

  • ENN model, EpistemicNearestNeighbors [1]
  • TuRBO-ENN optimizer, class TurboOptimizer has four modes
    • TURBO_ONE - A clone of the TuRBO [2] reference code, reworked to have an ask()/tell() interface.
    • TURBO_ENN - Same as TURBO_ONE, except uses ENN instead of GP and Pareto(mu, se) instead of Thompson sampling.
    • TURBO_ZERO - Same as TURBO_ONE, except randomly-chosen RAASP [3] candidates are picked to be proposals. There is no surrogate.
    • LHD_ONLY - Just creates an LHD design for every ask(). Good for a baseline and for testing.

[1] Sweet, D., & Jadhav, S. A. (2025). Taking the GP Out of the Loop. arXiv preprint arXiv:2506.12818.
https://arxiv.org/abs/2506.12818
[2] Eriksson, D., Pearce, M., Gardner, J. R., Turner, R., & Poloczek, M. (2020). Scalable Global Optimization via Local Bayesian Optimization. Advances in Neural Information Processing Systems, 32.
https://arxiv.org/abs/1910.01739
[3] Rashidi, B., Johnstonbaugh, K., & Gao, C. (2024). Cylindrical Thompson Sampling for High-Dimensional Bayesian Optimization. Proceedings of The 27th International Conference on Artificial Intelligence and Statistics (pp. 3502–3510). PMLR.
https://proceedings.mlr.press/v238/rashidi24a.html

Installation

pip install ennbo

Demonstration

demo_enn.ipynb - Shows how to use EpistemicNearestNeighbors to build and query an ENN model.
demo_turbo_enn.ipynb - Shows how to use TurboOptimizer to optimize the Ackley function.

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

ennbo-0.0.8.tar.gz (46.0 MB view details)

Uploaded Source

Built Distribution

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

ennbo-0.0.8-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file ennbo-0.0.8.tar.gz.

File metadata

  • Download URL: ennbo-0.0.8.tar.gz
  • Upload date:
  • Size: 46.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for ennbo-0.0.8.tar.gz
Algorithm Hash digest
SHA256 612d2d8ac988e7a3f29e70598276ef906f1939e110b5c2e1a539f706d2ad7b4a
MD5 7c10a31618891a518e9cbd5311e80669
BLAKE2b-256 5c680c56b4c287cbe8acb9f19010d7efe4dfee882efb424e173f304218b19f1e

See more details on using hashes here.

File details

Details for the file ennbo-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: ennbo-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for ennbo-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 cd951886e5ea194576e1fac2fa851e3bf8e89dabf579fb72ce29ada8cab094bd
MD5 ad9a240b2ce4dff3f2f99f67123d253a
BLAKE2b-256 cffbae0294eb09f1f0078ecd0010ef10ed787a9529fc67f9a709b32331f4dee4

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