GithubHelp home page GithubHelp logo

dsw's Introduction

DSW

Introduction

This repository contains source code for paper "Estimating Individual Treatment Effects with Time-Varying Confounders".

In this paper, we study the problem of Estimating individual treatment effects with time-varying confounders (as illustrated by a causal graph in the figure below)

We propose Deep Sequential Weighting (DSW) for estimating ITE with time-varying confounders. DSW consists of three main components: representation learning module, balancing module and prediction module.

To demonstrate the effectiveness of our framework, we conduct comprehensive experiments on synthetic, semi-synthetic and real-world EMR datasets (MIMIC-III). DSW outperforms state-of-the-art baselines in terms of PEHE and ATE.

Requirement

Ubuntu16.04, python 3.6

Install pytorch 1.4

Data preprocessing

Synthetic dataset

Simulate the all covariates, treatments and outcomes

cd simulation
python simulate_full.py

Semi-synthetic dataset

With a similar simulation process, we construct a semi-synthetic dataset based on a real-world dataset: MIMIC-III.

cd simulation
python simulate_mimic.py

Full list of covariates

We show the full list of static demographics and time-varying covariates of sepsis patients obtained from MIMIC-III.

Category Items Type
Demographics age Cont.
gender Binary
race (white, black, hispanic, other) Binary
metastatic cancer Binary
diabetes Binary
height Cont.
weight Cont.
bmi Cont.
Vital signs heart rate, systolic, mean and diastolic blood pressure Cont.
Respiratory rate, SpO2 Cont.
Temperatures Cont.
Lab tests sodium, chloride, magnesium Cont.
glucose, BUN, creatinine, urineoutput, GCS Cont.
white blood cells count, bands, C-Reactive protein Cont.
hemoglobin, hematocrit, aniongap Cont.
platelets count, PTT, PT, INR Cont.
bicarbonate, lactate Cont.

DSW

Running example

python train_synthetic.py --observation_window 30 --epochs 64 --batch-size 128 --lr 1e-3

Outputs

  • ITE estimation metrics: PEHE, ATE
  • Factual prediction metric: RMSE

dsw's People

Contributors

ruoqi-liu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dsw's Issues

No "simulation" directory

Hi! Thanks for making the codes available. I would like to try out the model on MIMIC-III dataset, but seems the directory "simulation" containing the pre-processing codes (cd simulation; python pre_mimic.py) is not in the repo. Would it be possible to also publish this directory?

Thanks for your help!

no pre_mimic.py

Hello, I was not able to find pre_mimic.py. I was wondering if the file may have been deleted or if it is yet to be shared. Thank you.

How to train model without Y_cf

Hi Ruoqi, we are trying to apply your model to our real data problem. I know your code is for simulation data, so we have to replace your data with our real data. Since for convenience, we would like to change as few codes as possible, so we decide to replace your A, X.all, X.Static and Y with our real data. but when we are planning so, we find out that there is Y_cf in your code. So i am wondering if we can get rid of Y_cf. or more a more general question, how can we import real data and apply your code to train the model. Thanks very much to any response or hint!

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.