Spaces:
Sleeping
Sleeping
| """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", | |
| ] | |