-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from mmcdermott/dev
Dev
- Loading branch information
Showing
16 changed files
with
424 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Task Criteria Files | ||
|
||
This folder contains the task configuration files used to test MEDS-TAB on various tasks over MIMIC-IV. | ||
|
||
Each directory in this structure should contain a `README.md` file that describes that sub-collection of | ||
tasks. | ||
|
||
All task criteria files are [ACES](https://github.com/justin13601/ACES) task-configuration `yaml` files. | ||
Currently, all tasks should be interpreted as _binary classification_ tasks, where the output label (indicated | ||
in the configuration file) should be interpreted as a `False` or `0` label if the ACES derived task dataframe | ||
has a `label` column with a value of `0`, and a `True` or `1` label if the ACES derived task dataframe has a | ||
label column with any value greater than `0`. | ||
|
||
Task criteria files should each contain a free-text `description` key describing the task. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
description: >- | ||
This file specifies the base configuration for the prediction of a hospital los being greater than 3days, | ||
leveraging only the first 48 hours of data after admission, with a 24 hour gap between the input window | ||
and the target window. Patients who die or are discharged in the gap window are excluded. Note that this | ||
task is in-**hospital** los, not in-**ICU** los which is a different task. | ||
predicates: | ||
hospital_admission: | ||
code: { regex: "HOSPITAL_ADMISSION//.*" } | ||
hospital_discharge: | ||
code: { regex: "HOSPITAL_DISCHARGE//.*" } | ||
death: | ||
code: MEDS_DEATH | ||
discharge_or_death: | ||
expr: or(hospital_discharge, death) | ||
|
||
trigger: hospital_admission | ||
|
||
windows: | ||
input: | ||
start: NULL | ||
end: trigger + 48h | ||
start_inclusive: True | ||
end_inclusive: True | ||
index_timestamp: end | ||
gap: | ||
start: input.end | ||
end: start + 24h | ||
start_inclusive: False | ||
end_inclusive: True | ||
has: | ||
hospital_admission: (None, 0) | ||
discharge_or_death: (None, 0) | ||
target: | ||
start: trigger | ||
end: start + 3d | ||
start_inclusive: False | ||
end_inclusive: True | ||
label: discharge_or_death |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
description: >- | ||
This file specifies the base configuration for the prediction of a icu los being greater than 3days, | ||
leveraging only the first 48 hours of data after admission, with a 24 hour gap between the input window | ||
and the target window. Patients who die or are discharged in the gap window are excluded. Note that this | ||
task is in-**ICU** los, not in-**HOSPITAL** los which is a different task. | ||
predicates: | ||
icu_admission: | ||
code: { regex: "ICU_ADMISSION//.*" } | ||
icu_discharge: | ||
code: { regex: "ICU_DISCHARGE//.*" } | ||
death: | ||
code: MEDS_DEATH | ||
discharge_or_death: | ||
expr: or(icu_discharge, death) | ||
|
||
trigger: icu_admission | ||
|
||
windows: | ||
input: | ||
start: NULL | ||
end: trigger + 48h | ||
start_inclusive: True | ||
end_inclusive: True | ||
index_timestamp: end | ||
gap: | ||
start: input.end | ||
end: start + 24h | ||
start_inclusive: False | ||
end_inclusive: True | ||
has: | ||
icu_admission: (None, 0) | ||
discharge_or_death: (None, 0) | ||
target: | ||
start: trigger | ||
end: start + 3d | ||
start_inclusive: False | ||
end_inclusive: True | ||
label: discharge_or_death |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Mortality Prediction | ||
|
||
This folder contains tasks for predicting mortality in patients in a variety of clinical contexts. Mortality | ||
is a common prediciton target because | ||
|
||
1. The "death" label is unambiguous, clearly important, and (often) easy to collect. | ||
2. Mortality is a common outcome in clinical research, and many studies have collected data that can be used | ||
to predict mortality. | ||
3. Mortality prediction within specific time-frames can be used as a proxy for the need for greater clinical | ||
attention on select patients, and mortality has accordingly been used as a training proxy for the | ||
development of clinical risk scores in various settings. We do not advocate this use of mortality in all | ||
contexts, but it is a common use-case for mortality prediction tasks. | ||
|
||
We break down mortality a variety of categories, all of which are contained in the sub-folders of this task | ||
collection, and described therein. | ||
|
||
Missing: | ||
|
||
1. Mortality for patients with specific diseases: | ||
\- \[ \] Sepsis: | ||
- https://translational-medicine.biomedcentral.com/articles/10.1186/s12967-020-02620-5 | ||
|
||
Some common references for the prediction of mortality in various settings include: TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# In-hospital Mortality Prediction | ||
|
||
Like in-ICU mortality prediction, this can be used as a signal of a patient's overall level of wellness or a | ||
proxy signal for the patient's need to be transferred to higher monitoring or care levels. It is often a good | ||
idea to separate this from post-discharge mortality prediction due to the vastly different intervention | ||
surfaces that could be applied in either an inpatient or outpatient setting as well as the differing likely | ||
clinical causes of risk of mortality in those settings. |
43 changes: 43 additions & 0 deletions
43
MIMICIV_TUTORIAL/tasks/mortality/in_hospital/first_24h.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
description: >- | ||
This file specifies the base configuration for the prediction of in hospital mortality, leveraging only the | ||
first 24 hours of data after admission, with a 24 hour gap between the input window and the target window. | ||
Patients who die or are discharged in the gap window are excluded. Note that this task is in-**hospital** | ||
mortality, not in-**ICU** mortality or **30-day** mortality, which are different tasks. | ||
Note that this task is predicting the outcome for a patient's entire hospital stay, not just the first 48 | ||
hours or the subsequent 48 hours after the trigger event. Imminent mortality (on various time-scales) are | ||
different tasks. | ||
predicates: | ||
hospital_admission: | ||
code: { regex: "HOSPITAL_ADMISSION//.*" } | ||
hospital_discharge: | ||
code: { regex: "HOSPITAL_DISCHARGE//.*" } | ||
death: | ||
code: MEDS_DEATH | ||
discharge_or_death: | ||
expr: or(hospital_discharge, death) | ||
|
||
trigger: hospital_admission | ||
|
||
windows: | ||
input: | ||
start: NULL | ||
end: trigger + 24h | ||
start_inclusive: True | ||
end_inclusive: True | ||
index_timestamp: end | ||
gap: | ||
start: input.end | ||
end: start + 24h | ||
start_inclusive: False | ||
end_inclusive: True | ||
has: | ||
hospital_admission: (None, 0) | ||
hospital_discharge: (None, 0) | ||
death: (None, 0) | ||
target: | ||
start: gap.end | ||
end: start -> discharge_or_death | ||
start_inclusive: False | ||
end_inclusive: True | ||
label: death |
43 changes: 43 additions & 0 deletions
43
MIMICIV_TUTORIAL/tasks/mortality/in_hospital/first_48h.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
description: >- | ||
This file specifies the base configuration for the prediction of in hospital mortality, leveraging only the | ||
first 48 hours of data after admission, with a 24 hour gap between the input window and the target window. | ||
Patients who die or are discharged in the gap window are excluded. Note that this task is in-**hospital** | ||
mortality, not in-**ICU** mortality or **30-day** mortality, which are different tasks. | ||
Note that this task is predicting the outcome for a patient's entire hospital stay, not just the first 48 | ||
hours or the subsequent 48 hours after the trigger event. Imminent mortality (on various time-scales) are | ||
different tasks. | ||
predicates: | ||
hospital_admission: | ||
code: { regex: "HOSPITAL_ADMISSION//.*" } | ||
hospital_discharge: | ||
code: { regex: "HOSPITAL_DISCHARGE//.*" } | ||
death: | ||
code: MEDS_DEATH | ||
discharge_or_death: | ||
expr: or(hospital_discharge, death) | ||
|
||
trigger: hospital_admission | ||
|
||
windows: | ||
input: | ||
start: NULL | ||
end: trigger + 48h | ||
start_inclusive: True | ||
end_inclusive: True | ||
index_timestamp: end | ||
gap: | ||
start: input.end | ||
end: start + 24h | ||
start_inclusive: False | ||
end_inclusive: True | ||
has: | ||
hospital_admission: (None, 0) | ||
hospital_discharge: (None, 0) | ||
death: (None, 0) | ||
target: | ||
start: gap.end | ||
end: start -> discharge_or_death | ||
start_inclusive: False | ||
end_inclusive: True | ||
label: death |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# In-ICU Mortality Prediction | ||
|
||
In-ICU mortality prediction can be used as a proxy signal for the patient's overall level of wellness and thus | ||
effective monitoring needs. Likely due to the availability of this target, rather than the true possible | ||
intervention surface offered by this task, it has been a widely used prediction target in the ML for | ||
healthcare literature to date. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# metadata: | ||
# name: 24h ICU Mortality | ||
# version: ... | ||
# author: ... | ||
# tags: | ||
# - mortality_prediction | ||
# - critical_care | ||
# - post_admission_prediction | ||
# description: ... | ||
|
||
description: >- | ||
This file specifies the base configuration for the prediction of in ICU mortality, leveraging only the first | ||
24 hours of data after ICU admission, with a 24 hour gap between the input window and the target window. | ||
Patients who die or are discharged from the ICU in the gap window are excluded. Patients who die in the same | ||
hospital stay but in a subsequent ICU stay are **not** positive labels for this task. | ||
Note that this task is in-**ICU** mortality, not in-**hospital** mortality or **30-day** mortality, which | ||
are different tasks. | ||
Note that this task is predicting the outcome for a patient's entire ICU admission, not just the first 24 | ||
hours or the subsequent 24 hours after the trigger event. Imminent mortality (on various time-scales) are | ||
different tasks. | ||
predicates: | ||
hospital_admission: | ||
code: { regex: "^HOSPITAL_ADMISSION//.*" } | ||
hospital_discharge: | ||
code: { regex: "^HOSPITAL_DISCHARGE//.*" } | ||
|
||
ED_registration: | ||
code: { regex: "^ED_REGISTRATION//.*" } | ||
ED_discharge: | ||
code: { regex: "^ED_OUT//.*" } | ||
|
||
icu_admission: | ||
code: { regex: "^ICU_ADMISSION//.*" } | ||
icu_discharge: | ||
code: { regex: "^ICU_DISCHARGE//.*" } | ||
|
||
death: | ||
code: MEDS_DEATH | ||
discharge_or_death: | ||
expr: or(icu_discharge, death, hospital_discharge) | ||
|
||
trigger: icu_admission | ||
|
||
windows: | ||
input: | ||
start: null | ||
end: trigger + 24h | ||
start_inclusive: True | ||
end_inclusive: True | ||
index_timestamp: end | ||
gap: | ||
start: trigger | ||
end: start + 48h | ||
start_inclusive: False | ||
end_inclusive: True | ||
has: | ||
icu_admission: (None, 0) | ||
discharge_or_death: (None, 0) | ||
target: | ||
start: gap.end | ||
end: start -> discharge_or_death | ||
start_inclusive: False | ||
end_inclusive: True | ||
label: death |
24 changes: 24 additions & 0 deletions
24
MIMICIV_TUTORIAL/tasks/mortality/post_hospital_discharge/1y.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
predicates: | ||
hospital_discharge: | ||
code: { regex: "HOSPITAL_DISCHARGE//.*" } | ||
|
||
death: | ||
code: MEDS_DEATH | ||
|
||
trigger: hospital_discharge | ||
|
||
windows: | ||
input: | ||
start: NULL | ||
end: trigger | ||
start_inclusive: True | ||
end_inclusive: True | ||
index_timestamp: end | ||
has: | ||
death: (None, 0) # They must be alive at the time of hospital discharge | ||
target: | ||
start: trigger | ||
end: start + 365d | ||
start_inclusive: False | ||
end_inclusive: True | ||
label: death |
Oops, something went wrong.