Skip to main content

Python package for generating MMM (Marketing Mix Model) input data

Project description

logo

PySiMMMulator

CodeFactor PyPI Downloads

PySiMMMulator is an open source Python adaption of the R-package 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

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.

cfg = load_config(config_path="./my_config.yaml")
sim = simmmulate()
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).

sim = simmmulate()
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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysimmmulator-0.2.4.tar.gz (64.3 kB view details)

Uploaded Source

Built Distribution

pysimmmulator-0.2.4-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file pysimmmulator-0.2.4.tar.gz.

File metadata

  • Download URL: pysimmmulator-0.2.4.tar.gz
  • Upload date:
  • Size: 64.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for pysimmmulator-0.2.4.tar.gz
Algorithm Hash digest
SHA256 30119c6ec0848de9c2d6e56a50dcc84b54cb499c792b74df949a8ffc5f8fbffe
MD5 273f815daf9938a585528fbb079ea58f
BLAKE2b-256 fb3a75de0cc93669493bef5414fd5d9d16a3e1083f358ed14757dfeddee7d88a

See more details on using hashes here.

File details

Details for the file pysimmmulator-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pysimmmulator-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f17b76e736806cb8ff86405e2ed75c078636895105809c0d4a5eaa1b59df4712
MD5 4fae01ad70ea15c28d29d29853905a20
BLAKE2b-256 79a7acbf9d60550753a128de920601a0938b8b6383eb83b5e30d1e65c231810c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page