egobox

Library Listed

A python binding for egobox crates

Checked · Sources

Downloads
26
Dependents
2
Stars
194
Forks
13
Contributors
8
Commits
915
Latest release
1.0.1 ·

About

From the project README ·

Efficient Global Optimization toolbox in Rust

EGObox - Efficient Global Optimization toolbox

Rust toolbox for Efficient Global Optimization method (arguably the most well-known bayesian optimization algorithm) which adresses the gradient-free optimization of expensive objective functions.

EGObox is twofold:

  1. for end-users: a Python module, the Python binding of the optimizer named Egor and the surrogate model Gpx, mixture of Gaussian processes, written in Rust.
  2. for developers: a set of Rust libraries useful to implement bayesian optimization (EGO-like) algorithms,

The Python module

Installation
pip install egobox
Egor optimizer
import numpy as np
import egobox as egx

# Objective function
def f_obj(x: np.ndarray) -> np.ndarray:
    return (x - 3.5) * np.sin((x - 3.5) / (np.pi))

# Minimize f_opt in [0, 25]
optim = egx.Egor([[0.0, 25.0]]).minimize(f_obj, max_iters=20, seed=42)
print(f"Optimization f={optim.result.y_opt} at {optim.result.x_opt}")  # Optimization f=[-15.12510323] at [18.93525454]

See also this example written in Rust

Read the full README
Gpx surrogate model
import numpy as np
import matplotlib.pyplot as plt
import egobox as egx

# Training
xtrain = np.array([0.0, 1.0, 2.0, 3.0, 4.0])
ytrain = np.array([0.0, 1.0, 1.5, 0.9, 1.0])
gpx = egx.Gpx.builder().fit(xtrain, ytrain)

# Prediction
xtest = np.linspace(0, 4, 100).reshape((-1, 1))
ytest = gpx.predict(xtest)

# Plot
plt.plot(xtest, ytest)
plt.plot(xtrain, ytrain, "o")
plt.show()

See also this example written in Rust

See the tutorial notebooks and examples folder for more information on the usage of the optimizer and mixture of Gaussian processes surrogate model.

The Rust libraries

egobox Rust libraries consists of the following sub-packages.

NameVersionDocumentationDescription
doesampling methods; contains LHS, FullFactorial, Random methods
gpgaussian process regression; contains Kriging, PLS dimension reduction and sparse methods
moemixture of experts using GP models
egoefficient global optimization with constraints, mixed integer handling and multi-objective optimization (experimental)
Usage

Depending on the sub-packages you want to use, you have to add following declarations to your Cargo.toml

[dependencies]
egobox-doe = { version = "0.x.y" }
egobox-gp  = { version = "0.x.y" }
egobox-moe = { version = "0.x.y" }
egobox-ego = { version = "0.x.y" }
Features

The table below presents the various features available depending on the subcrate

Namedoegpmoeego
serializable✔️✔️
persistent✔️
blas✔️✔️✔️
c-cobyla✔️✔️✔️
c-slsqp✔️

Note: moe and ego models are always serializable and can be saved/loaded (json or binary format).

serializable

When selected, the serialization with serde crate is enabled.

persistent

When selected, the save and load as a json file with serde_json crate is enabled.

blas

When selected, the usage of BLAS/LAPACK backend is possible, see below for more information.

c-cobyla, c-slsqp

By default, Basin pure Rust optimizers are used: COBYLA for GP hyperparameters training (gp, moe) and COBYLA/SLSQP for infill criterion optimization (ego), which also always uses Basin to execute the EGO loop.

When selected, c-cobyla (resp. c-slsqp) uses the cobyla (resp. slsqp) crate, a C-ported NLopt implementation, instead of the Basin one. These features are also available on egobox-gpx and the Python package. See Basin integration for build commands, checkpoint behavior, and reproducible comparisons.

Examples

Examples (in examples/ sub-packages folder) are run as follows:

cd doe && cargo run --example samplings --release
cd gp && cargo run --example kriging --release
cd moe && cargo run --example clustering --release
cd ego && cargo run --example ackley --release
cd ego && cargo run --example zdt1 --release  # multi-objective optimization
BLAS/LAPACK backend (optional)

egobox relies on linfa project for methods like clustering and dimension reduction, but also try to adopt as far as possible the same coding structures.

As for linfa, the linear algebra routines used in gp, moe ad ego are provided by the pure-Rust linfa-linalg crate, the default linear algebra provider.

Otherwise, you can choose an external BLAS/LAPACK backend available through the ndarray-linalg crate. In this case, you have to specify the blas feature and a linfa BLAS/LAPACK backend feature (more information in linfa features).

Thus, for instance, to use gp with the Intel MKL BLAS/LAPACK backend, you could specify in your Cargo.toml the following features:

[dependencies]
egobox-gp = { version = "0.x.y", features = ["blas", "linfa/intel-mkl-static"] }

or you could run the gp example as follows:

cd gp && cargo run --example kriging --release --features blas,linfa/intel-mkl-static

Citation

If you find this project useful for your research, you may cite it as follows:

@article{
  Lafage2022, 
  author = {Rémi Lafage}, 
  title = {EGObox, a Rust toolbox for efficient global optimization}, 
  journal = {Journal of Open Source Software} 
  year = {2022}, 
  doi = {10.21105/joss.04737}, 
  url = {https://doi.org/10.21105/joss.04737}, 
  publisher = {The Open Journal}, 
  volume = {7}, 
  number = {78}, 
  pages = {4737}, 
} 

Additionally, you may consider adding a star to the repository. This positive feedback improves the visibility of the project.

References

Bartoli, N., Lefebvre, T., Dubreuil, S., Olivanti, R., Priem, R., Bons, N., Martins, J. R. R. A., & Morlier, J. (2019). Adaptive modeling strategy for constrained global optimization with application to aerodynamic wing design. Aerospace Science and Technology, 90, 85–102.

Bouhlel, M. A., Bartoli, N., Otsmane, A., & Morlier, J. (2016). Improving kriging surrogates of high-dimensional design models by partial least squares dimension reduction. Structural and Multidisciplinary Optimization, 53(5), 935–952.

Bouhlel, M. A., Hwang, J. T., Bartoli, N., Lafage, R., Morlier, J., & Martins, J. R. R. A. (2019). A python surrogate modeling framework with derivatives. Advances in Engineering Software, 102662.

Dubreuil, S., Bartoli, N., Gogu, C., & Lefebvre, T. (2020). Towards an efficient global multi-disciplinary design optimization algorithm Structural and Multidisciplinary Optimization, 62(4), 1739–1765.

Jin, R. and Chen, W. and Sudjianto, A. (2005). An efficient algorithm for constructing optimal design of computer experiments Journal of Statistical Planning and Inference, 134:268-287.

Bettebghor, Dimitri, et al. (2011). Surrogate modeling approximation using a mixture of experts based on EM joint estimation Structural and multidisciplinary optimization 43.2 (2011): 243-259.

Jones, D. R., Schonlau, M., & Welch, W. J. (1998). Efficient global optimization of expensive black-box functions. Journal of Global Optimization, 13(4), 455–492.

Knowles, J. (2006). ParEGO: a hybrid algorithm with on-line landscape approximation for expensive multiobjective optimization problems. IEEE Transactions on Evolutionary Computation, 10(1), 50–66.

Zhan, D., Cheng, Y., & Liu, J. (2017). Expected improvement matrix-based infill criteria for expensive multiobjective optimization. IEEE Transactions on Evolutionary Computation, 21(6), 956–975.

Emmerich, M. T. M., Giannakoglou, K. C., & Naujoks, B. (2006). Single- and multiobjective evolutionary optimization assisted by Gaussian random field metamodels. IEEE Transactions on Evolutionary Computation, 10(4), 421–439.

Daulton, S., Balandat, M., & Bakshy, E. (2020). Differentiable Expected Hypervolume Improvement for Parallel Multi-Objective Bayesian Optimization. Advances in Neural Information Processing Systems 33 (NeurIPS 2020), 9851–9864.

Diouane, Youssef, et al. (2023). TREGO: a trust-region framework for efficient global optimization. Journal of Global Optimization 86.1 (2023): 1-23.

Diouane, Y., El Hallaoui, I., Kadri, M., & Lamghari, A. (2026). STREGO: A Scalable Implementation of a Trust-Region Framework for Noisy Bayesian Optimization. arXiv:2610.14338.

Priem, Rémy, Nathalie Bartoli, and Youssef Diouane. (2019) On the use of upper trust bounds in constrained Bayesian optimization infill criteria. AIAA aviation 2019 forum. 2019.

Sasena M., Papalambros P., Goovaerts P., (2002). Global optimization of problems with disconnected feasible regions via surrogate modeling. AIAA Paper.

Ginsbourger, D., Le Riche, R., & Carraro, L. (2010). Kriging is well-suited to parallelize optimization

E.C. Garrido-Merchan and D. Hernandez-Lobato. Dealing with categorical and integer-valued variables in Bayesian Optimization with Gaussian processes.

Zhan, Dawei, et al. (2024). A cooperative approach to efficient global optimization. Journal of Global Optimization 88.2 (2024): 327-357

Lisa Pretsch et al. (2025). Bayesian optimization of cooperative components for multi-stage aero-structural compressor blade design. Struct Multidisc Optim 68, 84 (2025)

Appriou, T., Rullière, D. & Gaudrie, D, (2024) Combination of optimization-free kriging models for high-dimensional problems, Comput Stat 39, 3049–3071 (2024).

S. Ament, S. Daulton, D. Eriksson, M. Balandat, E. Bakshy, (2023). Unexpected improvements to expected improvement for bayesian optimization, Advances in Neural Information Processing Systems, 2023

Marrel, A., & Iooss, B. (2024). Probabilistic surrogate modeling by Gaussian process: A review on recent insights in estimation and validation. Reliability Engineering & System Safety, 247, 110094.

Bussemaker, Jasper H., et al. (2024). Surrogate-based optimization of system architectures subject to hidden constraints. AIAA Aviation forum and Ascend 2024.

Tfaily, Ali, et al. (2024). Bayesian optimization with hidden constraints for aircraft design. Structural and Multidisciplinary Optimization 67.7 (2024): 123.

Larsson, J. (2026). Basin: Efficient and Extensible Numerical Optimization in Rust. arXiv:2608.11279. basin.rs

Marchildon, A. (2026). GpFlash: Maximizing Speed and Minimizing Memory for Gaussian Process Training and Prediction. arXiv:2610.16861.

smtorg. (2018). Surrogate modeling toolbox. GitHub.

License

Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0

Runs on
GPU support unknown
What shows it
  • no dependency or feature matches a backend row
Native code
Optional
  • Binds native code: lapack-sys (feature blas)
Python bindings
Has Python bindings
  • egobox needs Python
License
Apache-2.0

Compare with similar projects

Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.

egobox beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
egobox This page Listed

A python binding for egobox crates

Python bindings

26 downloads over 30 days 2 194 1.0.1 GPU support unknown Binds native code: lapack-sys (feature blas) Apache-2.0
linfa Featured

A Machine Learning framework for Rust

177,963 downloads over 30 days 60 4,770 0.8.1 GPU support unknown Binds native code: lapack-sys (feature intel-mkl-static) Apache-2.0 OR MIT
leiden-rs Listed

High-performance Leiden community detection algorithm for graphs in Rust

41,983 downloads over 30 days 10 Not measured 0.8.1 GPU support unknown No native code found Apache-2.0 OR MIT

A robust statistics library for regression analysis

8,310 downloads over 30 days 6 8 0.12.2 GPU support unknown No native code found MIT
augurs Listed

A time-series toolkit for forecasting, outlier detection, clustering and more.

7,507 downloads over 30 days 8 580 0.10.3 GPU support unknown No native code found Apache-2.0 OR MIT
fa-leiden-cd Listed Dormant

A Rust implementation of the Leiden algorithm for community detection in large networks.

1,765 downloads over 30 days 1 1 0.1.0 GPU support unknown No native code found MIT
treeboost Listed

Gradient-boosted decision trees for tabular data: trains a baseline model in one call, with full control over boosting modes and configs, and Scalar, AVX-512, SVE2, WGPU and CUDA backends.

Python bindings

18 downloads over 30 days 0 9 0.1.2 CUDA, WebGPU No native code found Apache-2.0
Why ListedNo archive, New or Featured rule places it, so it is Listed.

What it lacks for Featured

  • It has 2 active dependents and 1 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 194 stars, 13 forks and 8 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.

What else the check found

Exact rules: Listed, Featured library. The check on applied thresholds version 9.

Every rule outcome, as the check records it
  • expected-interval: version 1.0.1 base 300, capped at 4 releases = 200, raised to the 365-day floor: E = 365 days
  • dormancy: last activity 2026-11-06, 3 days ago, E = 365: active
  • rot: deprecated requirement `bincode (RUSTSEC-2025-0141, https://rustsec.org/advisories/RUSTSEC-2025-0141.html)`
  • featured: not featured: active_users 2 < 11 and new_adopters 1 < 9 and repository route stars 194 (needs 4539), forks 13 (needs 434), contributors 8 (needs 79)
  • listed: listed: no archive, new or featured rule applies
Crates7 crates

Measurements and sources

Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.

Sources6 sources
Adoption2 active dependents, 1 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents2crates.io database dumpYes
New dependents (365 days)1crates.io database dumpYes
Peak active dependents2crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 3 days ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-11-06GitHub repositoryYes
Latest release2026-11-06crates.io database dumpYes
First release2022-04-12crates.io database dumpYes
Latest version1.0.1crates.io database dumpYes
Days the oldest outside issue waits for a reply4GitHub repositoryYes
Maintainer replies over 365 days37GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementbincode (RUSTSEC-2025-0141, https://rustsec.org/advisories/RUSTSEC-2025-0141.html)crates.io database dumpYes
Distribution4 releases, 26 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases4crates.io database dumpYes
Downloads over 30 days26crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository194 stars, 13 forks, 8 contributors, 915 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars194GitHub repositoryYes — one part of the repository route
GitHub forks13GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account8GitHub contributorsYes — one part of the repository route
Commits on the default branch915GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseApache-2.0crates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesBinds native code: lapack-sys (feature blas)crates.io database dumpNo
Python bindings, from direct dependencies of listed cratesHas Python bindings: egobox needs Pythoncrates.io database dumpNo
Crates that depend on a listed crate directly2crates.io database dumpNo

Corrections and review history

Report a correction

No correction applies to this entry.

Judgments

A judgment enters only through an approved issue and a merged pull request.

No judgment applies to this entry.