You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with the MIMIC 3 dataset using your library, and there is a bug in the order of visits per patient that not only affects the logic when trying to create custom task functions but also creates a bug in your readmission task function (https://github.com/sunlabuiuc/PyHealth/blob/master/pyhealth/tasks/readmission_prediction.py) and maybe in other tasks too.
If you want some visual proof, we can discuss it further via email or something; I did not want to upload here MIMIC 3 information since it is sensitive.
The text was updated successfully, but these errors were encountered:
I'm working with the MIMIC 3 dataset using your library, and there is a bug in the order of visits per patient that not only affects the logic when trying to create custom task functions but also creates a bug in your readmission task function (https://github.com/sunlabuiuc/PyHealth/blob/master/pyhealth/tasks/readmission_prediction.py) and maybe in other tasks too.
The issue is under https://github.com/sunlabuiuc/PyHealth/blob/master/pyhealth/datasets/mimic3 (mimic3.py file) in the basic_unit(p_id, p_info) function (line 105):
In the line 114 the groupby ruins the order of the visits by their date:
for v_id, v_info in p_info.groupby("HADM_ID"):
I fixed it by adding 2 lines of code: (marked in bold)
def basic_unit(p_id, p_info):
p_info = p_info.sort_values(by="ADMITTIME")
If you want some visual proof, we can discuss it further via email or something; I did not want to upload here MIMIC 3 information since it is sensitive.
The text was updated successfully, but these errors were encountered: