-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sequential_drug_recommendation #55
Comments
Thanks for the question.
We want to use {
"patient_id": xxx,
"visit_id": xxx,
"sequential_conditions": [diagnoses-visit-1, diagnosis-visit-2, ..., diagnosis-visit-N],
"sequential_procedures": [procedure-visit-1, procedure-visit-2, ..., procedure-visit-N],
"sequential_drugs": [drug-visit-1, drug-visit-2, ..., drug-visit-(N-1)],
"label": [drug-visit-N],
} Some explanations for the task:
sequential_conditions.append(conditions)
sequential_procedures.append(drugs)
sequential_drugs.append([])
if len(drugs) == 0:
sequential_drugs[-1] = drugs
continue
sequential_drugs[-1] = drugs
|
Thank you very much.
…________________________________
From: Chaoqi Yang ***@***.***>
Sent: Thursday, 29 December 2022 03:54
To: sunlabuiuc/PyHealth ***@***.***>
Cc: Dr. LIU Jundong ***@***.***>; Author ***@***.***>
Subject: [Ext] Re: [sunlabuiuc/PyHealth] sequential_drug_recommendation (Issue #55)
This email originated from outside of City University of Hong Kong. Do not reply, click links, or open attachments unless you confirm the identity of the sender and know that the content is safe.
Thanks for the question. sequential_drug_recommendation works as an example to show how to define a healthcare task in pyhealth. By definition:
Sequential drug recommendation aims at predicting the drug set of the current visit given the history of diagnosis and procedure information as well as past drug information.
We want to use the diagnosis and procedures of visit-1 up to visit-N and the drug information from visit-1 up to visit-(N-1) to predict the drug in visit-N. A sample in this task looks like this:
{
"patient_id": xxx,
"visit_id": xxx,
"sequential_conditions": [diagnoses-visit-1, diagnosis-visit-2, ..., diagnosis-visit-N],
"sequential_procedures": [procedure-visit-1, procedure-visit-2, ..., procedure-visit-N],
"sequential_drugs": [drug-visit-1, drug-visit-2, ..., drug-visit-(N-1)],
"label": [drug-visit-N],
}
Some explanations for the task:
1. The current drugs are what we want to predict, so they cannot be included in the feature lists. Thus, we use
sequential_conditions.append(conditions)
sequential_procedures.append(drugs)
sequential_drugs.append([])
1. If the current drugs (i.e., predicted targets are empty, we ignore this visit).
if len(drugs) == 0:
sequential_drugs[-1] = drugs
continue
1. After we obtain the sample for the current visit, we will have to add the drugs back for the next visit. Thus we have the following line in the end.
sequential_drugs[-1] = drugs
1. For the question "It seems 'sequential_drugs' is always empty." Because many patients only have one visit.
—
Reply to this email directly, view it on GitHub<#55 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMPCDZM4Y7HCMRSQUA5P7FDWPSLGPANCNFSM6AAAAAATLJHX4M>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Thank you. I still have a question about the following codes. May I know why 'drug' is in 'sequential_procedures.append(drugs)' instead of ' procedures'? """ The current drugs are what we want to predict, so they cannot be included in the feature lists. Thus, we use |
Good findings. This is a typo, just corrected. |
Dear sir/Madam,
In 'Advanced Case 2: Work on customized healthcare task' , I have questions about 'sequential_drugs' and 'drugs' (see following codes). It seems 'sequential_drugs' is always empty. What ' sequential_drugs[-1] = drugs' is used for at the final row?
def sequential_drug_recommendation(patient):
samples = []
The text was updated successfully, but these errors were encountered: