Conversation
EricSchrock
requested changes
Feb 9, 2026
examples/drug_recommendation/drug_recommendation_eicu_transformer.py
Outdated
Show resolved
Hide resolved
|
|
||
| # Exclude visits without condition, procedure, or drug code | ||
| # Exclude stays without condition, procedure, or drug code | ||
| if len(conditions) * len(procedures) * len(drugs) == 0: |
Collaborator
There was a problem hiding this comment.
Splitting this if statement up could short circuit a lot of computation (here and in other tasks). Any sense of whether that difference will be large enough to notice when processing large datasets?
conditions = ...
if len(conditions) == 0:
continue
procedures = ...
if len(procecures) == 0:
continue
drugs = ...
if len(drugs) == 0:
continue
Collaborator
Author
There was a problem hiding this comment.
ahh, that's a good question, I don't know. Mostly, because I know Python does a lot of underlying optimizations that we don't necessarily think about.
Collaborator
There was a problem hiding this comment.
I filed #843 to follow up on this question later.
…hout requiring changes to dataset paths
…the same hospital admission
EricSchrock
approved these changes
Feb 12, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request modernizes and standardizes the example scripts for running clinical prediction tasks on the eICU dataset, introduces a YAML configuration for eICU, and updates task imports for easier use of new task classes. The most significant updates are the migration of all eICU example scripts to use the new BaseDataset-based
eICUDatasetand corresponding BaseTask classes, the addition of a detailed YAML configuration for eICU, and improvements to code clarity and maintainability throughout the examples.Major improvements to eICU examples:
Migrated
drug_recommendation_eicu_transformer.py,length_of_stay_eicu_rnn.py,mortality_prediction_eicu_rnn.py, andreadmission_eicu_rnn.pyto use the neweICUDatasetclass (with YAML config), and the new BaseTask classes (DrugRecommendationEICU,LengthOfStayPredictioneICU,MortalityPredictionEICU,ReadmissionPredictionEICU). These examples now follow a standardized PyHealth workflow, improve feature selection, and include clearer documentation and configuration. [1] [2] [3] [4]Added
pyhealth/datasets/configs/eicu.yaml, providing a comprehensive YAML configuration for the eICU dataset, defining tables, joins, and attributes for streamlined data loading and processing.Task import and API improvements:
pyhealth/tasks/__init__.pyto expose the new eICU BaseTask classes (DrugRecommendationEICU,ReadmissionPredictionEICU) for direct import and usage in examples and user code. [1] [2]Minor improvements and consistency changes:
These changes collectively make the eICU example workflows more robust, maintainable, and aligned with the latest PyHealth APIs.