pysimmmulator


Namepysimmmulator JSON
Version 0.4.3 PyPI version JSON
download
home_pageNone
SummaryPython package for generating MMM (Marketing Mix Model) input data
upload_time2025-07-08 17:52:10
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseYEAR: 2024 COPYRIGHT HOLDER: Ryan Duecker
keywords mmm marketing media model simmmulator simulate
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img align="left" src="PySiMMMulator_logo.png" alt="logo" width="150"/>

# PySiMMMulator

[![CodeFactor](https://www.codefactor.io/repository/github/ryanaugust/pysimmmulator/badge)](https://www.codefactor.io/repository/github/ryanaugust/pysimmmulator)
[![PyPI Downloads](https://img.shields.io/pypi/dm/pysimmmulator.svg?label=PyPI%20downloads)](
https://pypi.org/project/pysimmmulator/)

PySiMMMulator is an open source Python adaption of the R-package [siMMMulator](https://github.com/facebookexperimental/siMMMulator), which allows users to generate simulated data to use in testing Marketing Mix Models (MMMs).
While this package cointains a full pipeline for data generation (configurable via .conf file) it can also be utilized in parts to generate select portions of MMM input data (ie campaign/channel spend)

## Installation

Accessable via PyPI

```bash
pip install pysimmmulator
```

## Usage

PySiMMMulator's simulator can either be run on a step-by-step basis, or can be run single-shot by passing a config file.

### Run via config

Run using this method, you'll be returned both a dataframe of for MMM input as well as the "True ROI" values for each of your channels. These true values are critical to validating your MMM model.

```python
cfg = load_config(config_path="./my_config.yaml")
sim = simmm()
mmm_input_df, channel_roi = sim.run_with_config(config=cfg)
```

### Run by stages

Alternatively you may run each of the stages independently, which allows for easier debugging and in-run adjustments based on the results of each stage. The order of the stages is reflected below **(without their inputs)**. Once you've run through every stage, results are available by calling the `sim.final_df` object (channel ROI results are stored as `sim.channel_roi`).

```python
sim = simmm()
sim.simulate_baseline()
sim.simulate_ad_spend()
sim.simulate_media()
sim.simulate_cvr()
sim.simulate_decay_returns()
sim.calculate_conversions()
sim.consolidate_dataframe()
sim.calculate_channel_roi()
sim.finalize_output()
```

### Run via CLI

A configuration file is required as input for this and should be passed as seen below. An output path can also be passed via `-o`, however when not passed the current working directory will be used.

```bash
pysimmm -i example_config.yaml -o .
```

## Development

Setting up a dev environment

```bash
python3 -m venv venv
source venv/bin/activate
pip install -e '.[dev]'
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pysimmmulator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "MMM, Marketing, Media, Model, SiMMMulator, Simulate",
    "author": null,
    "author_email": "Ryan Duecker <ryan.duecker@yahoo.com>",
    "download_url": "https://files.pythonhosted.org/packages/d8/ce/4ff0a333dc4a35730be1ad281df6e9e0f39338978d22e48aede8c5cb4676/pysimmmulator-0.4.3.tar.gz",
    "platform": null,
    "description": "<img align=\"left\" src=\"PySiMMMulator_logo.png\" alt=\"logo\" width=\"150\"/>\n\n# PySiMMMulator\n\n[![CodeFactor](https://www.codefactor.io/repository/github/ryanaugust/pysimmmulator/badge)](https://www.codefactor.io/repository/github/ryanaugust/pysimmmulator)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/pysimmmulator.svg?label=PyPI%20downloads)](\nhttps://pypi.org/project/pysimmmulator/)\n\nPySiMMMulator is an open source Python adaption of the R-package [siMMMulator](https://github.com/facebookexperimental/siMMMulator), which allows users to generate simulated data to use in testing Marketing Mix Models (MMMs).\nWhile this package cointains a full pipeline for data generation (configurable via .conf file) it can also be utilized in parts to generate select portions of MMM input data (ie campaign/channel spend)\n\n## Installation\n\nAccessable via PyPI\n\n```bash\npip install pysimmmulator\n```\n\n## Usage\n\nPySiMMMulator's simulator can either be run on a step-by-step basis, or can be run single-shot by passing a config file.\n\n### Run via config\n\nRun using this method, you'll be returned both a dataframe of for MMM input as well as the \"True ROI\" values for each of your channels. These true values are critical to validating your MMM model.\n\n```python\ncfg = load_config(config_path=\"./my_config.yaml\")\nsim = simmm()\nmmm_input_df, channel_roi = sim.run_with_config(config=cfg)\n```\n\n### Run by stages\n\nAlternatively you may run each of the stages independently, which allows for easier debugging and in-run adjustments based on the results of each stage. The order of the stages is reflected below **(without their inputs)**. Once you've run through every stage, results are available by calling the `sim.final_df` object (channel ROI results are stored as `sim.channel_roi`).\n\n```python\nsim = simmm()\nsim.simulate_baseline()\nsim.simulate_ad_spend()\nsim.simulate_media()\nsim.simulate_cvr()\nsim.simulate_decay_returns()\nsim.calculate_conversions()\nsim.consolidate_dataframe()\nsim.calculate_channel_roi()\nsim.finalize_output()\n```\n\n### Run via CLI\n\nA configuration file is required as input for this and should be passed as seen below. An output path can also be passed via `-o`, however when not passed the current working directory will be used.\n\n```bash\npysimmm -i example_config.yaml -o .\n```\n\n## Development\n\nSetting up a dev environment\n\n```bash\npython3 -m venv venv\nsource venv/bin/activate\npip install -e '.[dev]'\n```\n",
    "bugtrack_url": null,
    "license": "YEAR: 2024\n        COPYRIGHT HOLDER:  Ryan Duecker",
    "summary": "Python package for generating MMM (Marketing Mix Model) input data",
    "version": "0.4.3",
    "project_urls": null,
    "split_keywords": [
        "mmm",
        " marketing",
        " media",
        " model",
        " simmmulator",
        " simulate"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0c09a150bddfb32c9cb06ff3c1dcd76a5bffb762fa0ff3dae7db9f5ebb02eaab",
                "md5": "646a5fd596c397c282a0f4e3870efd19",
                "sha256": "5f4c7ad9984e386be795710612732c998adb9b2fbfc84e2867580b979370afba"
            },
            "downloads": -1,
            "filename": "pysimmmulator-0.4.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "646a5fd596c397c282a0f4e3870efd19",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 15644,
            "upload_time": "2025-07-08T17:52:09",
            "upload_time_iso_8601": "2025-07-08T17:52:09.838532Z",
            "url": "https://files.pythonhosted.org/packages/0c/09/a150bddfb32c9cb06ff3c1dcd76a5bffb762fa0ff3dae7db9f5ebb02eaab/pysimmmulator-0.4.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d8ce4ff0a333dc4a35730be1ad281df6e9e0f39338978d22e48aede8c5cb4676",
                "md5": "39a18874e99342a0279115fc9e3ecd31",
                "sha256": "29d2f06a647931cb2db4f71284a2bec54d75035dc57e8a338e9d664c26668071"
            },
            "downloads": -1,
            "filename": "pysimmmulator-0.4.3.tar.gz",
            "has_sig": false,
            "md5_digest": "39a18874e99342a0279115fc9e3ecd31",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 65311,
            "upload_time": "2025-07-08T17:52:10",
            "upload_time_iso_8601": "2025-07-08T17:52:10.785355Z",
            "url": "https://files.pythonhosted.org/packages/d8/ce/4ff0a333dc4a35730be1ad281df6e9e0f39338978d22e48aede8c5cb4676/pysimmmulator-0.4.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-08 17:52:10",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pysimmmulator"
}
        
Elapsed time: 0.42191s