ICD 9 V Code Prediction Task and Example#790
ICD 9 V Code Prediction Task and Example#790sharimk2 wants to merge 7 commits intosunlabuiuc:masterfrom
Conversation
jhnwu3
left a comment
There was a problem hiding this comment.
Hey Sharim! Thanks for the help! Can we implement some unit tests sorta like how paul does it here?
https://github.com/sunlabuiuc/PyHealth/blob/master/tests/core/test_sdoh.py
Basically, it helps to just test that the class itself works.
Other things would be adding to the docs/ (Cursor does a pretty good job here given some examples).
pyhealth/models/sdoh_icd9_llm.py
Outdated
|
|
||
|
|
||
| class SDOHICD9LLM: | ||
| """Admission-level SDOH ICD-9 V-code detector using an LLM.""" |
There was a problem hiding this comment.
Can we add more doc strings on how a user might use this model here?
There was a problem hiding this comment.
Please see some examples: https://github.com/sunlabuiuc/PyHealth/blob/master/pyhealth/models/stagenet.py
There was a problem hiding this comment.
I added more doc strings, let me know what you think @jhnwu3
300427b to
b351521
Compare
jhnwu3
left a comment
There was a problem hiding this comment.
Hey Sharim,
I would recommend checking out the pyhealth.datasets and pyhealth.tasks tutorials here: https://pyhealth.readthedocs.io/en/latest/tutorials.html to better understand how to extend PyHealth with your own dataset.
I think if you have separate labels in your dataset that's stored somewhere else on top of MIMIC3, then we'd probably need to create a new Dataset(BaseDataset) class here, but otherwise if its just a MIMIC3 showcase, I would recommend using the existing APIs here.
| def __init__( | ||
| self, | ||
| csv_path: str, | ||
| dataset_name: Optional[str] = None, |
There was a problem hiding this comment.
Is this your own dataset or did you use MIMIC-III? Or do you have to download it from somewhere?
| return df | ||
|
|
||
|
|
||
| class MIMIC3NoteDataset: |
There was a problem hiding this comment.
I believe MIMIC3Dataset already supports the loading of notes iirc, so this feels a bit redundant.
|
|
||
| class SDOHICD9AdmissionTask(BaseTask): | ||
| """Builds admission-level samples for SDOH ICD-9 V-code detection. | ||
|
|
There was a problem hiding this comment.
Can we get docstrings on how to use this task. For reference, the .set_task() feature here that you shouldn't overwrite unless you really need to in each of the BaseDataset classes require you pass a task through a dataset.set_task(TaskClass) here as it will get parallelized and used by our backend here.
No description provided.