Practical overview
When it fits
Use it when developing a scikit-learn workflow and considering evolutionary search for hyperparameter optimization or feature selection.
Who it is for
- Python developers using scikit-learn
- Practitioners exploring evolutionary approaches to model selection
Documented uses
- Optimize scikit-learn estimator hyperparameters.
- Run feature-selection experiments using evolutionary algorithms.
- Explore cross-validation-based model-selection workflows.
Requirements & limits
The project is available as a public GitHub repository under the MIT license.
- It targets Python and the scikit-learn ecosystem.
- Its stated approach uses evolutionary algorithms rather than only grid or randomized search.
- The available project description does not document installation or execution steps.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Tune scikit-learn hyperparameters with GASearchCV
Use evolutionary search and cross-validation to tune an MLPClassifier on the digits dataset, then evaluate it on a holdout set.
Before you start
- Python and pip
- scikit-learn and sklearn-genetic-opt installed (
pip install sklearn-genetic-opt) - Basic familiarity with scikit-learn’s fit and predict API
- The optional plotting extra (
pip install sklearn-genetic-opt[plot]) is only needed for the documented visualizations.
Steps
Load the digits dataset and split it into stratified training and test sets; configure a stratified three-fold cross-validation splitter.
Define the estimator’s search space using
Categorical,Continuous, andIntegervalues for its parameters.Configure
GASearchCVwith the estimator, cross-validation, accuracy scoring, search space, evolution and population settings, and runtime settings; fit it on the training data.Use the fitted search’s
predictmethod on the test set and calculate holdout accuracy. Optionally inspect its history and fit statistics or use the plotting functions with the plotting extra installed.
Expected outcome
A fitted search object provides the best cross-validation score and parameters and can predict on the holdout set. The guide’s digits example reports a holdout accuracy of 0.9579.
Guide limitations
- The example’s scores are results for its particular digits dataset, estimator, split, and settings; they do not guarantee results on other data.
- The guide recommends
PopulationConfig(initializer="smart")and notes that accuracy near 1.0 may call for a more discriminative metric such as ROC AUC or balanced accuracy. - Plotting requires the optional
[plot]extra.
Select features with GAFeatureSelectionCV
Use evolutionary feature selection with cross-validation on Iris data augmented with noise columns, then evaluate the fitted selector on a holdout set.
Before you start
- Python and pip
- scikit-learn and sklearn-genetic-opt installed (
pip install sklearn-genetic-opt) - Basic familiarity with scikit-learn’s fit and predict API
Steps
Load Iris data, create 10 noise columns, append them to the measurements, and split the combined data into stratified training and test sets.
Configure
GAFeatureSelectionCVwith anSVC, three-fold cross-validation, accuracy scoring, evolution and population settings, and runtime settings.Fit the selector on the training data; use its
support_boolean mask to identify selected features.Predict on the test set with the fitted selector and calculate holdout accuracy.
Expected outcome
The fitted selector exposes selected features through `support_` and can predict on the holdout set. The guide’s example selects 3 of 14 features and reports holdout accuracy of 0.9800.
Guide limitations
- The example’s selected features and accuracy are specific to its Iris data, added noise, split, estimator, and settings; they do not guarantee results on other data.
- The guide recommends
PopulationConfig(initializer="smart")and notes that accuracy near 1.0 may call for a more discriminative metric such as ROC AUC or balanced accuracy.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 7 October 2026
- Original website title
- rodrigo-arenas/Sklearn-genetic-opt · Official homepage title · retained in its source language

