Installation

Basic Installation Instructions

WhyNot supports Python3 on both OS X and Linux systems. We recommend using pip for installation and isolating the installation inside a virtualenv.

  1. (Optionally) create a virtual environment.
python3 -m venv whynot-env
source whynot-env/bin/activate
  1. Install the package.
pip install whynot

Installing Other Estimators

By default, WhyNot ships with a small set of causal estimators written in pure Python. Because many state-of-the-art causal inference routines are implemented in R or have complex dependencies, you may wish to install the companion WhyNot-Estimators package. This package makes a large collection of these estimators, for instance, causal forest, available for use with WhyNot.

To install WhyNot-Estimators and use the R-estimators, you will need a working installation of R. We recommend using Anaconda to install R, which will simplify dependency management. If you already have a working R installation and do not wish to install Anaconda, skip the first two steps.

  1. (Optional) Install Anaconda.
  2. (Optional) Create an R environment
conda create --name whynot r-base r-essentials
  1. Install the package!
pip install whynot_estimators

This installs the basic framework. To see all of the available estimators, run

python -m whynot_estimators show_all

To install specific estimators, run

python -m whynot_estimators install ESTIMATOR_NAME

Here, ESTIMATOR_NAME is the name of the estimator you wish to install. For example, to install the causal forest,

python -m whynot_estimators install causal_forest

To install all of the estimators, run

python -m whynot_estimators install all