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.7.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.7-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ennbo-0.0.7.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.7.tar.gz
Algorithm Hash digest
SHA256 a4e94ce7aacd55ab7198b356703f9866cdbb60af54d163eb84547d33fdc6d4b9
MD5 a792e83a0faa51130c468462411cafd8
BLAKE2b-256 fe782d6d190bded0a12cfab124ceb8e6e8fbf1ed45b0c047ef5f70511d7c4228

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ennbo-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 9.3 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b2cfffbd59bbc4d7143f95de7920109232f28f4002e1fa3c3192be6f07bffb08
MD5 8e480feefa3c6ca06c73cfcdf4d110fa
BLAKE2b-256 dfed5c06ca20528648016215d58738059ccb61b67a7377fa28391d90a1fcab27

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