Spaces:
Sleeping
Sleeping
File size: 1,336 Bytes
0fff343 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | """Genetic-programming engine for OncoDSL — strict airgap, name-blind.
The engine sees only opaque feature IDs (`^g\\d+$`) and a binary outcome y.
It composes a small DSL (Select / Reduce / Fit) and evolves populations of
programs with tournament selection, crossover, mutation, and elitism, using
k-fold cross-validated AUROC on a TRAIN split as fitness. The held-out
TEST split is touched once per program, only for the final winner and the
internal baseline.
Public entry points:
- `run_gp_pipeline(M, y, *, objective=None, ...)` — batch path. Returns
`(evolution_log, result)`, both safe to serialise (opaque IDs only).
- `run_gp_pipeline_streaming(M, y, *, on_generation, objective=None, ...)`
— same pipeline with a per-generation callback for the Lab's SSE
bridge. Returns `result` only.
- Objectives: `BinaryAUROCObjective` (MSI vs MSS), `CorrelationObjective`
(continuous + direction), `objective_from_spec({target, metric, direction})`.
"""
from engine.objectives import (
BinaryAUROCObjective,
CorrelationObjective,
Objective,
objective_from_spec,
)
from engine.pipeline import run_gp_pipeline, run_gp_pipeline_streaming
__all__ = [
"run_gp_pipeline",
"run_gp_pipeline_streaming",
"Objective",
"BinaryAUROCObjective",
"CorrelationObjective",
"objective_from_spec",
]
|