End-to-end Google Cloud AlphaEvolve repository for evolving clinical risk classifiers in a zero-leakage sandboxed evaluation harness, featuring:
- Real-Data Tabular Track (
problems/diabetes130_readmit30): 30-day hospital readmission prediction on the public UCI Diabetes 130-US Hospitals (1999–2008) cohort (99,343encounters across~70,000patients;11.4%readmission rate), evaluated with patient-grouped splits, paired bootstrap confidence intervals against tuned GBDT and human-stacked baselines, and permutation leakage checks. - Two-Stage Synthetic Portfolio Harness (
readmission_30d,inpatient_admission,sepsis_90d,chf_30d): Pluggable multi-model harness and constrained care-management allocation simulator (Stage 1risk scoring +Stage 2budget/slot/contraindication optimization).
-
Dataset: UCI Diabetes 130-US Hospitals for Years 1999–2008 (Strack et al., 2014). After excluding expired and hospice discharge dispositions,
99,343inpatient encounters remain (11.4%readmitted within 30 days). -
Patient-Grouped Partitioning: Patients (
patient_nbr) are hashed (partition_salt) into disjoint 60% train / 20% selection / 20% locked test (n = 19,734) partitions so no patient ever crosses splits. -
Evolution Fitness (
split="all"):$\text{Fitness} = 10{,}000 \times \overline{\text{ROC-AUC}}$ across 3 rounds. Each round draws a fresh20,000-row training subsample and scores a disjoint~6,600-row selection shard controlled by privateAE_PERTURB_SEED. -
Strong Seed & Baselines (
scripts/tabular_report.py):- The seed program (
problems/diabetes130_readmit30/initial_program.py) is already a tuned LightGBM (hyper-parameters selected by 48-trial random search on the fitness rounds), so hyperparameter re-tuning alone cannot win. - Finalists are compared on the locked test set (
n = 19,734) using 1,000-resample paired bootstrap CIs against:-
Tuned LightGBM (
= seed, 48-trial random search) - Tuned XGBoost (48-trial random search)
- Human-Engineered Stack (Charlson ICD-9 comorbidities, ICD-9 chapter groupings, medication steady/up/down counts, total utilization, 5-fold out-of-fold target encoding on high-cardinality codes, and Tuned LightGBM + Tuned XGBoost stacked with a logistic meta-learner).
-
Tuned LightGBM (
- The seed program (
Finalist selection rule fixed in advance: rank1 by selection fitness from each independent AlphaEvolve run (artifacts/reports/diabetes130_readmit30_20261002_233459.json).
| Arm | Selection Fitness AUC | Locked-Test ROC-AUC (n = 19,734) |
|
|
PR-AUC | Brier |
|---|---|---|---|---|---|---|
Tuned LightGBM (= seed) |
0.6646 | 0.6808 | — |
|
0.2337 | 0.0968 |
| Tuned XGBoost | 0.6606 | 0.6730 |
|
|
0.2327 | 0.0969 |
| Human Stack | 0.6708 | 0.6835 |
|
— | 0.2389 | 0.0962 |
AlphaEvolve Replicate A rank1 |
0.6763 | 0.6903 | 0.2449 | 0.0957 | ||
AlphaEvolve Replicate B rank1 |
0.6745 | 0.6876 | 0.2414 | 0.2942* | ||
AlphaEvolve Replicate C rank1 |
0.6752 | 0.6900 | 0.2454 | 0.0957 |
*Replicate B uses rank-averaged ensembling (optimizing ranking/ROC-AUC without post-hoc probability calibration).
- Consistent Lift Across Replicates: All 3 replicate finalists beat both the tuned LightGBM (
mean Δ = +0.0084,SD = 0.0015) and the human-engineered stack (mean Δ = +0.0058,SD = 0.0015) with 95% paired bootstrap confidence intervals strictly above zero. - Label-Shuffle Leakage Check (
scripts/leakage_check.py): All finalists pass permutation testing on the fitness rounds (shuffled AUC = 0.489–0.495, null SE0.0037), confirming zero evaluation-label or row-order leakage.
src/
evaluator.py Sandboxed worker (python -P -s, sys.addaudithook, label-stripped eval pipe)
tabular_benchmarks.py Real-data CSV loader, patient-grouped hash splits, and multi-round sampler
clinical_toolkit.py Frozen candidate toolkit (TabularEncoder, icd9_group, icd9_comorbidities, oof_target_encode, RiskBlender, CareAllocationState)
clinical_metrics.py Exact Mann-Whitney U ROC-AUC, paired bootstrap CI, PR-AUC, Sens@Spec, Brier, Stage 2 ROI
clinical_benchmarks.py Synthetic multi-scenario clinical cohort generator
clinical_models.py Dataclasses (TabularTask, PatientRecord, CohortSpec, CareAllocationPlan)
data_adapters.py CSV/Kaggle & AWS Snowflake cohort adapters + baseline model adapter
problems/
diabetes130_readmit30/ Real-data UCI 30-day hospital readmission problem (TabularTask contract)
readmission_30d/ Synthetic two-stage harness problem (30-day readmission + care allocation)
inpatient_admission/ Synthetic two-stage harness problem (inpatient admission + bed capacity)
sepsis_90d/ Synthetic two-stage harness problem (sepsis trajectory + intervention triage)
chf_30d/ Synthetic two-stage harness problem (CHF 30-day readmission)
_template/ Template used by new_problem.py to scaffold additional problems
scripts/
fetch_diabetes130.sh Downloads & SHA-256 verifies UCI Diabetes 130-US Hospitals into data/diabetes130/
tabular_report.py Tunes LightGBM/XGBoost baselines, scores locked test, runs paired bootstrap CIs
leakage_check.py Refits finalists on permuted training labels to verify AUC collapses to ~0.50
run_narrator.py Post-run Gemini 3.8 Flash run commentary (analysis.json) & Gemini 3.5 Flash-Lite candidate summaries
provision_gcp.sh Local setup script (enables APIs, generates local .env seeds, provisions engine, fetches data)
artifacts/
reports/ Locked-test JSON evaluation reports with paired bootstrap CIs
runs/ Promoted AlphaEvolve runs with candidates.json, rank1.py, report.json, and Gemini 3.8 analysis.json
best_evolved_program.py Hand-written reference candidate for the synthetic two-stage harness track
simulator/ 3-step interactive workbench UI (Step 1 Setup -> Step 2 Gemini 3.8 Analysis & Diffs -> Step 3 ROI Simulator)
tests/ Behavioral and differential pytest suites
Downloads the public archive from UCI and verifies the pinned SHA-256 checksum into data/diabetes130/diabetic_data.csv:
bash scripts/fetch_diabetes130.sh.venv/bin/python -m pytest -q -p no:cacheproviderScore the diabetes130_readmit30 seed program in the sandbox on the 3 fitness rounds:
.venv/bin/python src/evaluator.py --program-dir problems/diabetes130_readmit30 --no-perturbRun the label-shuffle leakage check on any candidate or seed program:
.venv/bin/python scripts/leakage_check.py --problem diabetes130_readmit30 problems/diabetes130_readmit30/initial_program.pyTune the LightGBM + XGBoost baselines, evaluate the human stack, and score finalist candidates on the locked test set with 1,000-resample paired bootstrap CIs:
.venv/bin/python scripts/tabular_report.py --problem diabetes130_readmit30 --candidates artifacts/runs/diabetes130_readmit30/<exp_id>/rank1.pyEach completed run under artifacts/runs/<problem_id>/<run_id>/ is narrated automatically at the end of run_experiment.py (or on demand via scripts/run_narrator.py):
candidates.json[*].summary(gemini-3.5-flash-lite): 1–2 sentence plain-English summary of each candidate's code diff and evaluation outcome.analysis.json(gemini-3.8-flash): Structured post-run commentary (headline,what_changed,why_it_works,what_didnt_work,risks,next_steps) grounded in the unified diff, failure clusters, and multi-run history.
.venv/bin/python scripts/run_narrator.pyServes the 3-step executive walkthrough (Step 1: What You Provide, Step 2: Locked-Test Bootstrap Verdict, Gemini 3.8 Run Commentary, Trajectory & Code Diffs, Step 3: Interactive Care-Allocation & Portfolio ROI Simulator):
GOOGLE_API_USE_CLIENT_CERTIFICATE=false .venv/bin/python simulator/portfolio_simulator.py --serveAll candidate evaluation runs locally on your machine using your own gcloud user credentials:
# 1. Authenticate with gcloud and Application Default Credentials
gcloud auth login
gcloud auth application-default login
# 2. Enable APIs, generate local private evaluation seeds in .env, create the Gemini Enterprise engine, and fetch data
bash scripts/provision_gcp.sh <YOUR_GCP_PROJECT_ID>
# 3. Launch a live AlphaEvolve run on the real-data UCI problem
uv run python run_experiment.py --problem diabetes130_readmit30The four two-stage problems (readmission_30d, inpatient_admission, sepsis_90d, chf_30d) test combined fit_and_score_risk + allocate_interventions evolution under hard budget, slot capacity, acuity, and contraindication constraints.
Note on Synthetic vs. Real-Data Lift:
artifacts/best_evolved_program.pyis a hand-written reference candidate whose feature builder (ClinicalFeatureBuilder(include_interactions=True)) mirrors the synthetic cohort generator's latent interaction terms. Use the synthetic track to test two-stage constraint plumbing and care-allocation ROI simulation; useproblems/diabetes130_readmit30to measure genuine out-of-sample classification lift.
Evaluate the synthetic portfolio scorecard locally:
.venv/bin/python run_experiment.py --portfolio-reportScaffold a new two-stage problem directory:
.venv/bin/python new_problem.py oncology_30d --title "Oncology 30-Day Acute Toxicity Admission" --target-auc 0.75Licensed under the Apache License, Version 2.0.