A curated list of awesome machine learning libraries for marketing, including media mix models, multi touch attribution, causal inference and more shakostats.com.
Star ⭐ the repo if it helps you, and feel free to contribute your own favorite resources
If you're new to the space or building a measurement stack from scratch, start with these before going deep into the longer lists below. This shortlist is meant to build intuition across incrementality, experimentation, MMM, causal inference, and Bayesian thinking.
- GeoLift - Open-source geo experimentation package from Meta.
- A Time-Based Regression Matched Markets Approach for Designing Geo Experiments - Canonical matched-markets design reference from Google.
- Trimmed Match Design for Randomized Paired Geo Experiments - Strong reference for paired geo design and iROAS estimation.
- Ghost Ads: Improving the Economics of Measuring Online Ad Effectiveness - Foundational ghost ads paper.
- How DoorDash Measures Restaurant Ad Incrementality with Ghost Ads - Practical ghost-ad implementation notes from a real production measurement workflow.
- Unified Marketing Measurement: The Power of Blending Methodologies (PDF) - Still one of the clearest blended measurement explainers.
- Media Effect Estimation with PyMC: Adstock, Saturation & Diminishing Returns - Practical walkthrough of key MMM transformations.
- Trustworthy Online Controlled Experiments - Canonical A/B testing book.
- Experiment Guide - Trustworthy Online Controlled Experiments - Free entry point for modern experimentation practice.
- Improving the Sensitivity of Online Controlled Experiments by Utilizing Pre-Experiment Data - The original CUPED paper.
- Causal Inference: The Mixtape - One of the most accessible introductions to modern causal inference and research design.
- Causal Inference for the Brave and True - Practical causal-inference guide with approachable intuition and Python examples.
- Statistical Rethinking - Strong applied Bayesian modeling foundation with a large teaching and practice community around it.
- Probabilistic Programming & Bayesian Methods for Hackers - Friendly first exposure to Bayesian thinking and probabilistic programming.
- Introduction to Algorithmic Marketing - Broad practitioner-oriented guide to applying machine learning, economics, pricing, search, recommendations, and decisioning in marketing.
A collection of open source repositories and libraries.
- ChannelAttribution
- Python and R library that uses Markov-chain approaches for channel attribution and journey analysis.
- ChannelAttribution - PyPI package for channel attribution workflows in Python.
- ChannelAttribution R package manual
- Deep Conversion Attribution
- Research implementation of deep-learning-based conversion attribution for online advertising.
- fractribution
- Marketing-Attribution-Models
- markov-chain-attribution
- mta
- pychattr
- Regression Based Attribution
- Google's regression-based attribution approach for measuring incremental channel contribution.
- shapley
- shapley-attribution-model-zhao-naive
- Bayesian Time Varying Coefficients \ (python package)
- BayesianMMM
- dammmdatagen
- Ecommerce Marketing Spend Optimization
- Machine-learning workflow for optimizing ecommerce marketing budget allocation.
- lightweight-mmm
- mamimo
- Meridian
- Google's open-source Bayesian MMM framework and successor to LightweightMMM.
- MMM Prior Elicitation
- Practical tools for prior elicitation and Bayesian MMM calibration.
- mmm-stan
- pymc-marketing
- Robyn
- Robyn \ (R Library)
- CausalImpact \ (R library)
- Geo RCT Methodology
- Open methodology notes and code for geo randomized controlled trials.
- GeoexperimentsResearch
- GeoLift
- MarketMatching
- Market matching and causal impact tooling for geo-based tests and comparisons.
- matched_markets
- Meta Geolift \ (R Library)
- Murray \ (Python Library)
- trimmed_match
- CausalImpact
- CausalLift
- Uplift-modeling package for causal inference and treatment-effect ranking.
- causalml
- CausalPy
- Causmos
- Open-source web application for CausalImpact-style analysis from Google Marketing Solutions.
- diff-diff
- Python Difference-in-Differences library with sklearn-like ergonomics, modern staggered-adoption estimators, event studies, diagnostics, and sensitivity analysis.
- dowhy
- EconML
- MatchIt
- Widely used R package for matching and preprocessing before causal estimation.
- mlsynth
- A Python library for doing policy evaluation using panel data estimators.
- pysmatch
- Python propensity score matching library with logistic, KNN, and CatBoost scoring, balance diagnostics, exhaustive matching, and reproducible workflows.
- pysyncon
- ScidesignR
- R package for scientific and experimental design work.
- scikit-uplift
- scpi
- SparseSC
- statsmodels
- SyntheticControlMethods
- TensorFlow CausalImpact
- TensorFlow Probability implementation of CausalImpact.
- tfcausalimpact
- upliftml
- amazon-denseclus
- btyd
- BTYD
- R package for Buy 'Til You Die customer-base analysis and CLV modeling.
- BTYDplus
- Extended BTYD models in R for customer-base analysis.
- CLV (python) \ - Lifetimes
- ecommercetools
- lifelines
- lifetimes
- lucius-ltv
- pysurvival
- retentioneering-tools
- rfm
- scikit-survival
- Survival Models (python) \ - Lifelines
- mr-uplift
- Open-source uplift-modeling package for multiple treatments and responses.
- Uplift Modeling with Multiple Treatments/Responses \ (Python Package)
- darts
- gluonts
- Macroeconomic Data (US) Python \ - pandas-datareader
- MLForecast
- Scalable machine-learning forecasting library from Nixtla.
- neural_prophet
- NeuralForecast
- Neural forecasting library for large-scale time series modeling.
- Nixtla
- TimeGPT and forecasting foundation-model toolkit from Nixtla.
- orbit
- pmdarima
- prophet
- sktime
- statsforecast
- stumpy
- tbats
- temporian
- tsfresh
- tslearn
Articles, papers, and other resources organized by topic.
- CausalImpact \ (paper) - An important problem in econometrics and marketing is to infer the causal impact that a designed market intervention has exerted on an outcome metric over time. In order to allocate a given budget optimally, for examp...
- Meta Geolift \ (paper)
- Supergeo Design: Generalized Matching for Geographic Experiments - Generalized matched-market design that combines geos into supergeos to improve matching quality for advertising experiments.
- Synthetic Experimental Design for a UBI pilot study - Practitioner guide to synthetic experimental design, small treated-unit inference, design choices, and allocation fairness.
- Meridian GeoX - Google Meridian documentation for geo experiment planning, design, and analysis workflows.
- Online A/B Testing \ - Trustworthy Online Controlled Experiments
- Ghost Ads: Improving the Economics of Measuring Online Ad Effectiveness - Foundational paper on ghost ads and platform-based incrementality measurement.
- How DoorDash Measures Restaurant Ad Incrementality with Ghost Ads - Implementation-oriented writeup on using ghost ads in practice.
- How Instacart Measures the True Value of Advertising: The Methodology of Ad Incrementality - Useful retail media perspective on randomized incrementality measurement.
- Improving the Sensitivity of Online Controlled Experiments by Utilizing Pre-Experiment Data - Original CUPED paper.
- Trustworthy Online Controlled Experiments - Canonical book on large-scale A/B testing practice.
- Diagnosing Sample Ratio Mismatch in A/B Testing - Practical SRM debugging guide from Microsoft.
- Media Effect Estimation with PyMC: Adstock, Saturation & Diminishing Returns - Practical walkthrough of core MMM transformations and modeling choices.
- Data-driven Buyer Personas: What They Are and How to Build Them - Practical guide to turning persona work into something more evidence-based and operational.
- ArXiv preprint arXiv:1608.00060 - Most modern supervised statistical/machine learning (ML) methods are explicitly designed to solve prediction problems very well. Achieving this goal does not imply that these methods automatically deliver good estimat...
- Arxiv preprint arxiv:1806.04823 - This paper proposes a Lasso-type estimator for a high-dimensional sparse parameter identified by a single index conditional moment restriction (CMR). In addition to this parameter, the moment function can also depend...
- Proceedings of the 33rd Conference on Neural Information Processing Systems (NeurIPS) - We consider the estimation of heterogeneous treatment effects with arbitrary machine learning methods in the presence of unobserved confounders with the aid of a valid instrument. Such settings arise in A/B tests with...
- A More Credible Approach to Parallel Trends - Honest DiD sensitivity analysis for violations of parallel trends.
- A Unified Approach to Interpreting Model Predictions - Understanding why a model makes a certain prediction can be as crucial as the prediction's accuracy in many applications. However, the highest accuracy for large modern datasets is often achieved by complex models tha...
- ArXiv Paper - We introduce Gluon Time Series (GluonTS, available at https://gluon-ts.mxnet.io), a library for deep-learning-based time series modeling. GluonTS simplifies the development of and experimentation with time series mode...
- Augmented Difference-in-Differences
- Bayesian
- bayesian methods for media mix modeling with carryover and shape effect
- Benidis et al. - Deep learning based forecasting methods have become the methods of choice in many applications of time series prediction or forecasting often outperforming other approaches. Consequently, over the last years, these me...
- CausalML: Python package for causal machine learning
- Chronos-2 report - Pretrained time series models have enabled inference-only forecasting systems that produce accurate predictions without task-specific training. However, existing approaches largely focus on univariate forecasting, lim...
- Difference-in-Differences with Multiple Time Periods - Callaway and Sant'Anna's reference paper for staggered DiD estimation.
- Estimating Ad Effectiveness Using Geo Experiments in a Time-Based Regression Framework - Two previously published papers (Vaver and Koehler, 2011, 2012) describe
a model for analyzing geo experiments. This model was designed to measure
advertising effectiveness using the rigor of a randomized experi... - Estimating Dynamic Treatment Effects in Event Studies with Heterogeneous Treatment Effects - Sun and Abraham's event-study correction for staggered treatment timing.
- External Resource - Gaussian processes are powerful non-parametric probabilistic models for stochastic functions. However, the direct implementation entails a complexity that is computationally intractable when the number of observations...
- External Resource - How to measure the incremental Return On Ad Spend (iROAS) is a fundamental problem for the online advertising industry. A standard modern tool is to run randomized geo experiments, where experimental units are non-ove...
- External Resource - We propose a generalization of the standard matched pairs design in which experimental units (often geographic regions or geos) may be combined into larger units/regions called "supergeos" in order to improve the aver...
- External Resource - We propose a generalization of the standard matched pairs design in which experimental units (often geographic regions or geos) may be combined into larger units/regions called "supergeos" in order to improve the aver...
- External Resource - Two previously published papers (Vaver and Koehler, 2011, 2012) describe
a model for analyzing geo experiments. This model was designed to measure
advertising effectiveness using the rigor of a randomized experi... - Feature relevance quantification in explainable AI: A causal problem - We discuss promising recent contributions on quantifying feature relevance using Shapley values, where we observed some confusion on which probability distribution is the right one for dropped features. We argue that...
- Feature Selection Methods for Uplift Modeling
- Forward Difference-in-Differences
- GeoX paper - Advertisers have a fundamental need to quantify the effectiveness of their advertising. For search ad spend, this information provides a basis for formulating strategies related to bidding, budgeting, and campaign des...
- L1-INF Synthetic Control
- Matched Markets paper - Although randomized controlled trials are regarded as the "gold standard" for causal inference, advertisers have been hesitant to embrace them as their primary method of experimental design and analysis due...
- Measuring Ad Effectiveness Using Geo Experiments
- Multivariate and propensity score matching software with automated balance optimization: The Matching package for R - Practical matching and balance-diagnostics reference cited in
pysmatch. - Prediction Intervals for Synthetic Control Methods
- Pretest with Caution: Event-Study Estimates after Testing for Parallel Trends - Roth on why pre-trends tests can have low power and distort inference.
- Proximal Causal Inference for SCM (Surrogates)
- Relaxed Balanced Synthetic Control
- scpi: Uncertainty Quantification for Synthetic Control Methods
- Stacked Difference-in-Differences - Wing, Freedman, and Hollingsworth on stacked DiD for staggered adoption designs.
- Synthetic Control Method (Vanilla SCM)
- Synthetic Control Method with Nonlinear Outcomes
- Synthetic Control with Multiple Outcomes (TLP and SBMF)
- Synthetic Controls for Experimental Design
- Tactics for design and inference in synthetic control studies - Applied synthetic control paper focused on identification assumptions, model fit, cross-validation, and inference choices.
- The central role of the propensity score in observational studies for causal effects - Foundational propensity score paper by Rosenbaum and Rubin.
- Treatment Effects with Instruments paper
- Two Step Synthetic Control
- Two-stage differences in differences - Gardner's two-stage DiD estimator for staggered treatment timing.
- Uncertainty Quantification in Synthetic Controls with Staggered Treatment Adoption
- Using Synthetic Controls: Feasibility, Data Requirements, and Methodological Aspects - Abadie's Journal of Economic Literature guide to when synthetic controls work, required data conditions, and methodological tradeoffs.
- xDeepFM - Combinatorial features are essential for the success of many commercial models. Manually crafting these features usually comes with high cost due to the variety, volume and velocity of raw data in web-scale systems. F...
- 15 - Synthetic Control - Beginner-friendly synthetic control tutorial with Python examples and intuition.
- 2021 Conference on Digital Experimentation @ MIT (CODE@MIT)
- Be Careful When Interpreting Predictive Models in Search of Causal Insights
- diff-diff Tutorials - Notebook collection covering basic DiD, staggered adoption, synthetic DiD, parallel trends checks, Honest DiD, power analysis, and survey-aware DiD workflows.
- Gaussian Processes: HSGP Advanced Usage
- Gaussian Processes: HSGP Reference & First Steps
- The Kernel Cookbook: Advice on Covariance functions
- Attribution modeling paper (arXiv)
- Attribution paper collection (Southampton ePrints)
- Attribution survival model paper
- Causally motivated attribution in online advertising
- Data-driven conversion attribution paper
- Shapley Value Methods for Attribution Modeling in Online Advertising - This paper re-examines the Shapley value methods for attribution analysis in the area of online advertising. As a credit allocation solution in cooperative game theory, Shapley value method directly quantifies the con...
- Shapley Value Methods for Attribution Modeling in Online Advertising (PDF)
- Attribution model comparison paper (Recercat)
- ChannelAttribution
- "Counting Your Customers" the Easy Way: An Alternative to the Pareto/NBD Model - Seminal BG/NBD reference for practical non-contractual CLV modeling.
- Counting Your Customers: Who Are They and What Will They Do Next? - Foundational customer-base-analysis paper on CLV, repeat buying, and retention behavior.
- The Gamma-Gamma Model of Monetary Value - Practical companion for modeling customer spend in CLV workflows.
- Bruce Hardie: Notes - Deep collection of CLV, retention, BG/NBD, Gamma-Gamma, and customer-base-analysis notes and worked examples.
- BTYD models overview and intuition - Peter Fader Talk
- Applications \ - Pricing
- Multi-Armed Bandits Overview
- Applications \ - Amazon Causal Marketing
- Applications \ - Application to Performance Marketing
- Applications \ - Meta Ad Placement
- Applications \ - Stitchfix Experimentation
- Tech Company Implementations \ - Alibaba
- Tech Company Implementations \ - LinkedIn
- Tech Company Implementations \ - Pinterest
- Tech Company Implementations \ - TikTok
- Tech Company Implementations \ - Youtube
- Tech Company Implementations \ - DoorDash
- Tech Company Implementations \ - Etsy
- Tech Company Implementations \ - Netflix
- Bruce Hardie - Customer analytics and CLV researcher known for probability models for customer-base analysis, retention, and valuation.
- Byron Sharp - Professor of Marketing Science and Director of the Ehrenberg-Bass Institute. Author of How Brands Grow.
- Catherine Tucker - Sloan Distinguished Professor of Management at MIT Sloan. Expert in digital marketing, privacy, and online advertising.
- Dominique Hanssens - Distinguished Research Professor of Marketing at UCLA Anderson. Known for Long-Term Impact of Marketing.
- Garrett Johnson - Associate Professor of Marketing at Boston University. Co-author of "Ghost Ads" and research on privacy/GDPR.
- Guido Imbens - Applied Econometrics Professor and Professor of Economics at Stanford Graduate School of Business. Nobel Laureate (2021) for methodological contributions to the analysis of causal relationships.
- Hema Yoganarasimhan - Quantitative marketing researcher focused on digital marketing, online advertising, experimentation, pricing, and machine learning for large-scale marketing decisions.
- Koen Pauwels - Marketing effectiveness and marketing-mix-modeling scholar focused on attribution, field experiments, ROI measurement, and long-term brand impact.
- Peter Fader - Frances and Pei-Yuan Chia Professor of Marketing at The Wharton School. Author of Customer Centricity.
- Randall Lewis - Economic Research Scientist at Netflix. Known for work on "Ghost Ads" and measuring advertising effectiveness.
- Ron Berman - Associate Professor of Marketing at The Wharton School. Focuses on online marketing, marketing analytics, and game theory.
- Stefan Wager - Associate Professor of Operations, Information & Technology at Stanford GSB. Research on causal inference and statistical learning.
- Susan Athey - The Economics of Technology Professor at Stanford Graduate School of Business. Leading researcher in the intersection of machine learning and causal inference.
- Bayesian Analysis with Python
- Book code and examples for applied Bayesian modeling in Python.
- Causal Inference for the Brave and True - Practical open-source guide to causal inference with intuitive explanations and Python examples.
- Causal Inference: The Mixtape - Accessible, example-driven introduction to causal inference methods including DiD, IV, panel designs, and research design.
- Causality - Technical causal-inference reference by Judea Pearl.
- Doing Bayesian Data Analysis
- Python port of a well-known applied Bayesian statistics text.
- Forecasting: Principles and Practice - Strong practical forecasting text for analysts who need foundational time-series intuition.
- Introduction to Algorithmic Marketing - Broad practitioner-oriented guide to advanced marketing automation, search, recommendations, pricing, promotions, and measurement.
- Market Segmentation Analysis - Book-length treatment of segmentation methods and strategy.
- Probabilistic Programming & Bayesian Methods for Hackers
- Friendly introduction to Bayesian thinking and probabilistic programming.
- Statistical Rethinking - Strong applied Bayesian modeling foundation with a large teaching and practice community around it.
- The Book of Why - Popular but useful introduction to causal thinking and causal diagrams.
- An Analyst's Guide to MMM | Robyn
- Bayesian Media Mix Modeling for Marketing Optimization
- Causal Analysis with PyMC: Answering "What If?" with the New do Operator
- Causal Sales Analytics: Are my sales incremental or cannibalistic?
- Decision Making Processes in Marketing Mix Modelling (PDF)
- How Wayfair Uses Geo Experiments to Measure Incrementality - Practical production writeup on geo unit construction, integer-optimized assignment, validation windows, and lift estimation.
- Juan Orduz's Blog - High-signal walkthroughs on MMM, Bayesian modeling, forecasting, and causal inference.
- Marketing and Metrics - Koen Pauwels on marketing effectiveness, attribution, MMM, dashboards, and return on marketing investment.
- Matheus Facure's Blog - Practical writing on causal inference and applied econometrics.
- Modelling Changes in Marketing Effectiveness Over Time
- Occam’s Razor by Avinash Kaushik - Long-running independent blog on digital analytics, measurement, experimentation, and marketing strategy.
- PyMC Labs Blog - Broader archive of Bayesian modeling, MMM, causal inference, and applied case studies.
- Python/STAN Implementation of Multiplicative Marketing Mix Model
- Recast Blog - Industry-facing writing on MMM, incrementality, and measurement systems.
- Reducing Customer Acquisition Costs: How we helped optimizing HelloFresh's marketing budget
- The Future is Modeled: A How-to Guide for Advanced Marketing Mix Models
- Unified Marketing Measurement: The Power of Blending Methodologies (PDF)
- Unified online marketing measurement - Think with Google
- Using Geographic Splitting & Optimization Techniques to Measure Marketing Performance
- A Time-Based Regression Matched Markets Approach for Designing Geo Experiments - Although randomized controlled trials are regarded as the "gold standard" for causal inference, advertisers have been hesitant to embrace them as their primary method of experimental design and analysis due...
- Ebay Hybrid Geo/User experiment - Hybrid experimental design reference for combining geographic and user-level thinking.
- Estimating Ad Effectiveness using Geo Experiments in a Time-Based Regression Framework - Two previously published papers (Vaver and Koehler, 2011, 2012) describe
a model for analyzing geo experiments. This model was designed to measure
advertising effectiveness using the rigor of a randomized experi... - Measuring Ad Effectiveness Using Geo Experiments - Advertisers have a fundamental need to quantify the effectiveness of their advertising. For search ad spend, this information provides a basis for formulating strategies related to bidding, budgeting, and campaign des...
- Share of Search as a Predictive Metric - Widely cited brand-measurement resource from Les Binet and Thinkbox.
- Switchback tests - Useful primer on experimentation under interference and network effects.
- The Modern Measurement Playbook - Google's practical measurement framework connecting MMM, attribution, and incrementality.
- Trimmed Match Design for Randomized Paired Geo Experiments - How to measure the incremental return on Ad spend (iROAS) is a fundamental problem for the online advertising industry. A standard modern tool is to run randomized geo experiments, where experimental units are non-ove...
Feel free to submit an issue or pull request with any suggestions!
This list is maintained by Shako Stats.
Connect with me on LinkedIn.