Development version
You are reading the latest (dev) docs. For the stable version, see stable.
Release Notes
Unreleased
Bug Fixes and Error Messages
- Checkpoint resume dropped prior-run history (#299): resuming from a
ModelCheckpointresetlogbook/cv_results_/historyto only the newly-run generations and zeroedfit_stats_counters, because_register()unconditionally rebuiltself.logbookafter it was restored, and the checkpoint was saving the wrong (per-generation summary) logbook object under the restored key in the first place.ModelCheckpointnow also persists the real per-candidate logbook andfit_stats_, and the restore path re-applies them after_register(), so resumed runs accumulate history and counters instead of losing them.
0.13.3
New Features and Behavior
- Search-space conversion helper:
from_sklearn_spaceconverts commonRandomizedSearchCV-style spaces into nativeInteger,Continuous, andCategoricaldimensions. It supports list-like categorical choices plusscipy.stats.randint,uniform,loguniform, andreciprocalfrozen distributions. - Estimator presets: new starter spaces for
RandomForestClassifier,RandomForestRegressor,HistGradientBoostingClassifier,HistGradientBoostingRegressor,LogisticRegression,SVC,XGBClassifier, andXGBRegressor. Presets supportprofile="fast","balanced", or"wide"and aprefixargument for sklearn pipelines. - Benchmark cache toggle:
benchmarks/benchmark_fit.pynow exposes--use-cache/--no-use-cache, and threads the setting through bothGASearchCVandGAFeatureSelectionCVbenchmark builders. This makes it possible to measure the real impact of the fitness cache on repeated candidate evaluation. - Safer constructor validation:
error_scoreis now validated during estimator construction, so invalid values fail earlier with a clearer message. - More robust ranking utilities: internal score ranking now handles
NaNvalues consistently when ranking candidates.
Bug Fixes and Error Messages
- ModelCheckpoint cleanup: removed a duplicate
param_gridentry fromModelCheckpointestimator state and added regression coverage for the core checkpoint keys. - Clearer checkpoint output:
ModelCheckpointnow reports successful saves with the clearer messageCheckpoint saved to .... - Better plotting errors:
- candidate plots now validate invalid
top_kvalues before plotting - metric-column errors now list available metric names
plot_historyerrors now show available fields- plotting helpers now raise more actionable errors when called before fitting
- candidate plots now validate invalid
- Search-space validation improvements:
warm_start_configsvalidation now reports clearer errors- feature-name count mismatch errors include the expected and received counts
- preset
prefixnow validates its type - unsupported scipy distributions in
from_sklearn_spacenow suggest list orCategoricalalternatives
- Optional dependency errors: missing MLflow now raises a clearer error explaining how to install the optional extra.
- Adapter validation: scheduler adapter errors now include the received type.
- Type annotations: completed type annotations for the search-space parameter classes and fixed the
Categorical.random_stateannotation.
Documentation
- Clean canonical URLs: docs canonical and Open Graph URLs now use clean VitePress-style URLs instead of raw
.htmltargets. - Preset pipeline guidance: added a guide section showing how to use preset search spaces with sklearn
Pipelineobjects via the presetprefixargument. - Community articles:
- added a Community Articles page for external posts, videos, tutorials, and articles
- updated README and contributor-facing docs to point to the current community articles source file
- added the first community article entry comparing
GASearchCVandRandomizedSearchCV
- Contributor guidance: docs now remind contributors to check issue and PR status before starting work to avoid duplicated effort.
- Added Estimator Presets and expanded Search Space with conversion examples and rules.
- README improvements:
- added citation guidance
- added a gentle GitHub star prompt and stars badge
- updated community article contribution links
- Docs navigation cleanup: replaced the generic Links dropdown with direct navbar icons for GitHub, Star, Fork, Issues, Discussions, and PyPI; also removed the legacy Read the Docs link now that the RTD page is no longer available.
- TimerStopping example: callbacks docs now include a runnable
TimerStoppingexample. - Troubleshooting expansion: added error-reference and
parallel_backenddecision tables, plus refreshed staleparallel_backendexamples.
Tests and Maintenance
- Added direct tests for
_as_listand extra edge cases including NumPy arrays, sets, empty strings, and falsy scalar values. - Added
_candidate_labeltests covering hidden-parameter counts,label_params, truncation, and compact float formatting. - Added
Categorical.random_statedeterminism coverage and priors sampling validation. - Added an internal Markdown link checker for versioned docs pages.
- Added
CITATION.cfffor GitHub citation support.
0.13.2
Documentation release. No changes to the Python package.
New Documentation
New Guides
- How Hyperparameter Optimization Works — complete conceptual guide comparing grid search, random search, Bayesian optimization, and genetic algorithms with worked Python examples and a method-selection flowchart.
- Common Hyperparameter Tuning Mistakes — ten common pitfalls (data leakage, class imbalance, bad search spaces, missing seeds, premature stopping, and more) with diagnosis and fixes.
- Choosing the Right Search Space — when to use
Integer,Continuous,Categorical; when to use log-uniform; per-estimator recommended parameter ranges. - Feature Selection Methods Compared — side-by-side comparison of filter, embedded, and wrapper methods with guidance on which to use and when
GAFeatureSelectionCVis the right choice.
New Tutorials
- Random Forest Hyperparameter Tuning — 7-parameter joint search, which parameters matter most, classification and regression variants, baseline comparison.
- Gradient Boosting Hyperparameter Tuning —
HistGradientBoostingClassifiervs classicGradientBoostingClassifier,max_leaf_nodesvsmax_depth, speed comparison. - Logistic Regression Hyperparameter Tuning — solver/penalty compatibility table, multi-penalty search with SAGA, mandatory scaling in a Pipeline.
- SVM Hyperparameter Tuning (C, kernel, gamma) — C–gamma interaction visualization, mandatory
Pipeline+StandardScaler, RBF vs linear kernel, O(n²) scaling note.
New Comparisons Section
- Comparisons overview — new section hub for tool comparisons.
- Grid Search vs Random Search vs Bayesian vs Genetic Algorithms — honest equal-budget benchmark across all four methods with code and result tables.
- Optuna vs sklearn-genetic-opt — head-to-head on tabular benchmarks using the Bayesmark experimental design; honest about where each approach wins.
New Recipes Section
A new Recipes section provides 30 copy-paste ready solutions (5–10 min each) organized into seven categories:
- Classification (8 recipes) —
RandomForestClassifier,LogisticRegression,SVC,XGBClassifier,LGBMClassifier,CatBoostClassifier,HistGradientBoostingClassifier,ExtraTreesClassifier. - Regression (5 recipes) —
RandomForestRegressor,XGBRegressor,LGBMRegressor,CatBoostRegressor,ElasticNet. - Feature Selection (4 recipes) — high-dimensional datasets, two-stage select-then-tune, custom feature-count penalty scorer, leakage-free CV selection.
- Pipelines (4 recipes) — preprocessing + estimator pipeline,
ColumnTransformerwith mixed types, imputer strategy as a hyperparameter, polynomial features degree. - Scoring Metrics (5 recipes) — F1 (binary), ROC-AUC, balanced accuracy, MAE, RMSE.
- Integrations (3 recipes) — MLflow child-run logging, Joblib parallelism modes, Jupyter notebook setup.
- Advanced (5 recipes) — warm-start with known-good configs,
ConsecutiveStoppingsetup,TimerStoppingfor wall-clock budgets, checkpointing and resume, custom scoring functions.
Documentation Improvements
- SEO titles and descriptions — titles on 15+ existing pages rewritten to answer the search query directly (e.g. "LightGBM Hyperparameter Tuning with Genetic Algorithms" instead of "Tuning LightGBM").
- Cross-linking — "See Also" sections added to all tutorial and guide pages linking to related tutorials, recipes, and comparison pages.
- Difficulty and reading-time metadata — all tutorial pages now show difficulty level (Beginner / Intermediate / Advanced) and an estimated reading time.
- Tutorials index — updated with difficulty column, recommended reading order, and links to all new tutorials.
- Sidebar — Comparisons and Recipes sections added to the
latestsidebar as collapsible trees. The0.13stable sidebar is unchanged. - README — complete rewrite of
README.rstas a high-converting GitHub landing page with value proposition, when-to-use / when-not-to-use guidance, a six-tool comparison table, condensed Quick Start, visual demo section, common use cases, and learning paths. - Canonical URLs and Open Graph tags —
transformPageDatainconfig.tsnow injects<link rel="canonical">,og:title,og:description,og:url,og:image, andtwitter:*tags on every page.
0.13.1
New Features
random_stateparameter:GASearchCVandGAFeatureSelectionCVnow accept arandom_stateargument that seeds the entire search atfittime — population initialisation (including Latin hypercube sampling), mutation, crossover, and random immigrants. Runs are fully reproducible without manually seeding the globalrandom/numpyRNGs. Passrandom_state=None(default) to keep the previous non-deterministic behaviour.Expanded plotting API: eleven new functions in
sklearn_genetic.plots—plot_parameter_evolution,plot_search_decisions,plot_candidate_scores,plot_feature_selection,plot_convergence,plot_diversity,plot_optimizer_events,plot_score_landscape,plot_cv_scores,plot_candidate_rankings, andplot_search_overview. See the Plotting Gallery for examples.Benchmarks page: new Benchmarks section in the docs with Bayesmark-style comparisons of
GASearchCVagainst Optuna and random search on tabular regression/classification tasks and CASH (combined algorithm selection and hyperparameter optimisation) scenarios.
Bug Fixes
- Fixed Latin hypercube sampler reproducibility: the
smartinitialiser now seedsqmc.LatinHypercubefrom the global RNG so numeric-parameter searches are reproducible whenrandom_stateis set.
0.13.0
Breaking Changes
crossover_probabilitydefault changed from0.2→0.8;mutation_probabilitydefault changed from0.8→0.1for bothGASearchCVandGAFeatureSelectionCV.diversity_controlnow defaults toTrueanddiversity_thresholdnow defaults to0.25. Previouslydiversity_controldefaulted toFalseanddiversity_thresholddefaulted to0.1. Setdiversity_control=Falseto restore the previous behavior.The fitness function for
GASearchCVis now single-objective (CV score only). Previously anovelty_scorebased on Hamming distance was included as a second objective. This caused Pareto-dominance comparisons to favor diverse-but-lower-scoring candidates over better candidates, reducing search quality. Fitness sharing and diversity control already maintain population diversity without corrupting the primary fitness signal.GAFeatureSelectionCVretains its two-objective fitness (CV score + feature count) unchanged.
New Features
Parallel candidate evaluation: candidates within a generation are de-duplicated and unique candidates are evaluated in parallel via
n_jobs. Addedparallel_backend("auto","population","cv") to control the parallelism strategy.fit_stats_: new attribute with evaluation counters —evaluated_candidates,unique_candidates,cross_validate_calls,cache_hits,duplicate_candidates,skipped_invalid_candidates,random_immigrants,local_refinement_candidates.Optimizer telemetry in
history: new per-generation fields —genotype_diversity,unique_individual_ratio,fitness_best,stagnation_generations,diversity_control_triggered, and others.Smart initialization:
PopulationConfig(initializer="smart")uses Latin hypercube sampling for numeric parameters, estimator defaults, warm-start seeds, and stratified categorical values. Setinitializer="random"to use the previous behavior.Grouped config objects:
EvolutionConfig,PopulationConfig,RuntimeConfig, andOptimizationConfigprovide a cleaner API for advanced settings. The previous flat keyword parameters remain supported for backward compatibility.Local search:
OptimizationConfig(local_search=True)runs a short neighborhood search around hall-of-fame candidates after the genetic search.Fitness sharing:
OptimizationConfig(fitness_sharing=True)reduces the fitness of individuals in crowded niches to promote niche exploration.Adaptive tournament selection:
adaptive_selection=Trueadjusts selection pressure based on population diversity and stagnation.Final selection:
final_selection=Truere-evaluates the top-K candidates after the GA and selects the best before refitting.Uniform crossover:
GASearchCVnow usescxUniform(50% per-gene swap probability) instead of two-point crossover for mixed-type hyperparameter spaces.Compact verbose log: the generation log now shows
div,unique,stag, andeventscolumns.Expanded plots:
plot_fitness_evolutionsupports multiple metrics and smoothing;plot_historycan visualize arbitrary telemetry fields;plot_search_spaceadds pair-plot mode and correlation heatmap.
Bug Fixes
- Fixed fitted estimator persistence by excluding volatile DEAP runtime objects from the saved state.
- Fixed type preservation for hyperparameter candidates across all population operations.
- Fixed smart feature-selection initialization to respect
max_featuresand always select at least one feature. - Fixed convergence telemetry so local refinement updates the final generation history row.
0.12.0
- Added compatibility for outlier detection algorithms.
0.11.1
- Fixed
AttributeError: 'GASearchCV' object has no attribute 'creator'.
0.11.0
- Added
use_cacheparameter (defaultTrue) to skip re-evaluating already-seen configurations. - Added
warm_start_configstoGAFeatureSelectionCV. - Introduced novelty search strategy to
GASearchCV(later revised in 0.13.0).
0.10.0
GAFeatureSelectionCVnow mimics the scikit-learn FeatureSelection API.- Improved candidate generation when
max_featuresis set. - Dropped Python 3.7 support; added Python 3.10+ support.
0.9.0
- Introduced adaptive schedulers:
ConstantAdapter,ExponentialAdapter,InverseAdapter,PotentialAdapter. - Added
random_stateparameter toContinuous,Categorical, andInteger.
0.8.0
- Added
max_featurestoGAFeatureSelectionCV. - Added multi-metric evaluation support.
- Training now gracefully handles
KeyboardInterrupt,SystemExit,StopIteration.
0.7.0
- Added
GAFeatureSelectionCVfor wrapper-based feature selection.
0.6.0
- Added
ProgressBar,TensorBoard,TimerStoppingcallbacks. - Added
on_start/on_endlifecycle hooks toBaseCallback. - Seaborn and MLflow are now optional extras.
0.5.0
- Built-in MLflow integration via
MLflowConfig. - Added
LogbookSavercallback.
0.4.0
- Added
ConsecutiveStopping,ThresholdStopping,DeltaThresholdcallbacks. - Added
plot_search_spacefunction. - Sphinx documentation on Read the Docs.
0.1–0.3
- Initial release of
GASearchCV. - Added
param_grid,plot_fitness_evolution, DEAP integration. - Added
Space,Integer,Continuous,Categoricalclasses.
