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.9.tar.gz (23.1 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.9-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ennbo-0.0.9.tar.gz
  • Upload date:
  • Size: 23.1 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.9.tar.gz
Algorithm Hash digest
SHA256 40e8385dfe261afd50e478791df17cbbab52857ddb2c35eb50c33e7df6b2b9f1
MD5 aba48df17ac3e7f4ec31f94f9a45f6d8
BLAKE2b-256 38dc12e9ceded3dddc3af9456a9285363de4c62816fd1318392adb422e292465

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ennbo-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 27.5 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8a1baf1f420dfba6f3671e84c4e92c86035174a4516a87aed93b405f855dbbf0
MD5 dae8af5eb57c1737327b3b3c75735d56
BLAKE2b-256 7b4c50ed7258cfd78a84fb20344ff09deeda3cbec943769a4a4a16e7faa5d5a5

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