Genetic Algorithm Feature Selector — a scikit-learn-compatible wrapper feature selector for tabular data (evo-suite)
Project description
evo-gafs — Genetic Algorithm Feature Selector
A scikit-learn-compatible wrapper feature selector for tabular data, powered
by DEAP. evo-gafs searches for the subset of
features that maximises a cross-validated score of your model, and lets you
explicitly trade raw performance for a smaller feature set — useful for edge
deployment.
Part of the evo-suite family (import name: evo_gafs).
Why evo-gafs?
| Capability | evo-gafs |
|---|---|
Single-objective weighted fitness with a configurable alpha (performance ↔ compression) |
✓ |
| Multi-objective NSGA-II with an accessible Pareto front | ✓ |
| Repair operator guaranteeing a minimum number of features | ✓ |
| Evaluation cache to skip repeated genomes | ✓ |
Native scikit-learn fit/transform/get_support, usable in a Pipeline |
✓ |
Built-in multi-dataset BenchmarkRunner |
✓ |
Installation
pip install evo-gafs # core
pip install evo-gafs[viz] # + matplotlib for the plotting helpers
Quickstart
from sklearn.datasets import load_breast_cancer
from sklearn.tree import DecisionTreeClassifier
from evo_gafs import GAFeatureSelector, GAConfig
X, y = load_breast_cancer(return_X_y=True, as_frame=True)
selector = GAFeatureSelector(
estimator=DecisionTreeClassifier(random_state=42),
config=GAConfig(population_size=30, n_generations=20, alpha=0.8, verbose=False),
)
selector.fit(X, y)
print(selector.summary())
X_reduced = selector.transform(X)
print("Selected:", selector.get_support(indices=True))
Multi-objective (Pareto front)
config = GAConfig(mode="multiobjective", population_size=40, n_generations=30, verbose=False)
selector = GAFeatureSelector(estimator=DecisionTreeClassifier(random_state=42), config=config)
selector.fit(X, y)
for point in selector.result_.pareto_front:
print(point["n_features"], point["cv_score"])
In a scikit-learn pipeline
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
pipe = Pipeline([
("scaler", StandardScaler()),
("selector", GAFeatureSelector(estimator=DecisionTreeClassifier(), config=config)),
("clf", SVC()),
])
pipe.fit(X, y)
The alpha trade-off (single-objective)
fitness = alpha * cv_score + (1 - alpha) * compression
compression = 1 - n_selected / n_total
alpha = 1.0→ pure wrapper (performance only)alpha ≈ 0.7→ balanced, good default for edge deployment
Citation
@software{evo_gafs,
author = {Skrauba, Axel},
title = {evo-gafs: Genetic Algorithm Feature Selector for tabular data},
year = {2026},
version = {0.1.0},
url = {https://github.com/AxelSkrauba/evo-suite}
}
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file evo_gafs-0.1.0.tar.gz.
File metadata
- Download URL: evo_gafs-0.1.0.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dd1af5f6d832a163f0e7aa64234f98660ef1d6383d7f24848506f4e903f19f4
|
|
| MD5 |
4c20292ff57d70f87f725c0355d5acbb
|
|
| BLAKE2b-256 |
0543ff063662d2f9f5e3652b041b1caf6081dedda0830d77a9777deeef99aabd
|
Provenance
The following attestation bundles were made for evo_gafs-0.1.0.tar.gz:
Publisher:
publish.yml on AxelSkrauba/evo-suite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
evo_gafs-0.1.0.tar.gz -
Subject digest:
0dd1af5f6d832a163f0e7aa64234f98660ef1d6383d7f24848506f4e903f19f4 - Sigstore transparency entry: 1890569182
- Sigstore integration time:
-
Permalink:
AxelSkrauba/evo-suite@bf89a0ff3efde889923c431127cc435887288775 -
Branch / Tag:
refs/tags/evo-gafs-v0.1.0 - Owner: https://github.com/AxelSkrauba
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bf89a0ff3efde889923c431127cc435887288775 -
Trigger Event:
push
-
Statement type:
File details
Details for the file evo_gafs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: evo_gafs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68a56fb9a2e1bf924ae01187f05e5b826f918af61f967ec66b602080aea82d65
|
|
| MD5 |
81e71755a8a89b76618af98c65b9301a
|
|
| BLAKE2b-256 |
ef58cca906a1ecfd8b663fd432af35feb7e7383344dc811c01421fe4e2f9a7b9
|
Provenance
The following attestation bundles were made for evo_gafs-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on AxelSkrauba/evo-suite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
evo_gafs-0.1.0-py3-none-any.whl -
Subject digest:
68a56fb9a2e1bf924ae01187f05e5b826f918af61f967ec66b602080aea82d65 - Sigstore transparency entry: 1890569491
- Sigstore integration time:
-
Permalink:
AxelSkrauba/evo-suite@bf89a0ff3efde889923c431127cc435887288775 -
Branch / Tag:
refs/tags/evo-gafs-v0.1.0 - Owner: https://github.com/AxelSkrauba
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bf89a0ff3efde889923c431127cc435887288775 -
Trigger Event:
push
-
Statement type: