Comments (4)
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:
- 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([])
- If the current drugs (i.e., predicted targets are empty, we ignore this visit).
if len(drugs) == 0:
sequential_drugs[-1] = drugs
continue
- 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
- For the question "It seems 'sequential_drugs' is always empty." Because many patients only have one visit.
from pyhealth.
from pyhealth.
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'?
"""
Some explanations for the task:
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([])
"""
from pyhealth.
Good findings. This is a typo, just corrected.
from pyhealth.
Related Issues (20)
- pyhealth.calib.calibration.
- KeyError: 'logit' HOT 3
- How to use any of model for mimic-iii code prediction? HOT 1
- Entering deadlock when parsing prescriptions HOT 9
- Hello, the question about repositorie "Pandarallel" HOT 3
- Add contributor list (tmp2) HOT 6
- Add contributor list (tmp3)
- Bug in GAMNET HOT 1
- Cannot download 'https://storage.googleapis.com/pyhealth/resource/NDC_to_ATC.csv' HOT 5
- question about MIMIC-III in drug recommendation task HOT 4
- The results obtained with pyhealth are much lower than in the paper. HOT 6
- The results of SafeDrug model differ significantly from those in the paper. HOT 4
- Performance of SafeDrug and Molerec HOT 4
- a question about metrics HOT 1
- wrong code in pyhealth\metrics\drug_recommendation.py HOT 1
- pip install version HOT 1
- Does the inner map cotains all the icd code id? HOT 5
- question about eicu in drug recommendation task HOT 5
- a question about ddi rate HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyhealth.