Code for the paper: Multi-Label Clinical Time-Series Generation via Conditional GAN
- Go to https://mimic.physionet.org/ for access. Once you have the authority for the dataset, download the dataset and extract the csv files to {data_path}/mimic3/raw/ and {data_path}/mimic4/raw/.
- Check hyper-parameter settings:
python run_preprocess.py --help
- Run preprocess program:
- For MIMIC-III
python run_preprocess.py --dataset mimic3 --train_num 6000
- For MIMIC-IV
python run_preprocess.py --dataset mimic4 --train_num 6000 --sample_num 10000
Add --from_saved
if you run it again and want to load saved encoded data.
- Check hyper-parameter setting:
python run_train.py --help
- Run training program
- For MIMIC-III
python run_train.py --dataset mimic3
- For MIMIC-IV
python run_train.py --dataset mimic4
- The parameters are saved in default at
results/{dataset}/params/
. The training plots are saved atresults/{dataset}/records/
.
- Check hyper-parameter setting:
python run_generate.py --help
- Run generating program
- For MIMIC-III
python run_generate.py --dataset mimic3
- For MIMIC-IV
python run_generate.py --dataset mimic4
- The generated data are saved at
results/synthetic_{dataset}.npz
.
- Python >= 3.7
- Virtualenv (optional, recommended)
- CUDA (optional, recommended)
- RAM > 16GB
- matplotlib
- numpy
- openpyxl
- pandas
- scipy
- pytorch