This repository contains an R script for the external validation of the DISCO machine learning model, which is designed to predict post-stroke outcomes, including recurrence, disability, and mortality. The following R packages are required to run the script: xgboost, Matrix, caret, readxl, and pROC.
git clone https://github.com/liusylab/Disco_model_external_validation.git
cd ./Disco_model_external_validation
You will see randomly generated data for 99 patients in the file(example_patient_data.xlsx), with 46 columns and 100 rows (including the header).

We have given the fields description of the data table in the file "patient_data_table_Field_description.xlsx"
Rscript ./external_validation.R example_patient_data.xlsx
If the script runs successfully, you will find a new file(DISCO_model_external_validation_result{time}.csv)in the directory.
You can directly copy the corresponding data into the Excel table(example_patient_data.xlsx),. Moreover, our script calculates the prediction results of 3 outcomes at 2 time points by default, so a total of 6 results (m3_stroke, y1_stroke, m3_death, y1_death, m3_mRS_36, y1_mRS_36) will be calculated. If your data lacks a column of result data, please fill it with 0 directly.
NOTE: All the contents filled in the patient_data_table must be in numerical form!!
Rscript ./external_validation.R your_filename.xlsx