Robyn

Robyn is an experimental, AI/ML-powered and open sourced Marketing Mix Modeling (MMM) package from Meta Marketing Science. Our mission is to democratise modeling knowledge, inspire the industry through innovation, reduce human bias in the modeling process & build a strong open source marketing science community.

https://github.com/facebookexperimental/robyn

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.2%) to scientific vocabulary

Keywords

adstocking budget-allocation cost-response-curve econometrics evolutionary-algorithm gradient-based-optimisation hyperparameter-optimization marketing-mix-modeling marketing-mix-modelling marketing-science mmm ridge-regression

Keywords from Contributors

autograd interpretability tensor projection interactive serializer cycles packaging charts network-simulation
Last synced: 6 months ago · JSON representation

Repository

Robyn is an experimental, AI/ML-powered and open sourced Marketing Mix Modeling (MMM) package from Meta Marketing Science. Our mission is to democratise modeling knowledge, inspire the industry through innovation, reduce human bias in the modeling process & build a strong open source marketing science community.

Basic Info
Statistics
  • Stars: 1,339
  • Watchers: 65
  • Forks: 407
  • Open Issues: 97
  • Releases: 33
Topics
adstocking budget-allocation cost-response-curve econometrics evolutionary-algorithm gradient-based-optimisation hyperparameter-optimization marketing-mix-modeling marketing-mix-modelling marketing-science mmm ridge-regression
Created almost 6 years ago · Last pushed 8 months ago
Metadata Files
Readme Contributing License Code of conduct

README.md

Robyn: Continuous & Semi-Automated MMM

The Open Source Marketing Mix Model Package from Meta Marketing Science

CRAN\_Status\_Badge Downloads Site Facebook CodeFactor

Introduction

  • What is Robyn?: Robyn is an experimental, semi-automated and open-sourced Marketing Mix Modeling (MMM) package from Meta Marketing Science. It uses various machine learning techniques (Ridge regression, multi-objective evolutionary algorithm for hyperparameter optimization, time-series decomposition for trend & season, gradient-based optimization for budget allocation, clustering, etc.) to define media channel efficiency and effectivity, explore adstock rates and saturation curves. It's built for granular datasets with many independent variables and therefore especially suitable for digital and direct response advertisers with rich data sources.

  • Why are we doing this?: MMM used to be a resource-intensive technique that was only affordable for "big players". As the privacy needs of the measurement landscape evolve, there's a clear trend of increasing demand for modern MMM as a privacy-safe solution. At Meta Marketing Science, our mission is to help all businesses grow by transforming marketing practices grounded in data and science. It's highly aligned with our mission to democratizing MMM and making it accessible for advertisers of all sizes. With Project Robyn, we want to contribute to the measurement landscape, inspire the industry and build a community for exchange and innovation around the future of MMM and Marketing Science in general.

Robyn is available in R and Python. For installation and usage guide see below. Please note that the current Python version is a LLM-translated Beta version and might encounter bugs.

Quick start for R

1. Installing the package

  • Install Robyn latest R package version: ```{r} ## CRAN VERSION install.packages("Robyn")

DEV VERSION

If you don't have remotes installed yet, first run: install.packages("remotes")

remotes::install_github("facebookexperimental/Robyn/R") ```

  • If it's taking too long to download, you have a slow or unstable internet connection, and have issues while installing the package, try setting options(timeout=400).

  • Robyn requires the Python library Nevergrad. If encountering Python-related error during installation, please check out the step-by-step guide as well as this issue to get more info.

  • For Windows, if you get openssl error, please see instructions here and here to install and update openssl.

2. Getting started

  • Use this demo.R script as step-by-step guide that is intended to cover most common use-cases. Test the package using simulated dataset provided in the package.

  • Visit our website to explore more details about Project Robyn.

  • Join our public group to exchange with other users and interact with team Robyn.

  • Take Meta's official Robyn blueprint course online

Quick start for Python (Beta)

The Python version of Robyn is rewritten from Robyn's R package version 3.11.1 to Python using object oriented programming principles and modular architecture for a robust solution. It was developed by utilizing various LLMs and AI workflows like Llama. As is common with any AI-based solutions, there may be potential challenges in translating code from one language to another. In this case, we anticipate that there could be some issues in the translation from R to Python. However, we believe in the power of community collaboration and open-source contribution. Therefore, we are opening this project to the community to participate and contribute. Together, we can address and resolve any issues that may arise, enhancing the functionality and efficiency of the Python version of Robyn. We look forward to your contributions and to the continuous improvement of this project.

1. Prerequisites

Installing glmnet on Windows

```bash

Open R console (run in Command Prompt/PowerShell)

R

Then in R console, install glmnet

install.packages("glmnet")

Exit R console

q() ```

Installing glmnet on macOS/Linux

```bash

Open terminal and run R

R

Then in R console, install glmnet

install.packages("glmnet")

Exit R console

q() ```

2. Setting up Python Environment

Windows

```bash

Create virtual environment

python -m venv robyn-env

Activate virtual environment

robyn-env\Scripts\activate ```

macOS/Linux

```bash

Create virtual environment

python3 -m venv robyn-env

Activate virtual environment

source robyn-env/bin/activate ```

3. Install Robyn

Choose one of the following installation methods:

```bash

Install from PyPI (recommended)

pip3 install robynpy

OR install development version from source

pip3 install -r requirements.txt ```

4. Getting Started

The python/src/robyn/tutorials directory contains tutorials for most common scenarios using the included simulated dataset.

There are two ways to run Python Robyn:

Option 1: Using tutorial1.ipynb (Recommended)

  • Provides an end-to-end flow with a one-click solution
  • Ideal for users who prefer minimal setup
  • Uses APIs from python/src/robyn/robyn.py
  • Includes feature engineering, model training, clustering, one-pager generation, and budget allocation
  • Configurations can be modified directly in the notebook

Option 2: Using tutorial1_src.ipynb (Advanced)

  • Offers more flexibility and control over individual modules
  • Designed for users who want to customize the workflow
  • Calls modules directly with parameters
  • Allows skipping specific components (clustering/one-pager plots/budget allocation)
  • Requires understanding of underlying logic

Quick start Python wrapper (Robyn API for Python beta)

The Robyn API for Python (beta), first released on Nov.22nd 2023, is a plumber-based solution that requires the installation of the Robyn R pacakge first. It serves as a workaround when the Python native version is not yet available or up-to-date. Please see the usage guide here.

License

Meta's Robyn is MIT licensed, as found in the LICENSE file.

  • Terms of Use - https://opensource.facebook.com/legal/terms
  • Privacy Policy - https://opensource.facebook.com/legal/privacy
  • Defensive Publication - https://www.tdcommons.org/dpubs_series/4627/

Contact

  • gufeng@meta.com, Gufeng Zhou, Marketing Science, Robyn creator
  • igorskokan@meta.com, Igor Skokan, Marketing Science Director, open source

Owner

  • Name: Meta Experimental
  • Login: facebookexperimental
  • Kind: organization
  • Location: Menlo Park, California

These are Meta projects that are not necessarily used in production but are being developed in the open nevertheless.

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 1,296
  • Total Committers: 39
  • Avg Commits per committer: 33.231
  • Development Distribution Score (DDS): 0.599
Past Year
  • Commits: 306
  • Committers: 15
  • Avg Commits per committer: 20.4
  • Development Distribution Score (DDS): 0.575
Top Committers
Name Email Commits
laresbernardo l****o@g****m 520
alxlyj y****e@m****m 130
Gufeng Zhou g****u@f****m 116
gufengzhou g****u@g****m 81
Leonel Sentana l****a@f****m 81
Sandeep Mane s****k@g****m 55
dependabot[bot] 4****] 47
Suma Reddy 1****7 42
yu-ya-tanaka y****a@m****m 38
Jeff Edwards j****s@g****m 26
Sinan Djevdet s****t@f****m 20
Shivkanth Bagavathy s****b@g****m 19
dhavalpatel624624 d****4@g****m 17
ebyjose e****e@o****m 13
Michelle Grushko 1****a 10
kyletgoldberg k****g@g****m 9
nuochen n****n@f****m 9
🖖 Randall Hunt🖖 r****n@f****m 9
Andrey Legayev a****y@v****m 8
Dhaval Patel f****y@f****m 8
stephensheron s****n@f****m 5
Anis 8****K 5
marcopremier m****r@m****m 5
Martin Stålberg m****1@g****m 2
Tomo t****r@g****m 2
unknown w****e@y****p 2
benshush 6****h 2
Yangshun Tay t****n@g****m 2
Ricardo Madriz r****3@g****m 2
Paul O’Shannessy p****l@o****m 2
and 9 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 383
  • Total pull requests: 397
  • Average time to close issues: 4 months
  • Average time to close pull requests: 9 days
  • Total issue authors: 229
  • Total pull request authors: 29
  • Average comments per issue: 3.08
  • Average comments per pull request: 0.41
  • Merged pull requests: 283
  • Bot issues: 0
  • Bot pull requests: 35
Past Year
  • Issues: 80
  • Pull requests: 277
  • Average time to close issues: 15 days
  • Average time to close pull requests: 4 days
  • Issue authors: 60
  • Pull request authors: 18
  • Average comments per issue: 0.43
  • Average comments per pull request: 0.28
  • Merged pull requests: 194
  • Bot issues: 0
  • Bot pull requests: 16
Top Authors
Issue Authors
  • bart-vanvlerken (14)
  • CJ2407 (8)
  • AdimDrewnik (8)
  • SeanRichterWalsh (7)
  • DongHarry-Kang (7)
  • AlessioPallotti (7)
  • apoorvabc (6)
  • ghltk (6)
  • JJohnson-DA (5)
  • laresbernardo (5)
  • caarolinagil (4)
  • NumesSanguis (4)
  • rohan1997vk (4)
  • nikomataaa (4)
  • jalo90 (4)
Pull Request Authors
  • alxlyj (100)
  • laresbernardo (71)
  • dhavalpatel624624 (44)
  • sumane81 (44)
  • sumalreddy17 (37)
  • dependabot[bot] (35)
  • Marco-Premier (9)
  • shivkanthb (9)
  • yu-ya-tanaka (6)
  • michellegrushkometa (5)
  • gufengzhou (5)
  • benshush (4)
  • brandonJiangM (2)
  • richin13 (2)
  • zpao (2)
Top Labels
Issue Labels
bug (16) how-to (10) enhancement (10) installation (6) documentation (2) nevergrad installation (1) dependencies (1) CLA Signed (1)
Pull Request Labels
CLA Signed (357) dependencies (35) bug (19) enhancement (8) javascript (8) documentation (4)

Packages

  • Total packages: 4
  • Total downloads:
    • cran 3,319 last-month
    • pypi 919 last-month
  • Total docker downloads: 2,313
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 4
    (may contain duplicates)
  • Total versions: 97
  • Total maintainers: 4
proxy.golang.org: github.com/facebookexperimental/Robyn
  • Versions: 41
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
proxy.golang.org: github.com/facebookexperimental/robyn
  • Versions: 41
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
cran.r-project.org: Robyn

Semi-Automated Marketing Mix Modeling (MMM) from Meta Marketing Science

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 4
  • Downloads: 3,319 Last month
  • Docker Downloads: 2,313
Rankings
Forks count: 0.2%
Stargazers count: 0.3%
Downloads: 7.7%
Average: 12.4%
Dependent repos count: 14.8%
Docker downloads count: 23.9%
Dependent packages count: 27.8%
Maintainers (1)
Last synced: 6 months ago
pypi.org: robynpy

Robyn: Continuous & Semi-Automated MMM. The Open Source Marketing Mix Model Package from Meta Marketing Science

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 919 Last month
Rankings
Dependent packages count: 9.4%
Average: 35.8%
Dependent repos count: 62.2%
Maintainers (3)
Last synced: 6 months ago

Dependencies

R/DESCRIPTION cran
  • R >= 4.0.0 depends
  • doParallel * imports
  • doRNG * imports
  • dplyr * imports
  • foreach * imports
  • ggplot2 * imports
  • ggridges * imports
  • glmnet * imports
  • jsonlite * imports
  • lares * imports
  • lubridate * imports
  • minpack.lm * imports
  • nloptr * imports
  • patchwork * imports
  • prophet * imports
  • rPref * imports
  • reticulate * imports
  • stringr * imports
  • tidyr * imports
  • shiny * suggests
website/package.json npm
  • babel-eslint ^10.0.3 development
  • eslint ^6.7.1 development
  • eslint-config-airbnb ^18.0.1 development
  • eslint-config-prettier ^6.7.0 development
  • eslint-plugin-header ^3.0.0 development
  • eslint-plugin-import ^2.21.2 development
  • eslint-plugin-jsx-a11y ^6.2.3 development
  • eslint-plugin-react ^7.20.0 development
  • eslint-plugin-react-hooks ^4.0.4 development
  • prettier ^2.0.2 development
  • stylelint ^13.2.1 development
  • @docusaurus/core ^2.0.0-alpha.61
  • @docusaurus/preset-classic ^2.0.0-alpha.61
  • @mdx-js/react ^1.5.8
  • clsx ^1.1.1
  • react ^16.8.4
  • react-dom ^16.8.4
  • yarn ^1.22.10
.github/workflows/website.yml actions
  • actions/checkout v1 composite
  • actions/setup-node v1 composite
  • webfactory/ssh-agent v0.5.0 composite
app/DESCRIPTION cran
  • DT * imports
  • Robyn >= 3.6.3 imports
  • corrr * imports
  • dplyr * imports
  • ggcorrplot * imports
  • ggplot2 * imports
  • lubridate * imports
  • patchwork * imports
  • scales * imports
  • shiny * imports
  • shinycssloaders * imports
  • shinyjs * imports
  • stats * imports
  • tidyr * imports
  • utils * imports
R/Docker/Dockerfile docker
  • rocker/verse 4.1.0 build
website/Dockerfile docker
  • node lts build
website/docker-compose.yml docker
website/yarn.lock npm
  • 1247 dependencies