Interpretable machine-learning risk stratification at diagnosis for 3-year mortality in de novo metastatic prostate cancer (SEER): reproducibility code
Xin Wang, Guanglei Yao, Wei Ding
This archive contains the analysis code, the predictor dictionary, and the retrained primary model objects underlying the manuscript "Interpretable machine-learning risk stratification at the time of diagnosis for 3-year mortality in de novo metastatic prostate cancer: development and temporal validation in SEER" (submitted to Frontiers in Oncology). Using the SEER Research Data (17 registries, 2010–2020), the study develops and temporally validates interpretable machine-learning models that predict fixed 3-year cancer-specific and overall mortality at the time of diagnosis in de novo metastatic prostate cancer. Seven algorithms are benchmarked on an identical diagnostic-time feature space; a CatBoost model is selected as primary, interpreted with full validation-set SHAP, and reported under TRIPOD+AI with calibration and decision-curve analysis reported alongside discrimination. Contents:- 00_full_pipeline_python/ — the Python pipeline (cohort construction and endpoints; seven-algorithm development and temporal validation; SHAP interpretation; risk stratification; treatment-association and robustness analyses; decision-curve table), the retrained primary CatBoost model objects with their reproducibility snapshots, and run_all.py.- 01_R_scripts/ — figure and Table 1 generation.- 03_T9_survival_run/ — Cox, Fine-Gray, and random-survival-forest survival sensitivity analyses (R).- predictor_dictionary/ — variable mapping and the one-hot feature list.- README_manifest.md, requirements.txt, CITATION.cff, and the MIT LICENSE. Environment: Python (numpy, pandas, scikit-learn, CatBoost, XGBoost, LightGBM, SHAP, matplotlib) and R 4.4.1, with a fixed random seed. The individual-level SEER data are not redistributable under the SEER data-use agreement and are not bundled; they are obtained from the U.S. National Cancer Institute (https://seer.cancer.gov/data/), and the documented SEER*Stat case selection reproduces the cohort. This version adds an internal-external cross-validation of the primary model: s13b_temporal_iecv.py performs a temporal leave-one-calendar-year-out cross-validation with a prospective rolling-origin complement and a random-effects meta-analysis across diagnosis years (with s13b_forest_plot.py for the forest-plot figure), and s13_geographic_iecv.py provides the corresponding leave-one-registry-out (geographic) cross-validation, runnable if registry-level SEER data become available. Released under the MIT License.