Sklearn-genetic-opt
Hyperparameter optimization and feature selection for scikit-learn using evolutionary algorithms. A modern alternative to GridSearchCV and RandomizedSearchCV.
What is Sklearn-genetic-opt?
Hyperparameter optimization and feature selection for scikit-learn using evolutionary algorithms. A modern alternative to GridSearchCV and RandomizedSearchCV.
Overview of Sklearn-genetic-opt
What it is
Sklearn-genetic-opt is a scikit-learn-compatible optimization toolkit that provides hyperparameter tuning and feature selection for scikit-learn models using genetic algorithms. It is described as a modern alternative to GridSearchCV and RandomizedSearchCV. The project is open source under the MIT license.
Key features
- Familiar scikit-learn API — GASearchCV supports fit / predict / best_params_ and works with sklearn estimators and scoring.
- Adaptive search — genetic operators recombine complete configurations using feedback from earlier evaluations.
- Joint feature selection and tuning — run GAFeatureSelectionCV and GASearchCV in a two-stage workflow; no separate feature-selection library needed.
- Mixed search spaces — Integer, Continuous (uniform or log-uniform), and Categorical types in the same search.
- Smart initialization — Latin hypercube seeding, estimator defaults, warm-start configs, and duplicate avoidance diversify the first generation.
- Early stopping callbacks — ConsecutiveStopping, DeltaThreshold, and TimerStopping end the search automatically when it converges or runs out of time.
- Adaptive schedules — crossover and mutation rates anneal over generations, shifting from exploration to exploitation.
- Optimization history and plots — per-generation fitness, diversity, and telemetry stored in history; built-in plots visualize the full search.
- MLflow integration — optionally log evaluated candidates as child runs for experiment comparison.
- Parallel execution — n_jobs=-1 parallelizes candidate or fold evaluation.
Use cases
- You can budget several generations of cross-validated evaluations.
- Your search space contains mixed parameter types or suspected interactions.
- You want feature selection and hyperparameter tuning in a reproducible workflow.
- You want optimization history, convergence plots, callbacks, or MLflow tracking built in.
- You have known-good configurations to warm-start from (prior runs, published defaults).
- You want an adaptive search to compare with a fixed-budget random-search baseline.
Getting started
bash pip install sklearn-genetic-opt # With optional plotting, MLflow, and TensorBoard extras: # pip install sklearn-genetic-opt[all] For usage examples, see the repository README.
License and pricing
The project is open source under the MIT license. Pricing is not stated; the project is categorized as open source.
Based on the project's public README and repository metadata.