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.6.tar.gz (45.9 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.6-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ennbo-0.0.6.tar.gz
  • Upload date:
  • Size: 45.9 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.6.tar.gz
Algorithm Hash digest
SHA256 91db7ed262df7ff3b9ae1cc730b8d27bad8d7b7d73ea9bfed47b5d29cd5298ac
MD5 ff1d6bf1b058363bd081415fcb2df722
BLAKE2b-256 c47e3b1614312648d7017f48117e50653ebd8947733e28d0d802a8b193145f0e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ennbo-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 18.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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 65866fa9d7b1a49dce289528b6479c79eddc7911f21e0c7982190a524af13321
MD5 78305fe46e8a70d5e217167bd37bd6dd
BLAKE2b-256 aa8b5f63a173dd8cf61981c78bbef098869601eb3d719ca3177fc288165f742b

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