How mahith28/icu-mortality-real-time works
This repository contains an ICU mortality prediction research pipeline: MIMIC table preparation, temporal and feature construction, separate XGBoost and LSTM modeling, and calibrated ensemble evaluation. The excerpts show subject-level train/validation/test splitting, model-specific threshold selection, prediction alignment, and final ensemble evaluation. Some preprocessing and model stages are represented by their source paths and filenames, but their internals were not sampled; with no README, links between those stages are left out where the excerpts do not establish them.
Main entry points: 05_Data_preparation.py Subject-level splits · 04_lstm_training.py Train LSTM · 01_prediction_geration.py Generate aligned predictions · 02_extract_vital_signals.py Extract vital signals
Components 19
Data preparation
- Load MIMIC tables
Preprocessing/01_load_mimic_tables.py - Extract vital signals
Preprocessing/02_extract_vital_signals.py - Join clinical tables
Preprocessing/03_join_tables.py - Five-minute windows
Preprocessing/04_5min_window.py - Subject-level splits
Preprocessing/05_Data_preparation.py
XGBoost model
- Feature generation
xgb_clean/00_clean_feature_generation.py - Train XGBoost
xgb_clean/03_xgboost.py - Tune XGBoost threshold
xgb_clean/04_Threshold_optimization.py - Evaluate XGBoost
xgb_clean/05_Test_evaluation.py - Decode feature vectors
xgb_clean/feature_decode.py
LSTM model
- Build sequences
lstm_clean/01_sequence_data_adaptive.py - Train LSTM
lstm_clean/04_lstm_training.py - Tune LSTM threshold
lstm_clean/05_threshold_optimization.py - LSTM explanations
lstm_clean/07_SHAP.py
Ensemble evaluation
- Generate aligned predictions
ensemble/01_prediction_geration.py - Calibrate probabilities
ensemble/03_calibration.py - Tune ensemble weights
ensemble/04_ensemble_tuning.py - Select operating threshold
ensemble/06_ensemble_threshold.py - Evaluate ensemble
ensemble/08_ensemble_test_evaluation.py
Connections 18
- Load MIMIC tables → Extract vital signals
- Extract vital signals → Join clinical tables
- Join clinical tables → Five-minute windows
- Five-minute windows → Subject-level splits: reads windows
Preprocessing/05_Data_preparation.py - Subject-level splits → Feature generation
- Feature generation → Train XGBoost
- Train XGBoost → Tune XGBoost threshold: loads model
xgb_clean/04_Threshold_optimization.py - Tune XGBoost threshold → Evaluate XGBoost: loads threshold
xgb_clean/05_Test_evaluation.py - Evaluate XGBoost → Decode feature vectors: calls decoder
xgb_clean/05_Test_evaluation.py - Subject-level splits → Build sequences
- Build sequences → Train LSTM
- Train LSTM → Tune LSTM threshold
- Train LSTM → LSTM explanations
- Generate aligned predictions → Calibrate probabilities
- Calibrate probabilities → Tune ensemble weights
- Tune ensemble weights → Select operating threshold
- Select operating threshold → Evaluate ensemble: loads locked settings
ensemble/08_ensemble_test_evaluation.py - Generate aligned predictions → Evaluate ensemble