Skip to content

apoorvalal/cbpys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cbpys : Covariate Balancing Propensity Scores in Python

Balancing scores for causal inference / covariate shift / domain adaptation. Uses exponential tilting / implied regularized logistic pscore for exact balance.

Installation:

First, install torch for your system (depending on whether you have a GPU or not) by following the instructions here.

Then, run

pip install git+https://github.com/apoorvalal/cbpys

or clone the repo and run

pip install -e .

(the latter is recommended since the code is still in development and you may want to pull updates)

Examples

  • examples/example.ipynb for an example using Lalonde data.
  • examples/ks.ipynb for an example using the Kang/Schafer simulation dgp.

References:

Reference R implementation is lightly edited version of published implementation here (courtesy Wager/Sverdrup)

About

CBPS via exponential tilting for ATE/ATT

Resources

Stars

Watchers

Forks