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
sklearn-genetic-opt provides an evolutionary alternative to standard scikit-learn search tools like GridSearchCV and RandomizedSearchCV. It addresses the problem of finding optimal hyperparameters and feature subsets in large, mixed search spaces where parameters may interact, making exhaustive grid searches impractical and random searches inefficient.
How it works
The toolkit uses genetic algorithms to optimize scikit-learn models. It evaluates complete parameter configurations (individuals) and uses the most promising candidates to guide the evolution of subsequent generations through recombination and mutation.
Key mechanisms include:
- GASearchCV: A scikit-learn compatible search tool for hyperparameter tuning.
- GAFeatureSelectionCV: A wrapper-based selector that evaluates feature subsets using cross-validation.
- Adaptive Search: Crossover and mutation rates adjust over generations to shift from exploration to exploitation.
- Smart Initialization: Uses Latin hypercube seeding and estimator defaults to diversify the initial population.
Who it’s for
Machine learning practitioners who need a reproducible workflow for joint feature selection and hyperparameter tuning, particularly when dealing with mixed parameter types (integer, continuous, categorical) and suspected parameter interactions.
Highlights
- Scikit-learn API: Fully compatible with
fit,predict, andbest_params_. - Mixed Search Spaces: Supports Integer, Continuous, and Categorical types simultaneously.
- Early Stopping: Includes callbacks like
ConsecutiveStoppingandTimerStoppingto end searches automatically. - Experiment Tracking: Built-in integration with MLflow for logging candidates as child runs.
- Visualization: Provides built-in plots for fitness evolution, parameter interactions, and search overview dashboards.
- Parallel Execution: Supports parallel evaluation of candidates or folds via
n_jobs.
Related
- Project
- Project
- Project
- Project
- Project