Repository with datasets and models from our paper: "Towards actionable hypotension prediction: Predicting catecholamine therapy initiation in the intensive care unit".
We demonstrate the feasibility of predicting catecholamine therapy initiation using MAP measurements and additional clinical variables with robust overall model performance.
-
Clone this repository
git clone https://github.com/AI4HealthUOL/actionable-hypotension.git cd actionable-hypotension -
Install dependencies
pip
pip install -r requirements.txt
Conda (managed environment) → alternative, don’t install both
conda env create -f environment.yml conda activate actionable-hypotension
-
Install project modules (editable / dev mode)
pip install -e . -
Set up MIMIC-III in Postgres
Follow the official [MIT-LCP buildmimic/postgres instructions](https:/ github.com/MIT-LCP/mimic-code/tree/main/mimic-iii/buildmimic/postgres).These instructions also cover how to download the MIMIC-III CSVs from PhysioNet and load them into Postgres.
-
Configure database connection
Copy the env template.env.example→.envand set exactly oneDATABASE_URI(no quotes):cp .env.example .env
Example:
DATABASE_URI=postgresql+psycopg2://USERNAME:PASSWORD@HOST:PORT/DBNAME
- To try pre-trained models → run 1 and 3.
- To retrain models → run 1, 2, 3.
Run the SQL files in order:
-
patient_metadata
all_mv_icu_stays.sqlchartevents_metadata.sqlmv_metadata_binned.sqlmv_drug_item_map.sql
-
context_windows
linkorder_treatment_events.sqlall_mv_context_target_windows.sqlall_mv_labeled_windows.sqladditional_meds_in_windows.sql
-
map_values
all_mv_labeled_windows_with_map_values.sqlinvasive_noninvasive_mix_windows.sql<datasetname>_statistical_features.sql
-
split_data
split_all_subjects.sql
-
merge_final_datasets
dataset_inv_ninv_mix.sql
-
XGBoost:
- Train:
training/train_xgboost_models.ipynb - Calibrate:
calibration/calibrate_xgboost_models.ipynb(set model name in marked cell)
- Train:
-
Baseline:
- Train & Calibrate:
baseline_model/train_and_calibrate_baseline_model.ipynb
- Train & Calibrate:
In each script you need to set the model name in the marked cell.
-
Performance plots:
ce_approach/evaluation/evaluate_models.ipynb -
DeepROC:
- Precompute:
ce_approach/evaluation/deeproc_cli.py(⚠ long runtime) - Plot:
ce_approach/evaluation/deeproc_plot.ipynb
- Precompute:
-
Metric tables:
ce_approach/evaluation/calculate_tables.ipynb -
Subgroup analysis:
- Precompute:
subanalysis/notebooks/create_test_full.ipynb - Create Table:
subanalysis/notebooks/subgroup_analysis.ipynb
- Precompute:
