Skip to content

feat: integrate expert composite into pipeline ranking - #118

Merged
cschanhniem merged 1 commit into
mainfrom
feat/triage-score-benchmark
Jul 1, 2026
Merged

cschanhniem merged 1 commit into
mainfrom
feat/triage-score-benchmark

Conversation

@cschanhniem

Copy link
Copy Markdown
Collaborator

The expert composite scorer was benchmarked but never connected to the pipeline. The triage benchmark showed the ensemble has an anti-selective bias (sel_vs_hem AUROC=0.466). This PR integrates the expert composite as an optional ranking mode.

Changes:

  • score_candidates() computes expert_composite and hemolysis_risk for every candidate
  • rank_candidates() accepts ranking_mode=expert (default remains ensemble)
  • CLI: openamp-foundry rank --ranking-mode expert
  • Batch report records ranking_mode

Verification:

  • Expert-ranked top-5 have lower mean hemolysis_risk than ensemble top-5
  • 1502 tests pass, 1 skipped
  • Ruff clean

Honest limitation: hemolysis components are not statistically significant on expanded n=179 benchmark (AUROC=0.565, CI 0.47-0.66). Wet-lab hemolysis assay remains mandatory.

…de expert

The expert composite scorer (scoring/expert.py) was benchmarked but never
connected to the actual pipeline. The triage benchmark (v0.5.12) showed the
ensemble has an anti-selective bias (sel_vs_hem AUROC=0.466, below random).
This integration makes the expert composite available as an optional ranking
mode that partially corrects this bias.

Changes:
- score_candidates() now computes expert_composite and hemolysis_risk for
  every candidate, stored alongside ensemble in the scores dict
- rank_candidates() accepts ranking_mode='expert' to sort by expert composite
  (default remains 'ensemble')
- run_ranking_pipeline() accepts ranking_mode, recorded in batch report JSON
- CLI: openamp-foundry rank --ranking-mode expert flag added
- selection/pareto.py: select_top() also accepts ranking_mode

Verification:
- Expert-ranked top-5 have lower mean hemolysis_risk than ensemble-ranked
  top-5 on mixed benchmark (test_expert_top_5_have_lower_hemolysis_risk)
- Expert ranking produces different order than ensemble (not identical)
- Default ranking unchanged (backward compatible)
- Batch report records ranking_mode field
- 1502 tests pass, 1 skipped (pre-existing)
- Ruff clean on all modified files

Honest limitation: The expert composite's hemolysis components are not
statistically significant on the expanded n=179 benchmark (AUROC=0.565,
CI 0.47-0.66). Expert ranking is a safety-aware alternative, not a
validated safety guarantee. Wet-lab hemolysis assay remains mandatory.
@cschanhniem
cschanhniem merged commit c3f0a46 into main Jul 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant