Skip to main content

Exploratory data analysis and transformation toolkit for Marketing Mix Modeling (MMM)

Project description

🦉 OwlMix

Python License Docs PyPI version

OwlMix is a Python library for automated exploratory data analysis (EDA), designed for time-series and marketing mix modeling (MMM) workflows. OwlMix helps you quickly understand your data, identify trends, and prepare for modeling.

Features

  • Automated EDA report generation (HTML/JSON)
  • Time series lag and correlation analysis
  • Variable relationship and distribution insights
  • Causality and trend detection
  • Easy-to-use API

Quick Start

import pandas as pd
from owlmix.reporting import ReportBuilder, ReportHTMLRenderer

csv_file = "path/to/your/csv/file.csv"

df = pd.read_csv(csv_file)
report_builder = ReportBuilder(
    df=df, 
    target_col="kpi", 
    date_col="date"
)

# Update the config, if needed
report_builder.config.update_config(
    acf_pacf={
        "columns": ["kpi"],
        "n_lags": 5
    },
    vif={
        "features": ["tv_spend", "digital_spend", "radio_spend"]
    },
    correlation={
        "columns": ["kpi", "tv_spend"],
        "n_lags": 8,
        "precision": 5
    },
    box_plot={
        "columns": ["kpi", "tv_spend", "digital_spend", "radio_spend", "tv_grp", "digital_imp"],
        "n_plot_per_row": 3,
        "method": "zscore",
        "threshold": 1.5  # default is 3 for method "zscore" and 1.5 for method "iqr"
    },
    ccf={
        "feature_columns": ['tv_spend'],
        "max_lag": 3
    },
    # update the other configs
)
report_builder.add_all_sections(verbose=True)
report = report_builder.build()
report_builder.save("result.json")

renderer = ReportHTMLRenderer()
html_str = renderer.render_from_json("result.json")
renderer.save_html("report.html")

Load Config from Dict, YAML, or JSON

You can load report section config using a Python dictionary, a YAML file, or a JSON file.

from owlmix.reporting import ReportBuilder

report_builder = ReportBuilder(
    df=df,
    target_col="kpi",
    date_col="date"
)

# 1) From Python dict
config_dict = {
    "acf_pacf": {
        "columns": ["kpi"],
        "n_lags": 10,
        "precision": 2
    },
    "ccf": {
        "feature_columns": ["tv_spend", "digital_spend"],
        "max_lag": 3
    }
}
report_builder.config.update_config_from_dict(config_dict, strict=True)

# 2) From YAML file
report_builder.config.update_config_from_yaml("report_config.yaml", strict=True)

# 3) From JSON file
report_builder.config.update_config_from_json("report_config.json", strict=True)

Notes:

  • strict=True raises an error if unknown section keys are present.
  • Supported top-level section keys include: acf_pacf, vif, correlation, causality, box_plot, ccf, response_curve, response_summary, dist_numeric, and time_series.
  • YAML/JSON must have a dictionary at the top level, and each section value must also be a dictionary.

Installation

pip install owl-mix

Documentation

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

owl_mix-1.0.1.tar.gz (83.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

owl_mix-1.0.1-py3-none-any.whl (131.5 kB view details)

Uploaded Python 3

File details

Details for the file owl_mix-1.0.1.tar.gz.

File metadata

  • Download URL: owl_mix-1.0.1.tar.gz
  • Upload date:
  • Size: 83.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for owl_mix-1.0.1.tar.gz
Algorithm Hash digest
SHA256 17712abac7d0a33d6b16c8d580810e84b8fbf889a50902aa47799e12f9767475
MD5 219c9b18525af721a26f284aa874fb2f
BLAKE2b-256 ee7554c2144b4bf83923ad0bcb094c63032f842af56eefb29fff93d55aaee5d7

See more details on using hashes here.

File details

Details for the file owl_mix-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: owl_mix-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 131.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for owl_mix-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb175fc9442522d980f5877d6aac8e372b513ab2e8fd3c281a2946e82864a6e1
MD5 daa3acb6ae4923d0090ff71edbba60d9
BLAKE2b-256 1548105049cb2307c22e555d9e560302c560697bdde9e167274f912f4e40fc61

See more details on using hashes here.

Supported by

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