rodrigo-arenas/Sklearn-genetic-opt
Hyperparameter optimization and feature selection for scikit-learn using evolutionary algorithms. A modern alternative to GridSearchCV and RandomizedSearchCV.
What it solves
It provides a smarter alternative to GridSearchCV and RandomizedSearchCV for scikit-learn models. It addresses the "combinatorial explosion" problem where searching through many hyperparameters becomes too slow, and it solves the issue of missing optimal parameter interactions (e.g., the joint relationship between learning rate and number of estimators) that one-parameter-at-a-time searches often overlook.
How it works
The toolkit uses genetic algorithms to evolve populations of parameter configurations. Instead of checking a fixed grid or random points, it evaluates complete configurations and uses adaptive schedules for crossover and mutation to shift from exploration to exploitation. It includes GASearchCV for hyperparameter tuning and GAFeatureSelectionCV for wrapper-based feature selection, both designed to be drop-in replacements for standard scikit-learn APIs.
Who it’s for
It is designed for ML practitioners who have expensive-to-train models, search spaces with five or more interacting hyperparameters (such as Gradient Boosting or SVMs), or those who need a reproducible workflow combining both feature selection and tuning.
Highlights
- Scikit-learn Compatible: Uses the same
fit/predictinterface asGridSearchCVfor easy integration. - Mixed Search Spaces: Supports Integer, Continuous (uniform or log-uniform), and Categorical types simultaneously.
- Smart Initialization: Uses Latin hypercube seeding and warm-start configurations to improve the initial population.
- Early Stopping: Includes callbacks like
ConsecutiveStoppingandTimerStoppingto end searches upon convergence or time limits. - Experiment Tracking: Built-in MLflow integration and visualization tools for fitness curves and parameter interactions.
Related
- Project
- Project
- Project
- Project
- Project