Git Product home page Git Product logo

tpamtl's Introduction

Clinical Risk Prediction with Temporal Probabilistic Asymmetric Multi-Task Learning

This repository is the official implementation of Clinical Risk Prediction with Temporal Probabilistic Asymmetric Multi-Task Learning (AAAI 2021). https://arxiv.org/abs/2006.12777

Requirements

To install requirements:

pip install -r requirements.txt

Training

To train the models in the paper, run this command:

python run.py

Also for P-AMTL experiment on MNIST-variant dataset, you can run the same command inside MNIST directory. Please see MNIST Toy experiment section below for details.

Please look up and modify config.py for selecting base model and datasets. For example, if you want to run tp_amtl model on physionet2012 dataset, you can modify config.py as follows:

config.mtl_model = "tp_amtl"
config.task_code = "physionet2012"

Please put model name on config.mtl_model and dataset on config.task_code (both in lower-case). For tp_amtl (epistemic) and tp_amtl (aleatoric), config.mtl_model input can be written as below:

config.mtl_model = "tp_amtl_1" #tp_amtl (epistemic)
config.mtl_model = "tp_amtl_2" #tp_amtl (aleatoric)

For single-task version of UA,LSTM and RETAIN model, you can simply select config.tasks = [i] where i is the task you want to run (0,1,2,etc.). Also, for RETAIN-Kendall model, you need to change config.tasks [i for i in range(len(tasks))] where i is task id (0,1,2, etc.). Below is example for physionet2012 (also can be applied to MIMIC-III Heart Failure).

config.tasks = [0,1,2,3]

MNIST toy experiment

Requirement:

python3.6.9

torch

tqdm

matplotlib

sklearn

Training: Please download mnist_rotation_back_image_new.zip (https://sites.google.com/a/lisa.iro.umontreal.ca/public_static_twiki/variations-on-the-mnist-digits) into a folder named mnist_rotation_back inside the MNIST directory and unzip. Then run this command:

python run.py

Datasets

We experiment on four datasets that we compile for clinical risk prediction from two open-source electronic health records (EHR) datasets.

MIMIC-III Infection: code for train/test/valid separation

Physionet2012: code for train/test/valid separation

MIMIC-III Heart Failure: code for train/test/valid separation

MIMIC-III Respiratory Failure: code for train/test/valid separation

For MIMIC-III Respiratory Failure dataset, you can set as below on task_codes/mimic_respiratory_failure.py to experiment on dataset with full 37,818 instances.

path = 'mimic_respiratory_failure/30000/'

Results

Our model achieves the following performance on four datasets: mimic_infection physionet mimic_heart_failure mimic_respiratory_failure mimic_respiratory_30000

tpamtl's People

Contributors

anhtuan5696 avatar mandiehyewon avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.