Examples

Practical examples showing how to use Gradient-Free-Optimizers for various optimization tasks. All examples are complete and ready to run.


Getting Started

Simple Function Optimization

Start here: Minimize a simple 2D function to learn the basics of GFO. Covers search space definition, running optimization, and accessing results.

Simple Optimization
ML Hyperparameter Tuning

Tune scikit-learn model hyperparameters using Bayesian Optimization. Shows how to define search spaces for real ML models and interpret cross-validation scores.

Hyperparameter Tuning

Advanced Features

Constrained Optimization

Define parameter constraints to restrict the search space. Perfect for problems with physical constraints or valid parameter combinations.

Constrained Optimization
Boundary Strategies

Compare how optimizers repair candidates that leave the search-space bounds during local or population-based moves.

Boundary Strategies
Comparing Algorithms

Benchmark different optimizers on the same problem to find the best algorithm for your use case. Includes visualization of results.

Comparing Optimizers
Memory and Warm Starts

Cache expensive evaluations and continue optimization from previous runs. Essential for long-running optimizations.

Memory and Warm Starts

By Use Case

Use Random Search for fast exploration or Hill Climbing for smooth functions.

See the ML example for optimizing scikit-learn models with Bayesian Optimization.

Learn how to handle constraints in this example.

Use the warm start example to cache results and avoid redundant evaluations.