Skip to Content
View all events

Causal Inference for Data Scientists

Published by O'Reilly Media, Inc.

Beginner to intermediate content levelBeginner to intermediate

An introduction to causal inference using Python

This live event utilizes Jupyter Notebook technology

In this course, you’ll:

  • Learn typical use cases where causal inference is useful
  • Examine the pitfalls of observational data analysis
  • Understand various types of causal relationships

Causal inference methods have been employed in academia for many years but are currently exploding in popularity in the tech industry. Causal inference can be a theory-heavy topic, making it nearly impenetrable to novices.

Join expert Roni Kobrosly to get a gentle, practical, hands-on introduction to applying causal thinking and causal inference to data—while occasionally touching on the theory—using Python. You’ll understand causal inference methods that allow you to make better, data-driven decisions when evaluating actions or programs, learn the biases that are common in the analysis of observational data, and get a clearer view of cause and effect in your data.

What you’ll learn and how you can apply it

  • Start conducting preliminary causal analyses with your own data
  • Confidently explore the topic with a solid foundational understanding of causal thinking

This live event is for you because...

  • You’re a data analyst, data scientist, or ML engineer.
  • You work with Python, data, and machine learning.
  • You want to become a causal inference practitioner or move beyond simple data correlations to think more about causality in your data work.

Prerequisites

  • A computer with a Google Colab account (necessary to participate in exercises)
  • Familiarity with the standard Python data stack: matplotlib, numpy, pandas, and scikit-learn
  • Basic understanding of machine learning concepts
  • Basic knowledge of statistics concepts (mean, correlation, confidence interval, etc.)

Course Preparation

  • Familiarize yourself with Google Colab
  • Access the course documents (GitHub repository)

Recommended follow-up:

Schedule

The time frames are only estimates and may vary according to how the class is progressing.

Introduction (5 minutes)

  • Group discussion: Your comfort level with topic
  • Presentation: Goals of the course

Introducing causal thinking and causal graphs (55 minutes)

  • Presentation: Counterfactuals; causal inference; causal inference use cases; causal graphs; three primary types of causal relationships (confounding, colliders, mediators); selection bias
  • Hands-on exercise: Draw out car insurance causal graph; provide answers in group chat; explore causal graphs and relationships
  • Q&A
  • Break

Assumptions of causal inference (30 minutes)

  • Presentation: Simple suggestions for a causal inference workflow; core assumptions of causal inference; causal inference metrics
  • Hands-on exercise: Review sloppy examples of causal inference analyses for the causal assumptions each violates; share answers in group chat
  • Q&A

Basic causal inference modeling with a binary treatment (35 minutes)

  • Presentation: G-computation/s-learning; brief explanation of the algorithm; step-by-step with a simple table in the deck; propensity score matching/weighting and how it compares with g-computation.
  • Q&A
  • Jupyter notebook: Explore G-computation method
  • Break

Causal inference modeling with a continuous treatment (30 minutes)

  • Presentation: The problem of handling continuous treatments; how standard, bivariate plots of treatment and effect can fail; conceptualizing counterfactuals in the context of continuous treatments; interpreting the causal curve in words
  • Q&A
  • Jupyter notebook: Handle continuous treatments by estimating causal curves

Closing remarks (15 minutes)

  • Presentation: Troubleshooting common issues in causal inference analyses; basic causal inference assumptions and a final warning about them; links to other causal ML packages worth exploring (DoWhy, causalML, etc.)

Wrap-up and Q&A (10 minutes)

Your Instructor

Roni Kobrosly

Roni Kobrosly, PhD, is the Director of ML at Capital One. As a former epidemiology researcher, he conducted data analyses to estimate the population-level effects of harmful stress and environmental exposures when traditional randomized experiments were infeasible or unethical. He left the academic world in 2015 to work in the tech industry as a data scientist and ML engineer and has spent a decade employing causal modeling and inference. He loves mentoring junior data practitioners and explaining the magic of data and modeling to nontechnical audiences. Roni is also a member of the open source community, and the author and maintainer of the causal-curve Python package, which provides a set of tools for estimating the causal impact of continuous/nonbinary treatments.

linkedinXlinksearch

Skill covered

Data Science