The following instructions assume that this folder is the current working directory in your Python session.
An renv lock file was created to install all necessary package dependencies. To recreate the environment, start a Terminal and run:
python setup_env.py
In order to access the full datasets through R, you need to download them and make them available to ricu. Please follow the instructions given by the ricu package: ?ricu::import_src. Currently, Python code to perform this step is in development and will be uploaded soon.
For quick experimentation, ricu comes with two demo datasets: mimic.demo and eicu.demo. These are small, openly available subsets of mimic and eicu that allow for easy prototyping. They should have been installed by renv. If they aren't, please see the respective Github pages here and here.
Once you have imported the datasets, make sure to set the right data path in .Rprofile file in this directory:
Sys.setenv(RICU_DATA_PATH = "/path/to/your/ricu/data/folder")
This repository currently allows for the extraction of five prediction tasks:
Classification:
- ICU mortality after 24 hours: mortality.py
- Acute Kidney Injury within the next 6 hours: aki.py
- Sepsis within the next 6 hours: sepsis.py
Regression:
- Kidney function on the second day of ICU admission: kidney_function.py
- Remaining length of stay: los.py
Data for a single task like mortality from a single dataset can be extracted via:
python mortality.py --src mimic_demowhere mortality.py should be replaced with the task file of interest and mimic_demo with the database of interest (one of mimic_demo, eicu_demo, aumc, hirid, eicu, mimic, miiv).
The output directory for the extracted data can be set in ../config.yaml