oncodsl / Read docs /PROMPT_gp_top10_groups.md
govindbalki's picture
Upload folder using huggingface_hub
0fff343 verified
|
Raw
History Blame Contribute Delete
5.26 kB
# Prompt β€” expand "The GP's group" to the GP's top 10 programs
Right now the Result panel's "The GP's group" block shows only the #1 winner (its genes' individual ranks + confound survival). Expand it to the **GP's top 10 programs, ranked by the engine's own fitness** β€” each with the same treatment. Verified against the code. Presentation + frontend data-flow only; no engine/API/airgap change. `tsc` after.
## What "top 10" means here (keep it distinct from Coordinated modules)
Rank by the **GP's own fitness** (what the search actually preferred) β€” NOT by the combined-AUROC re-score. This is deliberately different from the Coordinated modules leaderboard (which re-scores all explored groups by a different metric). Label it so the two don't blur: e.g. heading "The GP's top programs" with a one-line note "ranked by the engine's own fitness β€” what the search preferred. (The Coordinated modules panel below re-scores all explored groups by a different metric.)"
## Data sources (verified)
- The GP's programs + fitness live in the persisted population: `GET /runs/{id}/population/{generation}` returns `candidates` each with `fitness`, `gene_ids`, `program_repr` (engine_v2/gp.py builds these). `GET /runs/{id}` exposes `generations_persisted`.
- Per-gene single-gene ranks come from the full-rank diagnostic (`getFullRankDiagnostic(dataset, target)` β†’ `diag.ranks`) β€” already fetched in the Result panel after the consolidation change.
- Confound survival comes from the module ranking (`getModuleRanking(runId)`) β€” match a program to its module by **unordered gene-set equality** (the same notion `ModuleRankingPanel.isWinnerSet` uses).
## Build the top-10 list (web/app/Lab.tsx, ResultPanel)
1. Fetch the **last persisted generation's** population (`generations_persisted - 1`). Sort its `candidates` by `fitness` descending, dedupe by gene-set (unordered), take the top 10 distinct programs. (#1 should be the winner β€” keep it visually highlighted as today.)
2. Render each of the 10 as a compact row reusing the existing "GP's group" treatment:
- **Genes, each on its own:** for each gene id, look it up in `diag.ranks` β†’ `SYMBOL #rank / N` (reveal symbols via the existing bounded reveal; reveal only these displayed programs' genes β€” never the whole map).
- **Confound survival:** find the program's module in the module data by gene-set equality → render `SurvivalChips` (the pre→post `full → subgroup` chips). Omit gracefully where survival isn't available.
- Show the program's GP fitness (and gene count) so the ordering is legible.
3. Keep it compact (10 rows); the winner (#1) stays highlighted. Bounded reveal: only the genes of these ≀10 programs.
## Part β€” rewrite the Coordinated modules caption + "?" in plain language
The current copy is dense and circular. Rewrite both, in plain English, to clearly say what this panel is and how it differs from "The GP's top programs" above.
- Inline subtitle (web/app/Lab.tsx ~line 3861): replace with:
> "Not the engine's picks. After the run, this re-scores **every** gene group the engine tried β€” using one simple number (the group's average expression, measured on held-out patients) instead of how the engine judged groups during the search. So this list can rank groups differently from *The GP's top programs* above, and its #1 can even beat the engine's winner."
- The "?" tooltip `TIPS.moduleRanking` (~line 217): replace with plain copy covering three things:
> "What this is: after the run finishes, we take every group of genes the engine explored, ignore how the engine combined them, and give each group one score β€” the average of its genes, on patients held out of training.
> How it differs from 'The GP's top programs' above: that panel is the engine's actual choices, ranked the way the engine judged them during the search. This panel is a separate, after-the-fact re-scoring with a simpler yardstick β€” so the order differs, and a group here scoring higher than the engine's winner does NOT mean the engine was wrong.
> Caveat: this tries ~2,900 groups on the same small held-out set and shows the best, so the very top scores are optimistically biased (the luckiest of thousands) β€” trust the engine's own picks above as the reliable choice."
- Check the related line ~200 (the single-gene/highlighted tip that references the modules leaderboard) and make sure its wording is consistent with the above.
## CONSTRAINTS
- Presentation + frontend data-flow only; no engine/API/airgap change. Reveal stays bounded to the displayed programs' genes.
- Do not re-introduce group/individual mixing: each program's *group* identity is the row; the per-gene `#rank` values are clearly that program's *individual* genes' solo ranks β€” labelled as such, exactly like the current single-program block.
## Checkpoint
- "The GP's group" becomes "The GP's top programs" showing 10 rows ranked by GP fitness, #1 = winner (highlighted).
- Each row shows its genes' individual single-gene ranks + its confound-survival chips.
- A one-line note distinguishes this (GP fitness) from the Coordinated modules leaderboard (combined-AUROC re-score).
- Reveal bounded to the ≀10 displayed programs; `tsc` clean; no API/airgap change.