Causal Inference Library for Lift Measurement
Project description
RealLift
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:
- Auditable Planning (Design of Experiments): Algorithmically identifies the optimal geographic clusters and projects statistical power (MDE) prior to any campaign investment.
- Causal Inference (Synthetic Control): Formulates robust counterfactuals via Convex Optimization with Intercept, ensuring behavioral alignment even across differing baseline levels.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b512fe18a0500d5cc72436aefcc27d9a5606fd4879779eaa6bf34b332b19711a
|
|
| MD5 |
6530d37e1cf7672afeb8fb979896e72a
|
|
| BLAKE2b-256 |
874d62f251968406b62b67e4fa602465e09c297ea2032ff67e35407b9aa1bc2e
|
Provenance
The following attestation bundles were made for reallift-0.2.0.tar.gz:
Publisher:
publish.yml on RobertoJuniorWXYZ/RealLift
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reallift-0.2.0.tar.gz -
Subject digest:
b512fe18a0500d5cc72436aefcc27d9a5606fd4879779eaa6bf34b332b19711a - Sigstore transparency entry: 1240187303
- Sigstore integration time:
-
Permalink:
RobertoJuniorWXYZ/RealLift@6bfa754f0d867e063fbab824e5510e0a5f468cbb -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/RobertoJuniorWXYZ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6bfa754f0d867e063fbab824e5510e0a5f468cbb -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e2d334caa587475278065100d7ed29dfb8386e1b57e9d38f1a0470f7112f0d0
|
|
| MD5 |
0b8b4c37d7ec3275f8d03b51e71b5e34
|
|
| BLAKE2b-256 |
bcedd4ac2ce898805c5bd76061174a568bc066100a81cfcb42bb7cb6ffd5a0f0
|
Provenance
The following attestation bundles were made for reallift-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on RobertoJuniorWXYZ/RealLift
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reallift-0.2.0-py3-none-any.whl -
Subject digest:
8e2d334caa587475278065100d7ed29dfb8386e1b57e9d38f1a0470f7112f0d0 - Sigstore transparency entry: 1240187353
- Sigstore integration time:
-
Permalink:
RobertoJuniorWXYZ/RealLift@6bfa754f0d867e063fbab824e5510e0a5f468cbb -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/RobertoJuniorWXYZ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6bfa754f0d867e063fbab824e5510e0a5f468cbb -
Trigger Event:
push
-
Statement type: