# Causal-Inference-and-Discovery-in-Python **Repository Path**: jgongzh/Causal-Inference-and-Discovery-in-Python ## Basic Information - **Project Name**: Causal-Inference-and-Discovery-in-Python - **Description**: No description available - **Primary Language**: Python - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-11 - **Last Updated**: 2026-03-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README --- ## Join Our Newsletters 📬 ### DataPro *The future of AI is unfolding. Don’t fall behind.*
Stay ahead with [**DataPro**](https://landing.packtpub.com/subscribe-datapronewsletter/?link_from_packtlink=yes), the free weekly newsletter for data scientists, AI/ML researchers, and data engineers. From trending tools like **PyTorch**, **scikit-learn**, **XGBoost**, and **BentoML** to hands-on insights on **database optimization** and real-world **ML workflows**, you’ll get what matters, fast. > Stay sharp with [DataPro](https://landing.packtpub.com/subscribe-datapronewsletter/?link_from_packtlink=yes). Join **115K+ data professionals** who never miss a beat. --- ### BIPro *Business runs on data. Make sure yours tells the right story.* [**BIPro**](https://landing.packtpub.com/subscribe-bipro-newsletter/?link_from_packtlink=yes) is your free weekly newsletter for BI professionals, analysts, and data leaders. Get practical tips on **dashboarding**, **data visualization**, and **analytics strategy** with tools like **Power BI**, **Tableau**, **Looker**, **SQL**, and **dbt**. > Get smarter with [BIPro](https://landing.packtpub.com/subscribe-bipro-newsletter/?link_from_packtlink=yes). Trusted by **35K+ BI professionals**, see what you’re missing. # Causal Inference and Discovery in Python
This is the code repository for [Causal Inference and Discovery in Python](https://www.packtpub.com/product/causal-inference-and-discovery-in-python/9781804612989), published by Packt.
**Unlock the secrets of modern causal machine learning with DoWhy, EconML, PyTorch and more**
## What is this book about?
Causal methods present unique challenges compared to traditional machine learning and statistics. Learning causality can be challenging, but it offers distinct advantages that elude a purely statistical mindset. Causal Inference and Discovery in Python helps you unlock the potential of causality.
You’ll start with basic motivations behind causal thinking and a comprehensive introduction to Pearlian causal concepts, such as structural causal models, interventions, counterfactuals, and more. Each concept is accompanied by a theoretical explanation and a set of practical exercises with Python code.
Next, you’ll dive into the world of causal effect estimation, consistently progressing towards modern machine learning methods. Step-by-step, you’ll discover Python causal ecosystem and harness the power of cutting-edge algorithms. You’ll further explore the mechanics of how “causes leave traces” and compare the main families of causal discovery algorithms.
The final chapter gives you a broad outlook into the future of causal AI where we examine challenges and opportunities and provide you with a comprehensive list of resources to learn more.
This book covers the following exciting features:
* Master the fundamental concepts of causal inference
* Decipher the mysteries of structural causal models
* Unleash the power of the 4-step causal inference process in Python
* Explore advanced uplift modeling techniques
* Unlock the secrets of modern causal discovery using Python
* Use causal inference for social impact and community benefit
If you feel this book is for you, get your [copy](https://www.amazon.com/Causal-Inference-Discovery-Python-learning/dp/1804612987/ref=sr_1_1?keywords=Causal+Inference+and+Discovery+in+Python&s=books&sr=1-1) today!
## Instructions and Navigations
All of the code is organized into folders.
The code will look like the following:
```
preds = causal_bert.inference(
texts=df['text'],
confounds=df['has_photo'],
)[0]
```
**Following is what you need for this book:**
This book is for machine learning engineers, data scientists, and machine learning researchers looking to extend their data science toolkit and explore causal machine learning. It will also help developers familiar with causality who have worked in another technology and want to switch to Python, and data scientists with a history of working with traditional causality who want to learn causal machine learning. It’s also a must-read for tech-savvy entrepreneurs looking to build a competitive edge for their products and go beyond the limitations of traditional machine learning.
With the following software and hardware list you can run all code files present in the book (Chapter 1-15).
### Software and Hardware List
| Chapter | Software required | OS required |
| -------- | -------------------------------------------------------------------------------------| -----------------------------------|
| 1-15 | Python 3.9 | Windows macOS, or Linux |
| 1-15 | DoWhy 0.8 | Windows, macOS, or Linux |
| 1-15 | EconML 0.12.0 | Windows, macOS, or Linux |
| 1-15 | CATENets 0.2.3 | Windows, macOS, or Linux |
| 1-15 | gCastle 1.0.3 | Windows, macOS, or Linux |
| 1-15 | Causica 0.2.0 | Windows, macOS, or Linux |
| 1-15 | Causal-learn 0.1.3.3 | Windows, macOS, or Linux |
| 1-15 | Transformers 4.24.0 | Windows, macOS, or Linux |
## Join our Discord server