Skip to main content

Causal Inference Library for Lift Measurement

Project description

RealLift

RealLift Logo

Causal Inference Framework for Geo Experiments & Marketing Science

RealLift is an advanced Python library engineered to measure the true incremental impact (Lift) of marketing interventions through rigorous Causal Inference, Synthetic Control methodologies, and Robust Significance Testing.


Framework Pillars

RealLift is built upon three layers of defense against noise and volatility:

  1. Auditable Planning (Design of Experiments): Algorithmically identifies the optimal geographic clusters and projects statistical power (MDE) prior to any campaign investment.
  2. Causal Inference (Synthetic Control): Formulates robust counterfactuals via Convex Optimization with Intercept, ensuring behavioral alignment even across differing baseline levels.
  3. Confidence Validation (Placebo & Significance): Defends analytical conclusions through permutation tests based on the MSPE Ratio and non-parametric Bootstrap confidence intervals.

Installation

pip install reallift

Quick Start Guide

1. Planning (Pre-Test Phase)

Use the DoE pipeline to project the duration strictly necessary to capture a target Minimum Detectable Effect (MDE).

from reallift.pipelines import design_of_experiments

# Project requirements and identify optimal clusters
doe_result = design_of_experiments(
    filepath="historical_data.csv",
    date_col="date",
    pct_treatment=0.10,      # Test a scenario with 10% of the market treated
    mde=0.015,               # Target 1.5% incremental lift
    experiment_days=[21, 60] # Evaluation window between 21 and 60 days
)

2. Impact Analysis (Post-Test Phase)

Execute the complete analytical pipeline after or during the intervention.

from reallift.pipelines import run_geo_experiment

# Complete end-to-end analytical pipeline
result = run_geo_experiment(
    filepath="experiment_data.csv",
    date_col="date",
    treatment_start_date="2025-05-01",
    doe=doe_result,          # Inherit validated clusters from DoE
    scenario=0               # Use the 10% treatment scenario
)

# Extract total documented incremental impact
print(f"Total Cumulative Lift: {result['results'][0]['synthetic']['lift_total']:.2f}")

Technical Differentiators

  • SER Engine (Synthetic Error Ratio): Proactive volatility filtering during the design phase to eliminate "Zombie Controls."
  • Convex Intercept: Intelligent baseline shift absorption that preserves the interpretability of synthetic weights ($\sum w = 1$).
  • MSPE Ratio Strategy: A placebo methodology resilient to the natural variance of high-frequency volatile markets.
  • Operational Freedom: Aggressive donor curatorship via ElasticNet that often frees up to 50% of geographic regions for other commercial operations.

Systems & Dependencies

  • Mathematics: cvxpy, scipy, numpy
  • Data Engineering: pandas, scikit-learn
  • Visualization: matplotlib

Developed by Roberto Junior.

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

reallift-0.2.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

reallift-0.2.0-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

Details for the file reallift-0.2.0.tar.gz.

File metadata

  • Download URL: reallift-0.2.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for reallift-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b512fe18a0500d5cc72436aefcc27d9a5606fd4879779eaa6bf34b332b19711a
MD5 6530d37e1cf7672afeb8fb979896e72a
BLAKE2b-256 874d62f251968406b62b67e4fa602465e09c297ea2032ff67e35407b9aa1bc2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for reallift-0.2.0.tar.gz:

Publisher: publish.yml on RobertoJuniorWXYZ/RealLift

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reallift-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: reallift-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 38.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for reallift-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e2d334caa587475278065100d7ed29dfb8386e1b57e9d38f1a0470f7112f0d0
MD5 0b8b4c37d7ec3275f8d03b51e71b5e34
BLAKE2b-256 bcedd4ac2ce898805c5bd76061174a568bc066100a81cfcb42bb7cb6ffd5a0f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for reallift-0.2.0-py3-none-any.whl:

Publisher: publish.yml on RobertoJuniorWXYZ/RealLift

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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