Coder Social home page Coder Social logo

aimedlab / pave Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 26 KB

Code and Datasets for the paper "An Interpretable Risk Prediction Model for Healthcare with Pattern Attention", published on BMC Medical Informatics and Decision Making.

Home Page: https://bmcmedinformdecismak.biomedcentral.com/articles/10.1186/s12911-020-01331-7

Python 100.00%
interpretable-deep-learning pattern-attention value-embedding electronic-health-record sepsis mortality-prediction

pave's Introduction

Pattern Attention Model with Value Embedding (PAVE)

This repository contains the official PyTorch implementation of the following paper:

** An Interpretable Risk Prediction Model forHealthcare with Pattern Attention **
Sundreen Asad Kamal, Changchang Yin, Buyue Qian and Ping Zhang

Abstract: Background: The availability of massive amount of data enables the possibility of clinical predictive tasks.Deep learning methods have achieved promising performance on the tasks. However, most existing methodssuffer from three limitations: (i) There are lots of missing value for real value events, many methods imputethe missing value and then train their models based on the imputed values, which may introduce imputationbias. The models’ performance is highly dependent on the imputation accuracy. (ii) Lots of existing studies justtake Boolean value medical events (e.g. diagnosis code) as inputs, but ignore real value medical events (e.g.,lab tests and vital signs), which are more important for acute disease (e.g., sepsis) and mortality prediction.(iii) Existing interpretable models can illustrate which medical events are conducive to the output results, butare not able to give contributions of patterns among medical events.

Methods:In this study, we propose a novel interpretablePatternAttention model withValueEmbedding(PAVE) to predict the risks of certain diseases. PAVE takes the embedding of various medical events, theirvalues and the corresponding occurring time as inputs, leverage self-attention mechanism to attend tomeaningful patterns among medical events for risk prediction tasks. Because only the observed values areembedded into vectors, we don’t need to impute the missing values and thus avoids the imputations bias.Moreover, the self-attention mechanism is helpful for the model interpretability, which means the proposedmodel can output which patterns cause high risks.

Results:We conduct sepsis onset prediction and mortality prediction experiments on a publicly availabledataset MIMIC-III and our proprietary EHR dataset. The experimental results show that PAVE outperformsexisting models. Moreover, by analyzing the self-attention weights, our model outputs meaningful medicalevent patterns related to mortality.

Conclusions:PAVE learns effective medical event representation by incorporating the values and occurringtime, which can improve the risk prediction performance. Moreover, the presented self-attention mechanismcan not only capture patients’ health state information, but also output the contributions of various medicalevent patterns, which pave the way for interpretable clinical risk predictions.

Build the env

	pip install -r requirement.txt

Data preparing

  • Put your data in the folder ./data/
  • There are three csv files:
    • demo.csv: patients' demographics
    • label.csv: ground truth
    • data.csv: temporal records

Data preprocessing

  • Creat result folder for data preprocessing results

    mkdir result
    mkdir data
    mkdir data/models
    
  • Generate json files

    cd preprocessing/
    python gen_master_feature.py 
    python gen_feature_time.py 
    python gen_vital_feature.py 
    python gen_label.py 
    

Train and validate the model, the best model will saved in ../data/models/

	cd ../code/
	python main.py 

Test

	python main.py --phase test --resume ../data/models/best.ckpt

pave's People

Contributors

ping-zhang avatar yinchangchang avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

xiangbu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.