Skip to content

Causal inference teaching materials for a proposed PyData NYC 2022 tutorial

License

Notifications You must be signed in to change notification settings

ronikobrosly/pydata_nyc_2022

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

intro-to-causal-inference

A introduction to causal inference using common tools from the python data stack

Table of Contents

Getting Started

Install graphviz

You'll need graphviz for our first exercise notebook, to visualize causal graphs.

Clone the repository

In your terminal, use git to clone the repo to your machine.

git clone [email protected]:ronikobrosly/pydata_nyc_2022.git

If you are less comfortable with git, there is an easy alternative: You can simply download a zip file of it here :)

Preparing python

Now you'll need to ensure you have a working python environment set up.

This tutorial requires python version 3.9 for the notebook exercises to properly work.

Create a new virtual environment for this tutorial. You can do this a number of ways. If you are running Anaconda python, you can do this through the conda command. Another method is to use the virtualenv python package. If you are a Windows or Linux user, please use this guide. If you are a MacOS user you can follow this guide.

Name your environment causal_modeling

"Activate" this environment (see the above guide) and then run the following command in the root folder of this repo: pip install -r requirement.txt

This will install all the necessary packages for the tutorial.

As an optional step, you can try to run the check_environment.py file (in the root folder of the repo) while within your virtual environment. You can do so by running python check_environment.py in your terminal. It will alert you if you're missing any required python packages.

Install a new IPython kernelspec

Once the above is complete, you'll need to run the following commands:

python -m ipykernel install --user --name causal_modeling --display-name "Python (causal_modeling)"

Start up jupyter lab and open a notebook

In the terminal, execute jupyter lab.

Navigate to the notebooks directory and open your notebook of choice. You will probably be asked which environment you would like to use with the notebook. Select the Python (causal_modeling) environment you created in the step above.

Slides

Slides to go along with the tutorial are available as a Google Doc Presentation.

Feedback

I love would to hear your feedback on these tutorial materials! Please send your comments to [email protected].

About

Causal inference teaching materials for a proposed PyData NYC 2022 tutorial

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published