Causal Inference and Why It Matters for Data Scientists
Published on
One of the things that stuck with me the most from our interview with Caio Gomes, the CAIO of Magalu, on the IA Sob Controle podcast, was the emphasis he put on the importance of Causal Inference for Data Scientists and how rare it is to find someone who really knows the subject. That stayed in my head and I went to read more.
Put very directly, the idea of Causal Inference is to try to understand CAUSE and EFFECT relationships in the data, going beyond “correlation”.
You know the classic phrase “correlation does not imply causation”? Right! Just because ice cream sales and drowning cases go up together in the summer doesn’t mean one causes the other (the heat is the real culprit here, the famous “confounding factor”).
Knowing causal inference well is the difference between just saying “when X happens, Y also tends to happen”, and going further with: “If we do X, what will the causal impact on Y be?”.
Think about questions like:
- Did our marketing campaign increase sales, or was it some other factor (e.g., seasonality, a competitor)?
- Did changing the button in the app cause an increase in conversion, or were the users who saw it already more engaged?
On top of that, Machine Learning models are great at making predictions like “Based on the history, the probability of churn is X%”, but causal inference can help define actions to reduce churn and measure the real ROI of initiatives, like: “Investing X in this feature brought Y in causal return”.
In other words, it seeks to isolate the effect of a specific variable on another, trying to control for or mitigate the effects of confounding factors.
To apply this, there are several techniques (besides the famous A/B tests, the most common way in digital products), which try to simulate a controlled experiment:
- Difference-in-Differences (DiD): compares the evolution in the treatment group vs. the control group.
- Regression Discontinuity Design (RDD): useful for treatments based on a threshold.
- Instrumental Variables (IV): uses a third variable (called an instrument) that affects the treatment but not the outcome directly, except through the treatment.
- Propensity Score Matching (PSM): tries to create “similar” treatment and control groups based on their characteristics.
And of course, the Causal AI field is gaining a lot of traction, trying to integrate causal inference directly into ML models.
Of course, it doesn’t look (and isn’t) like a trivial path, and it will require a good understanding of the company’s business problem, solid knowledge of statistics, quality data (GIGO 😉), but the gain in terms of insights and better-grounded decisions can be huge.
I really enjoyed reading more about the topic (which I honestly only knew by name), and it seemed like a real differentiator for any Data Scientist who wants to go beyond “what’s going to happen”, and start answering “what happens IF…”.
Oh, and for those who want to listen to the full conversation with Caio Gomes, here’s the link to the interview. 😉
