Skip to content

Conversation

@sharimk2
Copy link

No description provided.

Copy link
Collaborator

@jhnwu3 jhnwu3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).



class SDOHICD9LLM:
"""Admission-level SDOH ICD-9 V-code detector using an LLM."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add more doc strings on how a user might use this model here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added more doc strings, let me know what you think @jhnwu3

Copy link
Collaborator

@jhnwu3 jhnwu3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this your own dataset or did you use MIMIC-III? Or do you have to download it from somewhere?

return df


class MIMIC3NoteDataset:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants