A Python package for causal inference using Synthetic Controls

Overview

Synthetic Control Methods

A Python package for causal inference using synthetic controls

This Python package implements a class of approaches to estimating the causal effect of an intervention on panel data or a time-series. For example, how was West Germany's economy affected by the German Reunification in 1990? Answering a question like this can be difficult when a randomized experiment is not available. This package aims to address this difficulty by providing a systematic way to choose comparison units to estimate how the outcome of interest would have evolved after the intervention if the intervention had not occurred.

As with all approaches to causal inference on non-experimental data, valid conclusions require strong assumptions. This method assumes that the outcome of the treated unit can be explained in terms of a set of control units that were themselves not affected by the intervention. Furthermore, the relationship between the treated and control units is assumed to remain stable during the post-intervention period. Including only control units in your dataset that meet these assumptions is critical to the reliability of causal estimates.

Installation

 pip install SyntheticControlMethods

Usage

In this simple example, we replicate Abadie, Diamond and Hainmueller (2015) which estimates the economic impact of the 1990 German reunification on West Germany using the synthetic control method. Here is a complete example with explanations (if you have trouble loading the notebook: use this).

#Import packages
import pandas as pd
from SyntheticControlMethods import Synth

#Import data
data = pd.read_csv("examples/german_reunification.csv")
data = data.drop(columns="code", axis=1)

#Fit classic Synthetic Control
sc = Synth(data, "gdp", "country", "year", 1990, "West Germany", pen=0)

#Visualize synthetic control
sc.plot(["original", "pointwise", "cumulative"], treated_label="West Germany", 
            synth_label="Synthetic West Germany", treatment_label="German Reunification"))

Synthetic Control for German Reunification

The plot contains three panels. The first panel shows the data and a counterfactual prediction for the post-treatment period. The second panel shows the difference between observed data and counterfactual predictions. This is the pointwise causal effect, as estimated by the model. The third panel adds up the pointwise contributions from the second panel, resulting in a plot of the cumulative effect of the intervention.

More background on the theory that underlies the Synthetic Control

1. The fundamental problem of Causal Inference

In this context, we define the impact or, equivalently, causal effect of some treatment on some outcome for some unit(s), as the difference in potential outcomes. For example, the effect of taking an aspirin on my headache is defined to be the difference in how much my head aches if I take the pill as compared to how much my head would have ached had I not taken it. Of course, it is not possible for me to both take and not take the aspirin. I have to choose one alternative, and will only observe the outcome associated with that alternative. This logic applies to any treatment on any unit: only one of two potential outcomes can ever be observed. This is often referred to as the fundamental problem of causal inference (Rubin, 1974). The objective of models in this package is to estimate this unobserved quantity–what the outcome of the treated unit would have been if it had not received the treatment.

2. The data format

In keeping with the notational conventions introduced in Abadie et al. (2010), consider J+1 units observed in time periods T = {1,2,...,T}. Unit at index 1 is the only treated unit, the remaining J units {2,..,J} are untreated. We define T0 to represent the number of pre-treatment periods and T1 the number post-treatment periods, such that T = T0+ T1. That is, Unit 1 is exposed to the treatment in every post-treatment period, T0+1,...,T1, and unaffected by the treatment in all preceding periods, 1,...,T0. Lastly, we require that a set of covariates–characteristics of the units relevant in explaining the value of the outcome–are observed along with the outcome at each time period. An example dataset might, in terms of structure, look like this:

Example Dataset

In this example dataset, each row represents an observation. The unit associated with the observation is indicated by the ID column, the time period of the observation by the Time column. Column y represents the outcome of interest and column x0,...,x3 are covariates. There can be an arbitrary, positive number of control units, time periods and covariates.

3. Synthetic Control Model

Conceptually, the objective of the SCM is to create a synthetic copy of the treated unit that never received the treatment by combining control units. More specifically, we want to select a weighted average of the control unit that most closely resembles the pre-treatment characteristics of the treated unit. If we find such a weighted average that behaves the same as the treated unit for a large number of pre-treatment periods, we make the inductive leap that this similarity would have persisted in the absence of treatment.

Any weighted average of the control units is a synthetic control and can be represented by a (J x 1) vector of weights W = (w2,...,wJ+1), with wj ∈ (0,1) and w2 + … + wJ+1 = 1. The objective is this to find the W for which the characteristics of the treated unit are most closely approximated by those of the synthetic control. Let X1 be a (k x 1) vector consisting of the pre-intervention characteristics of the treated unit which we seek to match in the synthetic control. Operationally, each value in X1 is the pre-treatment average of each covariate for the treated unit, thus k is equal to the number of covariates in the dataset. Similarly, let X0 be a (k x J) containing the pre-treatment characteristics for each of the J control units. The difference between the pre-treatment characteristics of the treated unit and a synthetic control can thus be expressed as X1 - X0W. We select W* to minimize this difference.

In practice, however, this approach is flawed because it assigns equal weight to all covariates. This means that the difference is dominated by the scale of the units in which covariates are expressed, rather than the relative importance of the covariates. For example, mismatching a binary covariate can at most contribute one to the difference, whereas getting a covariate which takes values on the order of billions, like GDP, off by 1% may contribute hundreds of thousands to the difference. This is problematic because it is not necessarily true that a difference of one has the same implications on the quality of the approximation of pre-treatment characteristics provided by the synthetic control. To overcome this limitation we introduce a (k x k) diagonal, semidefinite matrix V that signifies the relative importance of each covariate. Lastly, let Z1 be a (1 x T0) matrix containing every observation of the outcome for the treated unit in the pre-treatment period. Similarly, let Z0 be a (k x T0) matrix containing the outcome for each control unit in the pre-treatment period.

The procedure for finding the optimal synthetic control is expressed as follows:

That is, W*(V) is the vector of weights W that minimizes the difference between the pre-treatment characteristics of the treated unit and the synthetic control, given V. That is, W* depends on the choice of V–hence the notation W*(V). We choose V* to be the V that results in W*(V) that minimizes the following expression:

That is the minimum difference between the outcome of the treated unit and the synthetic control in the pre-treatment period.

In code, I solve for W*(V) using a convex optimizer from the cvxpy package, as the optimization problem is convex. I define the loss function total_loss(V) to be the value of Eq.2 with W*(V) derived using the convex optimizer. However, finding V that minimizes total_loss(V) is not a convex problem. Consequently, I use a solver, minimize(method=’L-BFGS-B’) from the scipy.optimize module, that does not require convexity but in return cannot guarantee that the global minimum of the function is found. To decrease the probability that the solution provided is only a local minimum, I initialize the function for several different starting values of V. I randomly generate valid (k x k) V matrices as Diag(K) with K ~ Dirichlet({11,...,1k}).

Input on how to improve the package is welcome, just submit a pull request along with an explanation and I will review it.

Comments
  • Invalid dimensions (0, 1). error

    Invalid dimensions (0, 1). error

    Hello, thank you for your great effort!

    I've got one year of daily observations for my data. There is only single co-variate and when I try to do

    sc = Synth(dataset=df_trips[['value', 'MM', 'group', 'DAY_NUMBER']], outcome_var="value", 
               id_var="group", time_var="DAY_NUMBER", treatment_period=296, treated_unit='1')
    

    I get Invalid dimensions (0, 1) error. Is there a problem with my understanding of the method?

    opened by TheDataCoder 6
  • questions on German reunification example

    questions on German reunification example

    Q1: Does the red dashed line represent the West Germany GDP if there was no reunification?

    Q2: After the reunification, does the actual "West Germany" GDP (the blue solid line) represent the entire Germany GDP? Or still just the West Germany GDP?

    opened by kdlin 5
  • Hi, Sometimes sum(sc.original_data.weight_df['Weight']) ! = 1, so how can I get the right weight?

    Hi, Sometimes sum(sc.original_data.weight_df['Weight']) ! = 1, so how can I get the right weight?

    First of all, I like this package!!! I need the weight for other information, but I ran into a situation after I get the weight: When sc.original_data.weight_df['Weight']) ! = 1, no matter how I deal with the weight, the sythetic control is not same as the plot.

    opened by SweetBeans0126 2
  • Repeatability Question

    Repeatability Question

    I re-ran your West Germany Reunification example and got different results. In your Jupyter notebook example, you have the following: pre_rmspe 110.635150 post_rmspe 2239.826549 post/pre 20.245162 Name: 0, dtype: float64

    After I re-ran your example, I have the following: unit West Germany pre_rmspe 96.2433 post_rmspe 2246.03 post/pre 23.337

    Can you please explain the differences? The result is from this statement: sc.original_data.rmspe_df.iloc[0].

    Additionally, when I ran the visualization code for in-place placebo plot (i.e., sc.plot(['rmspe ratio'], treated_label="West Germany"), it yielded a chart that is rotated 90 degrees from yours.

    opened by kdlin 2
  • Suggestions

    Suggestions

    Hi Oscar,

    I'd like to suggest that you add the following?

    1. For in-time placebo analysis, it is desirable to have a quantitative number describing the placebo effect. Using your West Germany Reunification example, maybe you can have a rmspe number for 1982-1989 to denote the placebo effect?
    2. For in-place placebo effect analysis, it would be great to have an api parameter that allows the users to exclude the treated unit. In your West German Reunification example, if the analysis can be done with and without the West Germany data, that would explain the placebo effect even more.
    3. Maybe you can add a page to describe the various APIs in your package? You have examples for using them. But it would help if you have a page describing these APIs as well. Hope this help.
    opened by kdlin 2
  • scipy dependency quickly becoming out of date

    scipy dependency quickly becoming out of date

    Hi! First off, thanks for the useful package :-). Just writing to raise the issue that the strict dependency on an increasingly out of date scipy version is a bit of a pain? Every time I try to update another package, scipy gets updated with it, leading to a conflict with this package. Is there a way to generalize the scipy requirements/be more flexible with newer versions?

    opened by merubhanot 1
  • Conflicting Dependencies and ERROR: No matching distribution found for scipy==1.4.1

    Conflicting Dependencies and ERROR: No matching distribution found for scipy==1.4.1

    Hello,

    When I download SyntheticControlMethods on Python 3.9.5, I encountered the problem of conflicting dependencies. I tried to solve this problem by specifying the version of the module(package). I tried pip install SyntheticContolMethods==1.1.16 , ==1.1.15, ==1.1.14. However, in all these versions, I encountered "ERROR: No matching distribution found for scipy==1.4.1." I hope you can fix this problem. I am not able to download the package because of the error.

    opened by muharrembb 1
  • Installation Issue? Is it just me?

    Installation Issue? Is it just me?

    Hey @OscarEngelbrektson,

    First of all, thank you for making this package! I ran into your package while trying to implement synthetic control methods with the data I have. However, I'm having an installation error, and I was wondering if you know how to troubleshoot it.

    I created a new virtual environment and pip install SyntheticControlMethods, I'm getting this error:

    PS C:\Users\YC\Documents\staging\SyntheticControl> pip install SyntheticControlMethods
    Collecting SyntheticControlMethods
      Using cached https://files.pythonhosted.org/packages/08/b5/553d6db75450bcf4b3062ad834339298abcdc1ad509e9878f9ef413a750d/Synth
    eticControlMethods-1.1.16-py2.py3-none-any.whl
    Collecting cvxpy==1.1.7 (from SyntheticControlMethods)
      Using cached https://files.pythonhosted.org/packages/66/f8/a0990f6d6df5872f9d2cc62dd102242e05f7204b2f1ddf2e504fefeb9e25/cvxpy
    -1.1.7.tar.gz
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
        Preparing wheel metadata ... done
    Collecting jinja2>=2.10 (from SyntheticControlMethods)
      Using cached https://files.pythonhosted.org/packages/7e/c2/1eece8c95ddbc9b1aeb64f5783a9e07a286de42191b7204d67b7496ddf35/Jinja
    2-2.11.3-py2.py3-none-any.whl
    Collecting scipy==1.4.1 (from SyntheticControlMethods)
      Using cached https://files.pythonhosted.org/packages/17/e8/2aaf518a81bb0bdb0743a21cc7be3fae4101f763b3c8b097d62118d9267f/scipy
    -1.4.1-cp37-cp37m-win32.whl
    Collecting matplotlib>=2.2.3 (from SyntheticControlMethods)
      Downloading https://files.pythonhosted.org/packages/3b/70/9f4b21cf30e644149dc9fc07cc4807f2318439a5966eb90a9d650291acdf/matplo
    tlib-3.4.1-cp37-cp37m-win32.whl (7.0MB)
        100% |████████████████████████████████| 7.0MB 7.9MB/s
    Collecting pandas>=1.1.2 (from SyntheticControlMethods)
      Downloading https://files.pythonhosted.org/packages/86/32/fccb5c4d31b66585d84fb3a4831b5e9982b13a5b00c88c397b78ff89ec5f/pandas
    -1.2.4-cp37-cp37m-win32.whl (8.1MB)
        100% |████████████████████████████████| 8.1MB 6.8MB/s
    Collecting numpy>=1.17 (from SyntheticControlMethods)
      Using cached https://files.pythonhosted.org/packages/73/ef/f8768261693c32bfffdbf640b9461948639396c3014163523f19bc44ce64/numpy
    -1.20.2-cp37-cp37m-win32.whl
    Collecting scs>=1.1.6 (from cvxpy==1.1.7->SyntheticControlMethods)
      Downloading https://files.pythonhosted.org/packages/12/bd/1ab6a3b3f2791741e6e7c142f932ea1808277e92167e322dec43271b2225/scs-2.
    1.3.tar.gz (147kB)
        100% |████████████████████████████████| 153kB 17.1MB/s
    Collecting osqp>=0.4.1 (from cvxpy==1.1.7->SyntheticControlMethods)
      Using cached https://files.pythonhosted.org/packages/c0/90/4cf48c200a89e46bcad87e12469ee36fc03d0c3f16b703b747e8c4bf618e/osqp-
    0.6.2.post0.tar.gz
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Installing backend dependencies ... error
      Complete output from command c:\users\yc\documents\staging\syntheticcontrol\project_env\scripts\python.exe c:\users\yc\docume
    nts\staging\syntheticcontrol\project_env\lib\site-packages\pip install --ignore-installed --no-user --prefix C:\Users\YC\AppDat
    a\Local\Temp\pip-build-env-7p91o_ip\normal --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.or
    g/simple -- qdldl:
      Collecting qdldl
        Using cached https://files.pythonhosted.org/packages/ec/a3/db0e7c9fec5387dc33cbd2819329c141ba76497148aa9fab4bd1a7c2a279/qdl
    dl-0.1.5.post0.tar.gz
      Collecting numpy>=1.7 (from qdldl)
        Using cached https://files.pythonhosted.org/packages/73/ef/f8768261693c32bfffdbf640b9461948639396c3014163523f19bc44ce64/num
    py-1.20.2-cp37-cp37m-win32.whl
      Collecting scipy>=0.13.2 (from qdldl)
        Using cached https://files.pythonhosted.org/packages/c9/fb/f25bae744df18c0d9320f6271aa302d3671d4d52f0f06e6516618d37f980/sci
    py-1.6.3-cp37-cp37m-win32.whl
      Installing collected packages: numpy, scipy, qdldl
        Running setup.py install for qdldl: started
          Running setup.py install for qdldl: finished with status 'error'
          Complete output from command c:\users\yc\documents\staging\syntheticcontrol\project_env\scripts\python.exe -u -c "import
    setuptools, tokenize;__file__='C:\\Users\\YC\\AppData\\Local\\Temp\\pip-install-4rrtn1da\\qdldl\\setup.py';f=getattr(tokenize,
    'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C
    :\Users\YC\AppData\Local\Temp\pip-record-9lgy87c0\install-record.txt --single-version-externally-managed --prefix C:\Users\YC\A
    ppData\Local\Temp\pip-build-env-7p91o_ip\normal --compile --install-headers c:\users\yc\documents\staging\syntheticcontrol\proj
    ect_env\include\site\python3.7\qdldl:
          running install
          running build
          running build_ext
          -- Selecting Windows SDK version  to target Windows 10.0.19042.
          CMake Error at CMakeLists.txt:4 (project):
            Failed to run MSBuild command:
    
              MSBuild.exe
    
            to get the value of VCTargetsPath:
    
              The system cannot find the file specified
    
    
    
          -- Configuring incomplete, errors occurred!
          See also "C:/Users/YC/AppData/Local/Temp/pip-install-4rrtn1da/qdldl/c/build/CMakeFiles/CMakeOutput.log".
          The system cannot find the file specified
          CMake Error: Generator: execution of make failed. Make command was: MSBuild.exe qdldlamd.vcxproj /p:Configuration=Release
     /p:Platform=Win32 /p:VisualStudioVersion=14.0 /v:m &&
          building 'qdldl' extension
          error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.micros
    oft.com/downloads/
    
          ----------------------------------------
      Command "c:\users\yc\documents\staging\syntheticcontrol\project_env\scripts\python.exe -u -c "import setuptools, tokenize;__f
    ile__='C:\\Users\\YC\\AppData\\Local\\Temp\\pip-install-4rrtn1da\\qdldl\\setup.py';f=getattr(tokenize, 'open', open)(__file__);
    code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\YC\AppData\Local
    \Temp\pip-record-9lgy87c0\install-record.txt --single-version-externally-managed --prefix C:\Users\YC\AppData\Local\Temp\pip-bu
    ild-env-7p91o_ip\normal --compile --install-headers c:\users\yc\documents\staging\syntheticcontrol\project_env\include\site\pyt
    hon3.7\qdldl" failed with error code 1 in C:\Users\YC\AppData\Local\Temp\pip-install-4rrtn1da\qdldl\
      You are using pip version 19.0.3, however version 21.1.1 is available.
      You should consider upgrading via the 'python -m pip install --upgrade pip' command.
    
      ----------------------------------------
    Command "c:\users\yc\documents\staging\syntheticcontrol\project_env\scripts\python.exe c:\users\yc\documents\staging\syntheticc
    ontrol\project_env\lib\site-packages\pip install --ignore-installed --no-user --prefix C:\Users\YC\AppData\Local\Temp\pip-build
    -env-7p91o_ip\normal --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- qdldl" fai
    led with error code 1 in None
    
    opened by YoungAldehyde 1
  • Added Differenced Synthetic Control

    Added Differenced Synthetic Control

    *Added DiffSynth class in main.py, including additional data processing needed for Differenced Synthetic Control method. *Refactored SynthBase -> SynthData, such that it can be used by both DiffSynth and Synth *Refactored existing functions in inferences.py to accommodate both methods *Extended inferences.py with additional inference steps needed for DSC

    opened by OscarEngelbrektson 0
  • enable multi-valued treatedment ID

    enable multi-valued treatedment ID

    This adapts the data processors to handle multiple values for treatment units. In cases where the value is a number or string only, it passes through seamlessly. In cases were an iterable is provided, it is also handled.

    Context: I attempted to use thie module where sets of a geographic location were treated.

    opened by tom-flamelit 0
  • Cannot reshape array

    Cannot reshape array

    I'm trying to run a synthetic control model with my data and I'm getting the error message below. Can someone help me, please?

    Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\SyntheticControlMethods\main.py", line 333, in init original_checked_input = self._process_input_data( File "C:\ProgramData\Anaconda3\lib\site-packages\SyntheticControlMethods\main.py", line 175, in _process_input_data control_outcome_all, control_outcome, unscaled_control_covariates = self._process_control_data( File "C:\ProgramData\Anaconda3\lib\site-packages\SyntheticControlMethods\main.py", line 243, in _process_control_data control_outcome_all = np.array(control_data_all[outcome_var]).reshape(n_controls, periods_all).T #All outcomes ValueError: cannot reshape array of size 773 into shape (43,18)

    opened by hermelino 1
  • Few pre-intervention years

    Few pre-intervention years

    @OscarEngelbrektson Thanks for developing this great package. One issue I've had with this package is that I only got 2 years before intervention, which is so insufficent that lead to an inaccurate SC result. image Any suggestions to improve accracy?

    opened by JerryShen180 0
  • Shape issues in the README

    Shape issues in the README

    The README says:

    "Lastly, let Z1 be a (1 x T0) matrix containing every observation of the outcome for the treated unit in the pre-treatment period. Similarly, let Z0 be a (k x T0) matrix containing the outcome for each control unit in the pre-treatment period."

    Screen Shot 2022-02-14 at 3 25 10 PM

    The above equation cannot satisfy variables with the listed shapes.

    I think the listed shapes should instead read:

    "Lastly, let Z1 be a (T0 x 1) matrix containing every observation of the outcome for the treated unit in the pre-treatment period. Similarly, let Z0 be a (T0 x J) matrix containing the outcome for each control unit in the pre-treatment period."

    So that each observed outcome for the 1 intervention group is compared to the weighted average of the observed outcomes of the J control groups at each time steps in the T0 steps leading up to intervention.

    Please let me know if I have missed something, because this is based on my initial studying of the code and README. Thank you!

    opened by johnnyL7 0
  • Saving figures

    Saving figures

    Hello! One issue I've had with this package is that there's no built in way (that I can see) of saving figures generated by .plot() commands, potentially by passing a ``savepath'' argument (that can default to None). Would be great to add this to the core package!

    opened by merubhanot 0
Owner
Oscar Engelbrektson
Oscar Engelbrektson
CausalNLP is a practical toolkit for causal inference with text as treatment, outcome, or "controlled-for" variable.

CausalNLP CausalNLP is a practical toolkit for causal inference with text as treatment, outcome, or "controlled-for" variable. Install pip install -U

Arun S. Maiya 95 Jan 3, 2023
Deep Learning Models for Causal Inference

Extensive tutorials for learning how to build deep learning models for causal inference using selection on observables in Tensorflow 2.

Bernard  J Koch 151 Dec 31, 2022
Torchserve server using a YoloV5 model running on docker with GPU and static batch inference to perform production ready inference.

Yolov5 running on TorchServe (GPU compatible) ! This is a dockerfile to run TorchServe for Yolo v5 object detection model. (TorchServe (PyTorch librar

null 82 Nov 29, 2022
Data-depth-inference - Data depth inference with python

Welcome! This readme will guide you through the use of the code in this reposito

Marco 3 Feb 8, 2022
StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation

StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation Demo video: CVPR 2021 Oral: Single Channel Manipulation: Localized or attribu

Zongze Wu 267 Dec 30, 2022
Implementation of StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation in PyTorch

StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation Implementation of StyleSpace Analysis: Disentangled Controls for StyleGAN Ima

Xuanchi Ren 86 Dec 7, 2022
Discovering Interpretable GAN Controls [NeurIPS 2020]

GANSpace: Discovering Interpretable GAN Controls Figure 1: Sequences of image edits performed using control discovered with our method, applied to thr

Erik Härkönen 1.7k Jan 3, 2023
Language Models Can See: Plugging Visual Controls in Text Generation

Language Models Can See: Plugging Visual Controls in Text Generation Authors: Yixuan Su, Tian Lan, Yahui Liu, Fangyu Liu, Dani Yogatama, Yan Wang, Lin

Yixuan Su 195 Dec 22, 2022
Monocular 3D pose estimation. OpenVINO. CPU inference or iGPU (OpenCL) inference.

human-pose-estimation-3d-python-cpp RealSenseD435 (RGB) 480x640 + CPU Corei9 45 FPS (Depth is not used) 1. Run 1-1. RealSenseD435 (RGB) 480x640 + CPU

Katsuya Hyodo 8 Oct 3, 2022
PyTorch-LIT is the Lite Inference Toolkit (LIT) for PyTorch which focuses on easy and fast inference of large models on end-devices.

PyTorch-LIT PyTorch-LIT is the Lite Inference Toolkit (LIT) for PyTorch which focuses on easy and fast inference of large models on end-devices. With

Amin Rezaei 157 Dec 11, 2022
JudeasRx - graphical app for doing personalized causal medicine using the methods invented by Judea Pearl et al.

JudeasRX Instructions Read the references given in the Theory and Notation section below Fire up the Jupyter Notebook judeas-rx.ipynb The notebook dra

Robert R. Tucci 19 Nov 7, 2022
Implement Decoupled Neural Interfaces using Synthetic Gradients in Pytorch

disclaimer: this code is modified from pytorch-tutorial Image classification with synthetic gradient in Pytorch I implement the Decoupled Neural Inter

Andrew 114 Dec 22, 2022
Python package facilitating the use of Bayesian Deep Learning methods with Variational Inference for PyTorch

PyVarInf PyVarInf provides facilities to easily train your PyTorch neural network models using variational inference. Bayesian Deep Learning with Vari

null 342 Dec 2, 2022
Code for Quantifying Ignorance in Individual-Level Causal-Effect Estimates under Hidden Confounding

?? quince Code for Quantifying Ignorance in Individual-Level Causal-Effect Estimates under Hidden Confounding ?? Installation $ git clone [email protected]

Andrew Jesson 19 Jun 23, 2022
CausaLM: Causal Model Explanation Through Counterfactual Language Models

CausaLM: Causal Model Explanation Through Counterfactual Language Models Authors: Amir Feder, Nadav Oved, Uri Shalit, Roi Reichart Abstract: Understan

Amir Feder 39 Jul 10, 2022
Code for "Causal autoregressive flows" - AISTATS, 2021

Code for "Causal Autoregressive Flow" This repository contains code to run and reproduce experiments presented in Causal Autoregressive Flows, present

Ricardo Pio Monti 35 Dec 16, 2022
[ICCV 2021] Released code for Causal Attention for Unbiased Visual Recognition

CaaM This repo contains the codes of training our CaaM on NICO/ImageNet9 dataset. Due to my recent limited bandwidth, this codebase is still messy, wh

Wang Tan 66 Dec 31, 2022
Causal estimators for use with WhyNot

WhyNot Estimators A collection of causal inference estimators implemented in Python and R to pair with the Python causal inference library whynot. For

ZYKLS 8 Apr 6, 2022
Multi-task Learning of Order-Consistent Causal Graphs (NeuRIPs 2021)

Multi-task Learning of Order-Consistent Causal Graphs (NeuRIPs 2021) Authors: Xinshi Chen, Haoran Sun, Caleb Ellington, Eric Xing, Le Song Link to pap

Xinshi Chen 2 Dec 20, 2021