--- id: cmaes version: "0.13.0" license: MIT license_treatment: permissive maintenance: active --- # cmaes — Lightweight Covariance Matrix Adaptation Evolution Strategy (CMA-ES) implementation for Python 3. License: permissive · Maintenance: active · Downloads: 1.3M/mo ## What it is and what it does cmaes is a Python implementation of the Covariance Matrix Adaptation Evolution Strategy, a derivative-free optimization algorithm designed to minimize or maximize black-box objective functions. It uses an ask-and-tell interface where you request candidate solutions from the optimizer, evaluate them with your objective function, and report results back—making it suitable for expensive or noisy function evaluations where gradients are unavailable or unreliable. The library supports multiple problem types: standard continuous optimization via the CMA class, mixed continuous-integer-categorical optimization via CatCMAwM, and multi-objective mixed-variable problems via COMOCatCMAwM. It depends only on numpy and integrates with Optuna for hyperparameter tuning workflows. The implementation is actively maintained and supports Python 3.9 through 3.14. Use it for: - Hyperparameter tuning for machine learning models when gradient-based methods are impractical or unavailable. - Optimizing expensive simulations or physical experiments where function evaluations are costly and noisy. - Mixed-variable optimization combining continuous parameters, discrete choices, and categorical selections in a single problem. - Multi-objective optimization balancing competing objectives in mixed-variable spaces. - Black-box function optimization where the objective function is a complex pipeline or external tool. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides CMA-ES (Covariance Matrix Adaptation Evolution Strategy) optimization in an ask-and-tell interface, supporting continuous, integer, and categorical variable optimization with variants for mixed-variable and multi-objective problems. Yes. Low install friction (numpy only), active maintenance, MIT license, no known vulnerabilities, and a focused implementation of a well-established algorithm make it a solid choice for derivative-free optimization. Install if you need CMA-ES specifically; if you're unsure whether CMA-ES is the right algorithm for your problem, verify that first. ## Install pip install cmaes uv add cmaes poetry add cmaes ## Installing cmaes Before you install: Low friction: pure Python wheel with only numpy as a runtime dependency. Active maintenance with recent releases; last commit 2026-08-07 and 515 repository stars indicate ongoing development. License in practice: MIT license permits commercial and private use with minimal restrictions, making it suitable for most projects without legal friction. Quickstart: pip install cmaes import numpy as np from cmaes import CMA optimizer = CMA(mean=np.zeros(2), sigma=1.3) for generation in range(50): solutions = [] for _ in range(optimizer.population_size): x = optimizer.ask() value = objective(x) # your function solutions.append((x, value)) optimizer.tell(solutions) Requires Python 3.9 or later. Verify before relying: - Performance characteristics and convergence speed compared to other CMA-ES implementations or optimization libraries. - Whether the library is suitable for high-dimensional problems (scalability limits not documented in excerpt). - Integration requirements and compatibility with Optuna beyond the basic sampler example shown. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags CMA-ES optimization library, evolutionary strategy optimizer, mixed-variable optimization, black-box function optimization, hyperparameter optimization, continuous and categorical optimization, derivative-free optimization, optimization, evolutionary-algorithms, hyperparameter-tuning [View on SkillFed](https://skillfed.io/packages/cmaes) · [View on PyPI](https://pypi.org/project/cmaes/)