Balancing scores for causal inference / covariate shift / domain adaptation. Uses exponential tilting / implied regularized logistic pscore for exact balance.
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/example.ipynb
for an example using Lalonde data.examples/ks.ipynb
for an example using the Kang/Schafer simulation dgp.
Reference R implementation is lightly edited version of published implementation here (courtesy Wager/Sverdrup)