Configuration¶
All genetic-algorithm behaviour is controlled by GAConfig, a
dataclass passed to the selector. It validates its values on construction
(raising ValueError on invalid input).
from evo_gafs import GAConfig
config = GAConfig(
population_size=50,
n_generations=100,
alpha=0.8,
cv_folds=5,
random_seed=42,
)
Key parameters¶
Parameter |
Default |
Description |
|---|---|---|
|
|
Number of candidate masks per generation. Larger explores more, costs more. |
|
|
Number of evolutionary iterations. |
|
|
|
|
|
Performance vs compression weight in single-objective mode (see Concepts). |
|
|
Cross-validation folds used to score each subset. |
|
|
Minimum number of selected features (enforced by the repair operator). |
|
|
Probabilities of crossover and mutation. |
|
|
Tournament size for selection (single-objective). |
|
|
Best individuals carried over unchanged each generation. |
|
|
Stop if the best fitness stagnates for this many generations. |
|
|
Parallelism passed to scikit-learn’s cross-validation. |
|
|
Seed for reproducible runs. |
See the full list and defaults in the GAConfig API reference.
Choosing alpha¶
Goal |
Suggested |
|---|---|
Maximum accuracy, size irrelevant |
|
Balanced (general use) |
|
Edge/embedded, small models |
|
If you are unsure which trade-off you want, use multi-objective mode and inspect the Pareto front instead.