Skip to content

Commit

Permalink
added examples of aggregation functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Oufattole committed Oct 23, 2024
1 parent 365ff38 commit 6f4b9a3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/terminology.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ Note that "Static" and "Dynamic" refer to whether a timestamp is recorded in the

Static aggregations are computed once per subject_id and static code. Dynamic aggregations are computed per subject_id, code, and lookback window, where the lookback window defines the time period before a reference time point over which measurements are aggregated. Note that the value-based aggregations (`value/*`) are only computed for the subset of dynamic code measurements that include numeric values, while `code/count` is computed for all dynamic codes regardless of whether they have numeric values.

We provide examples of these aggregations here. Notice that for dynamic aggregations, data within a lookback window (e.g., last 24 hours) is input to the aggregation function.

| Aggregation | Input Data | Result | Explanation |
|-------------|------------|--------|-------------|
| `static/present` | Gender//Female | 1 | Indicates the presence (1) of the code "Gender//Female" |
| `static/first` | Birth Weight: 3.2 kg | 3.2 | Returns the numeric value of the static measurement |
| `code/count` | Heart Rate: [80, NULL, 78, 90] | 4 | Counts the occurrences of codes within the lookback window |
| `value/count` | Heart Rate: [80, 78, 90] | 3 | Counts the number of measurements recorded within the lookback window |
| `value/sum` | Glucose Levels: [100, 110, 105] | 315 | Sums the measurement values within the lookback window |
| `value/sum_sqd` | Blood Pressure Readings: [120, 125] | 30,025 | Sums the squares of the measurements (120² + 125²) |
| `value/min` | Temperature Readings: [37.5, 38.0, 37.0] | 37.0 | Finds the minimum value within the lookback window |
| `value/max` | Respiratory Rate: [16, 18, 20] | 20 | Finds the maximum value within the lookback window |


## Lookback Window

We define a lookback window as a time period before a reference time point over which dynamic data is aggregated. By default, we use the lookback windows (defined in [this default hydra config](https://github.com/mmcdermott/MEDS_Tabular_AutoML/blob/main/src/MEDS_tabular_automl/configs/tabularization/default.yaml)):
Expand Down

0 comments on commit 6f4b9a3

Please sign in to comment.