--- id: hyperopt version: "0.3.0" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # hyperopt — Distributed Asynchronous Hyperparameter Optimization License: permissive · Maintenance: active · Downloads: 2.9M/mo ## What it is and what it does Hyperopt is a Python library for optimizing over complex, mixed-type search spaces—those containing real-valued, discrete, and conditional parameters. It implements three algorithms: Random Search, Tree of Parzen Estimators (TPE), and Adaptive TPE. The library is designed for both serial optimization on a single machine and parallel optimization across multiple workers using Apache Spark or MongoDB as backends. You define an objective function to minimize, specify a search space using hyperopt's domain language (hp.choice, hp.uniform, hp.lognormal, etc.), and call fmin() with your chosen algorithm. Hyperopt then explores the space, returning the best parameters found. It's commonly used for tuning machine learning model hyperparameters, though it applies to any optimization problem over awkward search spaces. Use it for: - Tune scikit-learn or neural network hyperparameters (learning rate, regularization, layer sizes) to minimize validation loss - Optimize conditional configurations where some parameters only apply under certain choices (e.g., different solvers with different hyperparameters) - Parallelize hyperparameter search across a Spark cluster or MongoDB-backed worker pool for large-scale experiments - Benchmark different algorithms (Random Search vs. TPE) on the same search space to understand their relative efficiency - Explore high-dimensional spaces where grid search or random search becomes prohibitively expensive ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Hyperopt performs serial and parallel hyperparameter optimization over mixed search spaces using algorithms like Tree of Parzen Estimators (TPE), Random Search, and Adaptive TPE. Yes. Hyperopt is actively maintained, has no known vulnerabilities, installs with low friction, and is well-suited for anyone doing hyperparameter optimization beyond simple grid or random search. The TPE algorithm is more sample-efficient than random search for most problems. The BSD-3-Clause license poses no restrictions. Start here if you need Bayesian optimization without the overhead of setting up a full Gaussian process library. ## Install pip install hyperopt uv add hyperopt poetry add hyperopt ## Installing hyperopt Before you install: Low friction install with a pure-Python wheel. Actively maintained with a release 21 days ago and a recent commit on 2026-08-10. Six runtime dependencies (cloudpickle, importlib-resources, networkx, numpy, scipy, tqdm) are all stable, widely-used libraries. License in practice: BSD-3-Clause is permissive; you can use, modify, and distribute hyperopt freely in commercial and open-source projects provided you include the license notice. Quickstart: pip install hyperopt from hyperopt import hp, fmin, tpe, space_eval def objective(args): case, val = args return val if case == 'case 1' else val ** 2 space = hp.choice('a', [('case 1', 1 + hp.lognormal('c1', 0, 1)), ('case 2', hp.uniform('c2', -10, 10))]) best = fmin(objective, space, algo=tpe.suggest, max_evals=100) print(space_eval(space, best)) Verify before relying: - Whether optional extras (SparkTrials, MongoTrials, ATPE) require additional system dependencies beyond what pip installs - Performance characteristics and scalability limits for very large search spaces or high-dimensional problems - How well the package handles edge cases like conditional dimensions with many branches ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags hyperparameter optimization, bayesian optimization library, parallel hyperparameter tuning, TPE algorithm implementation, model selection search, distributed optimization python, hyperparameter search space, bayesian-optimization, hyperparameter-tuning, distributed-computing [View on SkillFed](https://skillfed.io/packages/hyperopt) · [View on PyPI](https://pypi.org/project/hyperopt/)