Taking the pain out of choosing a Python global optimizer
Project description
humpday
A package that helps you choose a Python global optimizer package, and strategy therin, from Ax-Platform, bayesian-optimization, DLib, HyperOpt, NeverGrad, Optuna, Platypus, PyMoo, PySOT, Scipy classic and shgo, Skopt, and UltraOpt.
-
50+ strategies are assigned Elo ratings by sister repo optimizer-elo-ratings
-
All are presented in a common calling syntax. By all means contribute more to optimizers.
-
Pass the dimensions of the problem, function evaluation budget and time budget to receive suggestions,
-
Or call the meta minimizer, which will choose one and run it.
from humpday import minimize best_val, best_x = minimize(f, n_dim=13, n_trials=130 )
Here f is intended to be minimized on the hypercube [0,1]^n_dim.
Optimizer suggestions
from pprint import pprint
from humpday import suggest
pprint(suggest(n_dim=5, n_trials=130,n_seconds=5*60))
where n_seconds is the total computation budget for the optimizer (not the objective function) over all 130 function evaluations. Alternatively you can pass an objective function:
from humpday import recommend
def my_objective(u):
time.sleep(0.01)
return u[0]*math.sin(u[1])
recommendations = recommend(my_objective, n_dim=21, n_trials=130)
As this function is very fast, some optimizers will be culled from the list.
Install
pip install humpday
Bleeding edge:
pip install git+https://github.com/microprediction/humpday
File an issue if you have problems. If you get a CMake error, try:
pip install cmake
pip install humpday
Optional packages
Install directly if you want them to be included:
pip install cmake
pip install ultraopt
pip install hyperopt
Articles
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.