-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation Changes #57
Changes from 13 commits
e56ff27
b7666b7
c9409bf
59e2332
765fffe
a009eaf
81907db
7509407
e4c80ec
2092759
bd96458
40c4ed0
2500db7
6f7a4d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
# Configuration Language Specification | ||
|
||
## Introduction and Terminology | ||
## Configuration Language Specification | ||
|
||
This document specifies the configuration language for the automatic extraction of task dataframes and cohorts | ||
from structured EHR data organized either via the [MEDS](https://github.com/Medical-Event-Data-Standard/meds) | ||
|
@@ -27,9 +25,7 @@ contain events that satisfy certain aggregation functions over predicates for th | |
|
||
______________________________________________________________________ | ||
|
||
## Machine Form (ACES) | ||
|
||
In the machine form, the configuration file consists of three parts: | ||
In the machine form used by ACES, the configuration file consists of three parts: | ||
|
||
- `predicates`, stored as a dictionary from string predicate names (which must be unique) to either | ||
`PlainPredicateConfig` objects, which store raw predicates with no dependencies on other predicates, or | ||
|
@@ -38,7 +34,9 @@ In the machine form, the configuration file consists of three parts: | |
- `windows`, stored as a dictionary from string window names (which must be unique) to `WindowConfig` | ||
objects. | ||
|
||
Next, we will detail each of these configuration objects. | ||
Below, we will detail each of these configuration objects. | ||
|
||
______________________________________________________________________ | ||
|
||
### Predicates: `PlainPredicateConfig` and `DerivedPredicateConfig` | ||
|
||
|
@@ -68,11 +66,13 @@ on its source format. | |
|
||
1. If the source data is in [MEDS](https://github.com/Medical-Event-Data-Standard/meds) format | ||
(recommended), then the `code` will be checked directly against MEDS' `code` field and the `value_min` | ||
and `value_max` constraints will be compared against MEDS' `numerical_value` field. **Note**: This syntax | ||
does not currently support defining predicates that also rely on matching other, optional fields in the | ||
MEDS syntax; if this is a desired feature for you, please let us know by filing a GitHub issue or pull | ||
request or upvoting any existing issue/PR that requests/implements this feature, and we will add support | ||
for this capability. | ||
and `value_max` constraints will be compared against MEDS' `numerical_value` field. | ||
|
||
**Note**: This syntax does not currently support defining predicates that also rely on matching other, | ||
optional fields in the MEDS syntax; if this is a desired feature for you, please let us know by filing a | ||
GitHub issue or pull request or upvoting any existing issue/PR that requests/implements this feature, | ||
and we will add support for this capability. | ||
|
||
2. If the source data is in [ESGPT](https://eventstreamml.readthedocs.io/en/latest/) format, then the | ||
`code` will be interpreted in the following manner: | ||
a. If the code contains a `"//"`, it will be interpreted as being a two element list joined by the | ||
|
@@ -95,7 +95,7 @@ accepted operations that can be applied to other predicates, containing precisel | |
- `and(pred_1_name, pred_2_name, ...)`: Asserts that all of the specified predicates must be true. | ||
- `or(pred_1_name, pred_2_name, ...)`: Asserts that any of the specified predicates must be true. | ||
|
||
Note that, currently, `and`'s and `or`'s cannot be nested. Upon user request, we may support further advanced | ||
**Note**: Currently, `and`'s and `or`'s cannot be nested. Upon user request, we may support further advanced | ||
analytic operations over predicates. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider future enhancements based on user feedback. Would you like me to open a GitHub issue to track requests for nested logical operations in predicates? |
||
|
||
______________________________________________________________________ | ||
|
@@ -138,17 +138,22 @@ following rules: | |
In this case, the referencing event (either the start or end of the window) will be defined as occurring | ||
exactly `$TIME_DELTA` either after or before the event being referenced (either the external event or the | ||
end or start of the window). | ||
Note that if `$REFERENCED` is the `start` field, then `$TIME_DELTA` must be positive, and if | ||
|
||
**Note**: If `$REFERENCED` is the `start` field, then `$TIME_DELTA` must be positive, and if | ||
`$REFERENCED` is the `end` field, then `$TIME_DELTA` must be negative to preserve the time ordering of | ||
the window fields. | ||
|
||
2. `$REFERENCING = $REFERENCED -> $PREDICATE`, `$REFERENCING = $REFERENCED <- $PREDICATE` | ||
In this case, the referencing event will be defined as the next or previous event satisfying the | ||
predicate, `$PREDICATE`. Note that if the `$REFERENCED` is the `start` field, then the "next predicate | ||
predicate, `$PREDICATE`. | ||
|
||
**Note**: If the `$REFERENCED` is the `start` field, then the "next predicate | ||
ordering" (`$REFERENCED -> $PREDICATE`) must be used, and if the `$REFERENCED` is the `end` field, then the | ||
"previous predicate ordering" (`$REFERENCED <- $PREDICATE`) must be used to preserve the time ordering of | ||
the window fields. Note that these forms can lead to windows being defined as single pointe vents, if the | ||
the window fields. These forms can lead to windows being defined as single point events, if the | ||
`$REFERENCED` event itself satisfies `$PREDICATE` and the appropriate constraints are satisfied and | ||
inclusive values are set. | ||
|
||
3. `$REFERENCING = $REFERENCED` | ||
In this case, the referencing event will be defined as the same event as the referenced event. | ||
|
||
|
@@ -175,8 +180,9 @@ the `start` event itself. | |
The constraints field is a dictionary that maps predicate names to tuples of the form `(min_valid, max_valid)` | ||
that define the valid range the count of observations of the named predicate that must be found in a window | ||
for it to be considered valid. Either `min_valid` or `max_valid` constraints can be `None`, in which case | ||
those endpoints are left unconstrained. Likewise, unreferenced predicates are also left unconstrained. Note | ||
that as predicate counts are always integral, this specification does not need an additional | ||
those endpoints are left unconstrained. Likewise, unreferenced predicates are also left unconstrained. | ||
|
||
**Note**: As predicate counts are always integral, this specification does not need an additional | ||
inclusive/exclusive endpoint field, as one can simply increment the bound by one in the appropriate direction | ||
to achieve the result. Instead, this bound is always interpreted to be inclusive, so a window would satisfy | ||
the constraint for predicate `name` with constraint `name: (1, 2)` if the count of observations of predicate | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -11,14 +11,13 @@ ACES is a library designed for the automatic extraction of cohorts from event-st | |||||
glob: | ||||||
maxdepth: 2 | ||||||
--- | ||||||
GitHub README <readme> | ||||||
README <readme> | ||||||
Usage Guide <usage> | ||||||
Task Examples <notebooks/examples> | ||||||
Sample Data Tutorial <notebooks/tutorial> | ||||||
Predicates DataFrame <notebooks/predicates> | ||||||
Configuration Language <configuration> | ||||||
Algorithm & Terminology <terminology> | ||||||
Profiling <profiling> | ||||||
Sample Data Tutorial <notebooks/tutorial> | ||||||
Technical Details <technical> | ||||||
Computational Profile <profiling> | ||||||
Module API Reference <api/modules> | ||||||
License <license> | ||||||
``` | ||||||
|
@@ -29,29 +28,29 @@ ______________________________________________________________________ | |||||
|
||||||
If you have a dataset and want to leverage it for machine learning tasks, the ACES ecosystem offers a streamlined and user-friendly approach. Here's how you can easily transform, prepare, and utilize your dataset with MEDS and ACES for efficient and effective machine learning: | ||||||
|
||||||
### 1. Transform to MEDS | ||||||
### I. Transform to MEDS | ||||||
|
||||||
- Simplicity: Converting your dataset to the Medical Event Data Standard (MEDS) is straightforward and user-friendly compared to other Common Data Models (CDMs). | ||||||
- Minimal Bias: This conversion process ensures that your data remains as close to its raw form as possible, minimizing the introduction of biases. | ||||||
- [MEDS-ETL](https://github.com/Medical-Event-Data-Standard/meds_etl): Follow this link for detailed instructions and ETLs to transform your dataset into the MEDS format! | ||||||
|
||||||
### 2. Identify Predicates | ||||||
### II. Identify Predicates | ||||||
|
||||||
- Task-Specific Concepts: Identify the predicates (data concepts) required for your specific machine learning tasks. | ||||||
- Pre-Defined Criteria: Utilize our pre-defined criteria across various tasks and clinical areas to expedite this process. | ||||||
- [PIE-MD](https://github.com/mmcdermott/PIE_MD/tree/main/tasks/criteria): Access our repository of tasks to find relevant predicates! | ||||||
|
||||||
### 3. Set Dataset-Agnostic Criteria | ||||||
### III. Set Dataset-Agnostic Criteria | ||||||
|
||||||
- Standardization: Combine the identified predicates with standardized, dataset-agnostic criteria files. | ||||||
- Examples: Refer to the [MIMIC-IV](https://github.com/mmcdermott/PIE_MD/tree/main/tasks/MIMIC-IV) and [eICU](https://github.com/mmcdermott/PIE_MD/tree/main/tasks/eICU) examples for guidance on how to structure your criteria files for your private datasets! | ||||||
|
||||||
### 4. Run ACES | ||||||
### IV. Run ACES | ||||||
|
||||||
- Run the ACES Command-Line Interface tool (`aces-cli`) to extract cohorts based on your task - check out the [Usage Guide](https://eventstreamaces.readthedocs.io/en/latest/usage.html)! | ||||||
|
||||||
### 5. Run MEDS-Tab | ||||||
### V. Run MEDS-Tab | ||||||
|
||||||
- Painless Reproducibility: Use [MEDS-Tab](https://github.com/mmcdermott/MEDS_TAB_MIMIC_IV/tree/main/tasks) to obtain comparable, reproducible, and well-tuned XGBoost results tailored to your dataset-specific feature space! | ||||||
|
||||||
By following these steps, you can seamlessly transform your dataset, define necessary criteria, and leverage powerful machine learning tools within the ACES ecosystem. This approach not only simplifies the process but also ensures high-quality, reproducible results for your machine learning for health projects. It can reliably take no more than a week of full-time human effort to perform steps 1-5 on new datasets in reasonable raw formulations! | ||||||
By following these steps, you can seamlessly transform your dataset, define necessary criteria, and leverage powerful machine learning tools within the ACES ecosystem. This approach not only simplifies the process but also ensures high-quality, reproducible results for your machine learning for health projects. It can reliably take no more than a week of full-time human effort to perform Steps I-V on new datasets in reasonable raw formulations! | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider simplifying the sentence for better readability. - This approach not only simplifies the process but also ensures high-quality, reproducible results for your machine learning for health projects. It can reliably take no more than a week of full-time human effort to perform Steps I-V on new datasets in reasonable raw formulations!
+ This approach simplifies the process and ensures high-quality, reproducible results. Typically, Steps I-V can be completed within a week of full-time effort on new datasets. Committable suggestion
Suggested change
ToolsLanguageTool
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,3 @@ | |
language: text | ||
--- | ||
``` | ||
|
||
______________________________________________________________________ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing the commented-out
preamble
settings if they are no longer needed to clean up the configuration file.