Causal Inference and Discovery in Python: Unlock the secrets of modern causal machine learning with DoWhy, EconML, PyTorch and more

Оглавление⌄
Preface xixPart 1: Causality – an Introduction1Causality – Hey, We Have Machine Learning, So Why Even Bother?....3A brief history of causality....4Why causality? Ask babies!....5Interacting with the world....5Confounding – relationships that are not real....6How not to lose money… andhuman lives....9A marketer’s dilemma....9Let’s play doctor!....10Associations in the wild....12Wrapping it up....12References....122Judea Pearl and the Ladder of Causation....15From associations to logic and imagination – the Ladderof Causation....15Associations....18Let’s practice!....20What are interventions?....23Changing the world....24Correlation and causation....26What are counterfactuals?....28Let’s get weird (but formal)!....28The fundamental problem of causal inference....30Computing counterfactuals....30Time to code!....32Extra – is all machine learning causally the same?....33Causality and reinforcement learning....33Causality and semi-supervised and unsupervised learning....34Wrapping it up....34References....353Regression, Observations, and Interventions....37Starting simple – observational dataand linear regression....37Linear regression....37p-values and statistical significance....41Geometric interpretation of linear regression....42Reversing the order....42Should we always control for allavailable covariates?....44Navigating the maze....45If you don’t know where you’re going, youmight end up somewhere else....45Get involved!....48To control or not to control?....48Regression and structural models....49SCMs....49Linear regression versus SCMs....49Finding the link....49Regression and causal effects....51Wrapping it up....53References....534Graphical Models....55Graphs, graphs, graphs....55Types of graphs....56Graph representations....58Graphs in Python....60What is a graphical model?....63DAG your pardon? Directed acyclicgraphs in the causal wonderland....64Definitions of causality....64DAGs and causality....65Let’s get formal!....65Limitations of DAGs....66Sources of causal graphs in thereal world....66Causal discovery....67Expert knowledge....67Combining causal discovery and expertknowledge....67Extra – is there causalitybeyond DAGs?....67Dynamical systems....67Cyclic SCMs....68Wrapping it up....68References....695Forks, Chains, and Immoralities....71Graphs and distributions and how tomap between them....71How to talk about independence....72Choosing the right direction....73Conditions and assumptions....74Chains, forks, and colliders or…immoralities....78A chain of events....78Chains....79Forks....80Colliders, immoralities, or v-structures....82Ambiguous cases....84Forks, chains, colliders,and regression....85Generating the chain dataset....87Generating the fork dataset....88Generating the collider dataset....89Fitting the regression models....90Wrapping it up....93References....93Part 2: Causal Inference6Nodes, Edges, and Statistical (In)dependence....97You’re gonna keep ‘em d-separated....98Practice makes perfect – d-separation....99Estimand first!....102We live in a world of estimators....102So, what is an estimand?....102The back-door criterion....104What is the back-door criterion?....105Back-door and equivalent estimands....105The front-door criterion....107Can GPS lead us astray?....108London cabbies and the magic pebble....109Opening the front door....110Three simple steps toward the front door....111Front-door in practice....112Are there other criteria out there?Let’s do-calculus!....118The three rules of do-calculus....119Instrumental variables....120Wrapping it up....122Answer....122References....1237The Four-Step Process of Causal Inference....125Introduction to DoWhyand EconML....126Python causal ecosystem....126Why DoWhy?....128Oui, mon ami, but what is DoWhy?....128How about EconML?....129Step 1 – modeling the problem....130Creating the graph....130Building a CausalModel object....132Step 2 – identifying the estimand(s)....133Step 3 – obtaining estimates....134Step 4 – where’s my validation set?Refutation tests....135How to validate causal models....135Introduction to refutation tests....137Full example....139Step 1 – encode the assumptions....140Step 2 – getting the estimand....142Step 3 – estimate!....142Step 4 – refute them!....144Wrapping it up....149References....1498Causal Models – Assumptions and Challenges....151I am the king of the world! But am I?....152In between....152Identifiability....153Lack of causal graphs....153Not enough data....154Unverifiable assumptions....156An elephant in the room – hopefulor hopeless?....156Let’s eat the elephant....156Positivity....157Exchangeability....161Exchangeable subjects....161Exchangeability versus confounding....161…and more....162Modularity....162SUTVA....164Consistency....164Call me names – spuriousrelationships in the wild....165Names, names, names....165Should I ask you or someone who’s not here?....166DAG them!....166More selection bias....168Wrapping it up....169References....1709Causal Inference and Machine Learning – from Matchingto Meta-Learners....173The basics I – matching....174Types of matching....174Treatment effects – ATE versus ATT/ATC....175Matching estimators....176Implementing matching....178The basics II – propensity scores....183Matching in the wild....183Reducing the dimensionality withpropensity scores....185Propensity score matching (PSM)....185Inverse probability weighting (IPW)....186Many faces of propensity scores....186Formalizing IPW....187Implementing IPW....187IPW – practical considerations....188S-Learner – the Lone Ranger....188The devil’s in the detail....189Mom, Dad, meet CATE....190Jokes aside, say hi to theheterogeneous crowd....190Waving the assumptions flag....192You’re the only one – modeling withS-Learner....192Small data....198S-Learner’s vulnerabilities....199T-Learner – together we can do more....200Forcing the split on treatment....200T-Learner in four steps and a formula....201Implementing T-Learner....202X-Learner – a step further....204Squeezing the lemon....204Reconstructing the X-Learner....205X-Learner – an alternative formulation....207Implementing X-Learner....208Wrapping it up....212References....21310Causal Inference and Machine Learning – Advanced Estimators,Experiments, Evaluations, and More....215Doubly robust methods – let’s getmore!....216Do we need another thing?....216Doubly robust is not equal to bulletproof…....218…but it can bring a lot of value....218The secret doubly robust sauce....218Doubly robust estimator versus assumptions....220DR-Learner – crossing the chasm....220DR-Learners – more options....224Targeted maximum likelihood estimator....224If machine learning is cool, howabout double machine learning?....227Why DML and what’s so double about it?....228DML with DoWhy and EconML....231Hyperparameter tuning with DoWhy andEconML....234Is DML a golden bullet?....239Doubly robust versus DML....240What’s in it for me?....241Causal Forests and more....242Causal trees....242Forests overflow....242Advantages of Causal Forests....242Causal Forest with DoWhy and EconML....243Heterogeneous treatmenteffects with experimental data – theuplift odyssey....245The data....245Choosing the framework....251We don’t know half of the story....251Kevin’s challenge....252Opening the toolbox....253Uplift models and performance....257Other metrics for continuous outcomes withmultiple treatments....262Confidence intervals....263Kevin’s challenge’s winning submission....264When should we use CATE estimators forexperimental data?....264Model selection – a simplified guide....265Extra – counterfactual explanations....267Bad faith or tech that does not know?....267Wrapping it up....268References....26911Causal Inference and Machine Learning – Deep Learning,NLP, and Beyond....273Going deeper – deep learning forheterogeneous treatment effects....274CATE goes deeper....274SNet....276Transformers and causal inference....284The theory of meaning in five paragraphs....285Making computers understand language....285From philosophy to Python code....286LLMs and causality....286The three scenarios....288CausalBert....292Causality and time series – when aneconometrician goes Bayesian....297Quasi-experiments....297Twitter acquisition and ourgoogling patterns....298The logic of synthetic controls....298A visual introduction to the logicof synthetic controls....300Starting with the data....302Synthetic controls in code....303Challenges....308Wrapping it up....309References....309Part 3: Causal Discovery12Can I Have a Causal Graph, Please?....315Sources of causal knowledge....316You and I, oversaturated....316The power of a surprise....317Scientific insights....317The logic of science....318Hypotheses are a species....318One logic, many ways....319Controlled experiments....319Randomized controlled trials (RCTs)....320From experiments to graphs....321Simulations....321Personal experience and domainknowledge....321Personal experiences....322Domain knowledge....323Causal structure learning....323Wrapping it up....324References....32413Causal Discovery and Machine Learning – from Assumptions toApplications....327Causal discovery – assumptionsrefresher....328Gearing up....328Always trying to be faithful…....328…but it’s difficult sometimes....328Minimalism is a virtue....329The four (and a half) families....329The four streams....329Introduction to gCastle....331Hello, gCastle!....331Synthetic data in gCastle....331Fitting your first causal discovery model....336Visualizing the model....336Model evaluation metrics....338Constraint-based causal discovery....341Constraints and independence....341Leveraging the independence structure torecover the graph....342PC algorithm – hidden challenges....345PC algorithm for categorical data....346Score-based causal discovery....347Tabula rasa – starting fresh....347GES – scoring....347GES in gCastle....348Functional causal discovery....349The blessings of asymmetry....349ANM model....350Assessing independence....353LiNGAM time....355Gradient-based causal discovery....360What exactly is so gradient about you?....360Shed no tears....362GOLEMs don’t cry....363The comparison....363Encoding expert knowledge....366What is expert knowledge?....366Expert knowledge in gCastle....366Wrapping it up....368References....36814Causal Discovery and Machine Learning – Advanced DeepLearning and Beyond....371Advanced causal discoverywith deep learning....372From generative models to causality....372Looking back to learn who you are....373DECI’s internal building blocks....373DECI in code....375DECI is end-to-end....387Causal discovery under hiddenconfounding....387The FCI algorithm....388Other approaches to confounded data....392Extra – going beyond observations....393ENCO....393ABCI....393Causal discovery – real-worldapplications, challenges, andopen problems....394Wrapping it up!....395References....39615Epilogue....399What we’ve learned in this book....399Five steps to get the best out of yourcausal project....400Starting with a question....400Obtaining expert knowledge....401Generating hypothetical graph(s)....401Check identifiability....402Falsifying hypotheses....402Causality and business....403How causal doers go from vision toimplementation....403Toward the future of causal ML....405Where are we now and whereare we heading?....406Causal benchmarks....406Causal data fusion....407Intervening agents....407Causal structure learning....408Imitation learning....408Learning causality....409Let’s stay in touch....410Wrapping it up....411References....411Index....413Other Books You May Enjoy....426
Описание
В этом материале разберём тему: causal.
Learning causality can be challenging, but it offers distinct advantages that elude a purely statistical mindset. Causal methods present unique challenges compared to traditional machine learning and statistics. 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.
Step-by-step, you’ll discover Python causal ecosystem and harness the power of cutting-edge algorithms. Next, you’ll dive into the world of causal effect estimation, consistently progressing towards modern machine learning methods. 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.
What you will learnMaster 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
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. Who this book is forThis 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’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.
На этом основные моменты по теме закрыты.
Поделиться
Частые вопросы
Можно ли скачать «Causal Inference and Discovery in Python: Unlock the secrets of modern causal machine learning with DoWhy, EconML, PyTorch and more» бесплатно?
Да, «Causal Inference and Discovery in Python: Unlock the secrets of modern causal machine learning with DoWhy, EconML, PyTorch and more» доступна для бесплатного скачивания на нашем сайте в формате PDF. Ссылка на файл находится на этой странице.
В каком формате и какого размера файл?
Книга предоставляется в формате PDF, размер файла 11,0 МБ.
Кто автор и когда вышла книга?
автор — Molak Aleksander, издательство Packt Publishing Limited, год выпуска 2023, 456 страниц.
О чём книга «Causal Inference and Discovery in Python: Unlock the secrets of modern causal machine learning with DoWhy, EconML, PyTorch and more»?
Causal methods present unique challenges compared to traditional machine learning and statistics.