Skip to content

fix: use configured label names in survival crossval output - #183

Open
chenyangsu wants to merge 1 commit into
KatherLab:mainfrom
chenyangsu:fix/survival-crossval-label-names
Open

chenyangsu wants to merge 1 commit into
KatherLab:mainfrom
chenyangsu:fix/survival-crossval-label-names

Conversation

@chenyangsu

Copy link
Copy Markdown

Running survival cross-validation with custom time_label="OS_MONTHS" and status_label="OS_EVENT" writes columns ['PATIENT', 'pred_score', 'time', 'event', ...] to split-*/patient-preds.csv, so passing those CSVs to compute_stats_ raises a KeyError on OS_MONTHS. PR #170 (for #169) added time_label and status_label arguments to _to_survival_prediction_df and passed them in deploy.py, while crossval.py still calls _to_survival_prediction_df with the default names.

Pass time_label=config.time_label or "time" and status_label=config.status_label or "event" in crossval.py, and add a regression test running survival cross-validation into compute_stats_. Happy to fold the test into tests/test_crossval.py if you prefer.

Testing: pytest tests/test_crossval_survival_labels.py tests/test_statistics.py tests/test_model.py (19 passed); ruff check and ruff format --check --target-version=py313 pass.

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