Title: Tools and Methodologies for Studying Causal Effects - PyImageSearch

URL Source: https://pyimagesearch.com/2023/11/20/tools-and-methodologies-for-studying-causal-effects/

Published Time: 2023-11-20T14:00:00+00:00

Markdown Content:
* * *

**Table of Contents**
---------------------

*   [Tools and Methodologies for Studying Causal Effects](#h2BPTitle)

*   [Randomization](#h3Randomization)
*   [A/B Test](#h3Test)
*   [Multi-Armed Bandits](#h3Bandits)
*   [Natural Experiments](#h3Natural)
*   [Regression Discontinuity](#h3Regression)
*   [Instrumental Variable](#h3Instrumental)
*   [Observational Data](#h3Observational)
*   [Backdoor Criterion](#h3Backdoor)
*   [Propensity Score Matching](#h3Propensity)

*   [Summary](#h2Summary)

*   [References](#h3References)
*   [Citation Information](#h3Citation)

* * *

This lesson is the 3rd in a 5-part series on Causality in Machine Learning:

1.  [_Introduction to Causality in Machine Learning_](https://pyimg.co/3sa8x)
2.  [_Best Machine Learning Datasets_](https://pyimg.co/cds9g)
3.  [**_Tools and Methodologies for Studying Causal Effects_**](https://pyimg.co/pkm2j) **(this tutorial)**
4.  _A Brief Introduction to Do-Calculus_
5.  _Studying Causal Effect with Microsoft’s Do-Why Library_

[![Image 1](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20603%20500'%3E%3C/svg%3E)](https://pyimagesearch.com/wp-content/uploads/2023/11/tools-methodologies-causal-effects-featured.png)

**To learn the tools for studying causality in your data,** **_just keep reading._**

* * *

[**Tools and Methodologies for Studying Causal Effects**](#TOC-h2BPTitle)
-------------------------------------------------------------------------

Welcome back to Part 3 of the 5-part series on **Causality in Machine Learning**. The previous one was all about introducing Causality in the briefest way possible. You can find it right [here](https://pyimagesearch.com/2023/05/08/introduction-to-causality-in-machine-learning/).

Picking up where we left off, let us revise what we learned in Part 1.

*   Ignoring hidden causes in data can mean death for your model
*   Counterfactual thinking is a must
*   Randomization, Natural Experiments, and Conditioning are the tools of the trade

Right. Now that we have sorted that, let us start with those three vague terms. Randomization, natural experiments, and conditioning, what are they? How do we use them with our data, and why do we need to care?

Well, let us start scratching the list one item at a time.

* * *

### [**Randomization**](#TOC-h3Randomization)

So, what do we mean when we talk about Randomization in the context of Causality? Well, at the core of it, causal knowledge prefers the intervention it demands. What do I mean by that?

In very simple terms, if you say ![Image 2: A](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2011'%3E%3C/svg%3E) causes ![Image 3: B](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2013%2011'%3E%3C/svg%3E), you must be able to show to some degree that in the absence of ![Image 4: A](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2011'%3E%3C/svg%3E) and all other parameters staying constant, ![Image 5: B](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2013%2011'%3E%3C/svg%3E) will not occur.

Now, that is a fairly straightforward statement, but the implications go deeper. Suppose you want to prove that ads by ads on Netflix will cause users to delete accounts. That’s a decent assumption, and you start trying to prove it. You remove the cause (Netflix ads) and try to study the user’s behavior, but here’s the catch: you are not exactly studying user behavior. The other parameters are not kept constant. You are not looking at a parallel world where a doppelganger of the user is not shown an ad when they open Netflix.

This is exactly what randomization tries to solve. It tells us that in the context of our experiment (ads on Netflix), if we create a set of users and then randomly assign a user to a group (one group gets shown ads and the other group doesn’t), then we are essentially keeping the “other parameters” constant, as shown in **Figure 1**.

[![Image 6](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20700%20394'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/f2GvD2Gt4tSCLSWiGeqAXIUDhtVW6reBGax-ugRSZFxg9hvQjg8xstyPO_AKiGtXb0BGiVWFTuK51mExTGm1M-Bi2pwExhnOFF1Vol-xvsri6itWQVzEDP4TcMCqSkKpsPRvnQ38FfKb77QoI2b4OpU)

**Figure 1:** Randomization of Netflix shows (source: image by the authors).

Two ways we can achieve randomization are:

*   A/B testing
*   Multi-armed bandits

* * *

### [**A/B Test**](#TOC-h3Test)

This is exactly what we were talking about a second back. Create two groups of subjects (A & B group) and treat them differently (ads vs. no ads) and see which one of the groups meets the target (cancellation of subscription). So, in summary, the steps to be followed are:

*   Create two groups of subjects
*   Expose each of the groups to two different experiments
*   Find out which meets the target

The Causal Estimate (CE) for this methodology is the difference in outcome due to option 1 and option 2.

![Image 7: \text{CE} = Y_\text{option1} - Y_\text{option2}](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20163%2017'%3E%3C/svg%3E)

➤ Check out how Netflix actually uses A/B testing in [this video](https://www.youtube.com/watch?v=XRd6Ddn4ZSY).

* * *

### [**Multi-Armed Bandits**](#TOC-h3Bandits)

The second and a little less famous of the randomization strategy is multi-armed bandits. This methodology derives its name from the arms of slot machines. Historically, the infamous problem goes as such:

Given multiple slot machines, a gambler has to decide which arms to pull and how many times in order to maximize profit. Needless to say, countless have been slain by this problem, purely to quench their mathematical curiosity.

This method relies on a very interesting strategy known as **Exploit and Explore**. **Exploit** as in figure out the best option and keep repeating it to maximize the target outcome, and **Explore** as in explore all possible options in the given context of the problem.

One example would be if you had to figure out which Baskin-Robbins ice cream would give you the maximum satisfaction (target outcome), as shown in **Figure 2**. The steps listed below are some ways to carry out Exploration and Exploitation while maximizing satisfaction.

[![Image 8](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20700%20342'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/vYfeqcaNo25lCECiXowAThydvzrpdZGqDu0CQr4Nc3Yk5diVIqNwyoUMhiuKUmctbnSrdfjc8AyofS2ricwe1DUgjyapZf1Rewv7MnTij9T25WPB0zX__TwbpU7H3C9pH1stnuCdgyZGTDlqKlfNDkE)

**Figure 2:** Exploit vs. Explore (source: image by the authors).

*   Explore only. This means every day, you go to Baskin-Robbins and select a new flavor, try it out, and see if it gives you maximum satisfaction.
*   Exploit only. On the first 10 days, you visit Baskin-Robbins and try 10 different flavors. From the 11th day, you keep buying that one flavor that gave you maximum satisfaction from those 10 previously tested ones.
*   Epsilon — greedy.
*   Strike a balance between exploring an exploit.
*   Set an initial epsilon (indicator)
*   Based on the value of epsilon (randomly picked), we will either explore or exploit.
*   If we exploit, then we pick the best ice cream from already gathered data; if we explore, then we randomly pick an ice cream from the counter.

![Image 9: Y_b](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2014%2014'%3E%3C/svg%3E) = target outcome is the best possible, ![Image 10: Y_c](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2015%2014'%3E%3C/svg%3E) = current target outcome and ![Image 11: \text{CE}](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2023%2012'%3E%3C/svg%3E) = Causal Estimate

![Image 12: \text{CE} = Y_b - Y_c](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2095%2015'%3E%3C/svg%3E)

*   Use multi-armed bandits only, and only if you have a good number of options to test.

➤ The verdict?

➤ Use Randomization even if it means staying up a couple of nights and designing an experiment in which you must create a parallel universe. In all seriousness, the two methods shown above actually give us a good structure through which we can shape randomized experiments that give us a sense of causal direction.

* * *

### [**Natural Experiments**](#TOC-h3Natural)

Yep, randomization is hard, and if there is no way for you to intervene, then that ship has sailed. Let’s have a look at what the next best option is. Natural Experiments are a way to test causality by shaping naturally occurring phenomena as an experiment. It’s kind of like cheating, but in a scientific way.

The two most prevalent ways to do this are as follows:

*   Regression Discontinuity
*   Instrumental Variables

* * *

### [**Regression Discontinuity**](#TOC-h3Regression)

Let us imagine that we are the top-secret evil society that controls the funding for academic labs. We want to check if granting more funds will cause an increase in lab performance. However, there is a catch: funding is also dependent on the number of papers published (i.e., the number of papers published will have to be above a certain threshold (theta) for the lab to qualify for funding), as shown in **Figure 3**.

[![Image 13](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20589%20500'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/G0Bl4z5PYKMNjpplY7TrgH97AEe6Rg4h1U_8DWEgsXpFxazbyodEeaafd04DCn4lFrTXd3q2b9lcvGpkGZq-4ShaXZkMlOuyhOKjvUAEqSC7JW8xnwFlIidVSVkn4Yokp8a8r2ON9ToMnkIhPR02VyY)

**Figure 3:** Graph showing the relationship between Lab Funding and Number of Papers (source: image by the authors).

![Image 14: y = B_0 +B_1x +B_2(x>x_t)+e](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20221%2018'%3E%3C/svg%3E)

Use the linear regression model to estimate the outcome, however, and this may be counterintuitive if there is a discontinuous jump at the point where ![Image 15: x =x_t](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2044%2010'%3E%3C/svg%3E) or when your threshold is reached. The measure of this discontinuity is your Causal Estimate. If there is a small jump, funding probably does not play a big role in lab performance, and we can continue to be greedy evil super-villains. If the jump is huge enough, then we have problems and might have to release some of our super-villain money as research grants.

* * *

### [**Instrumental Variable**](#TOC-h3Instrumental)

Before diving deep into this particular, let us revise some of the previous concepts we glided past.

**Outcome Variable:** This is a notation (almost always ![Image 16: Y](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2013%2011'%3E%3C/svg%3E)) used to denote the final outcome of our causal experiments.

**Treatment Variable:** This is another useful notation (almost always ![Image 17: t](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%206%2010'%3E%3C/svg%3E)) used to denote the treatment in our causal experiments. In the context of the Netflix ads, problem ![Image 18: t](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%206%2010'%3E%3C/svg%3E) = showing ads on Netflix, or ![Image 19: t](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%206%2010'%3E%3C/svg%3E) = not showing ads on Netflix.

**Instrumental Variable:** This is used to denote the variable that affects our outcome through our treatment variable. This variable does not have the scope to affect the outcome directly but influences the treatment variable, thereby indirectly affecting the outcome.

Confused? Let’s take a look at an example:

Imagine we have now joined a publishing company as a data scientist. A strange rumor is abuzz in the marketing department. It is believed that more Twitter mentions (![Image 20: \text{TM}](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2027%2013'%3E%3C/svg%3E)) will always cause more book sales (![Image 21: \text{BS}](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2021%2012'%3E%3C/svg%3E)). As data scientists, only we can debunk or solidify this rumor. Let’s look at the causal graphs in **Figures 4 and 5**.

[![Image 22](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20700%20394'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/EOgguPu7op7xP6friIVcVWbDzy_gGf-TJx2Jy-rKlVXmtwFmRfP9pk_RuikJ9t8jXrD9iTjvOwO1SMNwVsBMxjI8goEwljqRJp6vniNJJtQgTT40LxjV6_V-080sd5t6C8YB5rxtlg1X9xbHypIWOkA)

**Figure 4:** Graph for Scenario 1 (source: image by the authors).

[![Image 23](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20700%20394'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/U5z88P5Nm6mrKbM2tGXz9tTpTjLHbRLIevFdlB0SkG3xpBETZJfvC1fEj2VcyaTqeLcGFh8O9Z8LhJ0s0s9_0zlyv7-lbLm5u2E8L64gQBXLUvhMzcS4XVkhdHSJ7T5rMqplQLVKcAiO-b7fueDYxgc)

**Figure 5:** Graph for Scenario 2 (source: image by the authors).

Consider the following:

Let us try to model the two causal graphs shown above using simple regression equations. A list of notations is given below:

Now, let us see what a regression equation for the first figure will look like.

![Image 24: \text{BS}_\text{orig} = B_0 + B_1(\text{TM}) + e](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20187%2019'%3E%3C/svg%3E)

Now, as the author tweeting will be our instrumental variable, let us frame a different regression equation.

![Image 25: \text{TM} = B_1 + B_2(at)+e](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20160%2018'%3E%3C/svg%3E)

![Image 26: B_o](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2018%2014'%3E%3C/svg%3E), ![Image 27: B_1](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2017%2015'%3E%3C/svg%3E), and ![Image 28: e](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%207%207'%3E%3C/svg%3E) is used through a method of least squares to generate ![Image 29: \widehat{\text{TM}}](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2027%2018'%3E%3C/svg%3E). This is different from ![Image 30: \text{TM}](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2027%2013'%3E%3C/svg%3E) as this has been generated specifically using the variable of the author tweeting excerpts. This ![Image 31: \widehat{\text{TM}}](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2027%2018'%3E%3C/svg%3E) will now be used in another regression equation to generate the new figure for book sales.

![Image 32: \text{BS} = B_3 + B_4(\widehat{\text{TM}}) + e](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20167%2021'%3E%3C/svg%3E)

![Image 33: \text{CE} = \text{BS} - \text{BS}_\text{orig}](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20126%2017'%3E%3C/svg%3E)

➤ The verdict?

➤ If you have a scenario like the ones we presented and there are naturally occurring experiments like academic grants for labs above a certain threshold and authors tweeting excerpts from their books, do go for methodologies that leverage these occurrences. This will always give us a better edge and, in the end, present a better-rounded picture of cause and effect.

* * *

### [**Observational Data**](#TOC-h3Observational)

Now comes the hard part. You can’t intervene and create randomized experiments. You can’t find occurrences in your data that qualify as natural experiments. All you are left with is cold hard, observational data from 2 years back. This is the most explored and most complex part of causal analysis.

TLDR;

You are doomed.

Largely speaking, to estimate causality from observational data only, there are 3 major steps.

1.  Assume a graphical model
2.  Make stratifications (different groups)
3.  Compare the treatment across stratifications

How do we do this? Again, we have 2 strategies that are quite fail-proof and widely used.

*   Many of these methods are more theoretical, which means you’ll probably have to spend more time with a notebook figuring out all the variables before jumping into code/math.

* * *

### [**Backdoor Criterion**](#TOC-h3Backdoor)

Block all the backdoor paths, that is, block all the non-causal associations and study the final outcome based on the treatment. So, what is a backdoor criterion again?

A set of variables ![Image 34: W](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2018%2011'%3E%3C/svg%3E) satisfies the backdoor criteria if the following are true:

1.  ![Image 35: W](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2018%2011'%3E%3C/svg%3E) blocks all the backdoor paths from treatment (![Image 36: t](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%206%2010'%3E%3C/svg%3E)) to outcome (![Image 37: Y](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2013%2011'%3E%3C/svg%3E))
2.  ![Image 38: W](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2018%2011'%3E%3C/svg%3E) does not contain any descendants of treatment (![Image 39: t](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%206%2010'%3E%3C/svg%3E)).

Wait, so what is a backdoor?

Well, there is a lot of mathematical jargon available to define it, but the general thumb-rule is

*   Arrows pointing away from treatment (![Image 40: t](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%206%2010'%3E%3C/svg%3E)) are frontdoors.
*   Arrows pointing toward treatment (![Image 41: t](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%206%2010'%3E%3C/svg%3E)) are backdoors.

We illustrate these using the following two diagrams in **Figures 6 and 7**.

[![Image 42](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20700%20394'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/mt53vQcQVj4ku7mC4GX2PhAsDbnz6a9-BdDGHKByXIhGbJlfuaeMwG9u1E6SSAVLLAhmpRMXwQO-k3jKMggvkBZbGQ7Ifx2zzQI57W9wG0PdWI24QQkllgvZQz21z65FHPUMq2WXZvwQDBuOwgXuvIE)

**Figure 6:** Graph with only frontdoor (source: image by the authors).

[![Image 43](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/CdtMjN53z6KTZDTQSRFGXlPQ7I-uSvfaEsv3_Tt7fKVQDt_g06WtoIWUAvyRrPZdQuBT-qLt2OEgI2EqPiIYnoT293ETE72XWKt5XPt7FPd_MsvDbQURlKwLG5SCNbRO4UotkM61SLBN0ncRkXLHT-A)

**Figure 7:** Graph with both the frontdoor and backdoor (source: image by the authors).

Now, if we simply hold ![Image 44: W](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2018%2011'%3E%3C/svg%3E) or any other variable like ![Image 45: W](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2018%2011'%3E%3C/svg%3E), which is on a backdoor path as constant, we will effectively close that backdoor path. Allowing us to measure the effect of treatment (![Image 46: t](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%206%2010'%3E%3C/svg%3E)) on the outcome (![Image 47: Y](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2013%2011'%3E%3C/svg%3E)).

* * *

### [**Propensity Score Matching**](#TOC-h3Propensity)

This is another strategy that proves really useful when finding out causal effects from observational data. The steps to perform Propensity Score Matching are a bit complicated, but let’s break them down into chunks. We will also use an example to understand the strategy better.

Let us suppose we are a multi-national bank, and we are trying to find out if winning a lottery causes people to invest more in stocks, illustrated in the following causal graph in **Figure 8**.

[![Image 48](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20700%20394'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/6OHLxjBsNfWz3nRLLCU0Pj5LLLPz-thkJBrDdDvpVB8335OeZgWtnGn3yDGFSJTn-D52esFoLKII_Q8K9ePZ5MquC21c0aors0tEDemvtEAoRvmCE_77lAPpBgr4Bz3WOWDwlQnnOhuFl-nifHeYrpI)

**Figure 8:** Propensity score matching (source: image by the authors).

1.  First, we find the propensity score, that is, the probability or likelihood that the individual receives a certain treatment. In the above example, this will be the probability that a certain individual wins the lottery.
2.  Match the individuals that have matching propensity scores. If we have a matching probability score of two individuals, then we match them together. Nearest neighbor matching and greedy optimal matching are some of the techniques.
3.  Verify the quality of matches. So, if two individuals having a similar chance of winning a lottery are matched, we verify the matching using statistical methods. These methods are ![Image 49: t](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%206%2010'%3E%3C/svg%3E)\-tests and standardized bias and can also be done using graphical representations.
4.  Outcome Analysis. Check how many of those matches (groups) won the lottery. In this step, we try to find the mean outcome across matches and study the trend. This gives us an estimate of the causal effect over a number of groups.

➤ The verdict?

➤ This is the toughest of the lot. Remember, causal connections are heavily dependent on counterfactual thinking, but shaping existing data and conditioning on particular parameters and variables to prove a hypothesis can be a tiresome and sometimes thankless job.

* * *

### What's next? We recommend [PyImageSearch University](https://pyimagesearch.com/pyimagesearch-university/?utm_source=blogPost&utm_medium=bottomBanner&utm_campaign=What%27s%20next%3F%20I%20recommend).

**Course information:**  
84 total classes • 114+ hours of on-demand code walkthrough videos • Last updated: February 2024  
★★★★★ 4.84 (128 Ratings) • 16,000+ Students Enrolled

**I strongly believe that if you had the right teacher you could _master_ computer vision and deep learning.**

Do you think learning computer vision and deep learning has to be time-consuming, overwhelming, and complicated? Or has to involve complex mathematics and equations? Or requires a degree in computer science?

That’s _not_ the case.

All you need to master computer vision and deep learning is for someone to explain things to you in _simple, intuitive_ terms. _And that’s exactly what I do_. My mission is to change education and how complex Artificial Intelligence topics are taught.

If you're serious about learning computer vision, your next stop should be PyImageSearch University, the most comprehensive computer vision, deep learning, and OpenCV course online today. Here you’ll learn how to _successfully_ and _confidently_ apply computer vision to your work, research, and projects. Join me in computer vision mastery.

**Inside PyImageSearch University you'll find:**

*   ✓ **84 courses** on essential computer vision, deep learning, and OpenCV topics
*   ✓ **84 Certificates** of Completion
*   ✓ **114+ hours** of on-demand video
*   ✓ **Brand new courses released _regularly_**, ensuring you can keep up with state-of-the-art techniques
*   ✓ **Pre-configured Jupyter Notebooks in Google Colab**
*   ✓ Run all code examples in your web browser — works on Windows, macOS, and Linux (no dev environment configuration required!)
*   ✓ Access to **centralized code repos for _all_ 536+ tutorials** on PyImageSearch
*   ✓ **Easy one-click downloads** for code, datasets, pre-trained models, etc.
*   ✓ **Access** on mobile, laptop, desktop, etc.

[Click here to join PyImageSearch University](https://pyimagesearch.com/pyimagesearch-university/?utm_source=blogPost&utm_medium=bottomBanner&utm_campaign=What%27s%20next%3F%20I%20recommend)

* * *

[**Summary**](#TOC-h2Summary)
-----------------------------

We realized this was quite bigger than promised. We wanted to provide a sense of the various methodologies and examples in one place so that it can be used as a reference in times of need. From the next blog onwards, we will focus on each of these segments and try to look at some examples and notebooks (Python codes) to understand causality. If you have any constructive feedback, do let us know in the comments.

* * *

### [**References**](#TOC-h3References)

*   [Causal Inference in Online Systems by Amit Sharma](http://www.amitsharma.in/talk/causal-inference-online-systems/)
*   [An Awesome Playlist for Causal Learning](https://youtube.com/playlist?list=PLT3sJRyVaw-m9YBy3KRavOYuKyXikO4f6)

* * *

### [**Citation Information**](#TOC-h3Citation)

**A. R. Gosthipaty and R. Raha.** “Tools and Methodologies for Studying Causal Effects,” _PyImageSearch_, P. Chugh, S. Huot, and K. Kidriavsteva, eds., 2023, [https://pyimg.co/3sa8x](https://pyimg.co/3sa8x)

@incollection{ARG-RR\_2023\_Causality\_Tools\_Methodologies,
  author = {Aritra Roy Gosthipaty and Ritwik Raha},
  title = {Tools and Methodologies for Studying Causal Effects},
  booktitle = {PyImageSearch},
  editor = {Puneet Chugh and Susan Huot and Kseniia Kidriavsteva},
  year = {2023},
  url = {https://pyimg.co/3sa8x},
}

* * *

![Image 50: Featured Image](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20500%20276'%3E%3C/svg%3E)

### Unleash the potential of computer vision with Roboflow - Free!

*   Step into the realm of the future by [signing up or logging into your Roboflow account](https://roboflow.com/?ref=pyimagesearch). Unlock a wealth of innovative dataset libraries and revolutionize your computer vision operations.
*   Jumpstart your journey by choosing from our broad array of datasets, or benefit from PyimageSearch’s comprehensive library, crafted to cater to a wide range of requirements.
*   Transfer your data to Roboflow in any of the 40+ compatible formats. Leverage cutting-edge model architectures for training, and deploy seamlessly across diverse platforms, including API, NVIDIA, browser, iOS, and beyond. Integrate our platform effortlessly with your applications or your favorite third-party tools.
*   Equip yourself with the ability to train a potent computer vision model in a mere afternoon. With a few images, you can import data from any source via API, annotate images using our superior cloud-hosted tool, kickstart model training with a single click, and deploy the model via a hosted API endpoint. Tailor your process by opting for a code-centric approach, leveraging our intuitive, cloud-based UI, or combining both to fit your unique needs.
*   Embark on your journey today with absolutely no credit card required. Step into the future with Roboflow.

[Join Roboflow Now](https://roboflow.com/?ref=pyimagesearch)

* * *

![Image 51](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20410%20567'%3E%3C/svg%3E)

#### Join the PyImageSearch Newsletter and Grab My FREE 17-page Resource Guide PDF

Enter your email address below to **join the PyImageSearch Newsletter** and **download my FREE 17-page Resource Guide PDF** on Computer Vision, OpenCV, and Deep Learning.