Causal Inference Library for Lift Measurement
Project description
🚀 RealLift
Causal Inference Library for Lift Measurement
RealLift is a powerful Python library designed to help data scientists and marketers measure the true impact of their interventions (treatments) using advanced causal inference techniques, such as GeoLift, Synthetic Control, and Placebo Testing.
✨ Features
- 🎯 Geo-Splitting: Automatically find the best treatment and control groups based on historical correlation.
- 📈 Synthetic Control: Build counterfactuals using a weighted combination of control regions.
- 🧪 Significance Testing: Robust bootstrap-based confidence intervals and p-values.
- 🛡️ Placebo Tests: Validate your model's reliability by running "fake" experiments on control groups.
- ⏳ Duration Estimation: Calculate the necessary experiment duration based on MDE (Minimum Detectable Effect).
- 📊 Professional Visualizations: Built-in plotting for experiment results and validation.
🚀 Installation
Install the stable version via PyPI:
pip install reallift
Or install the latest development version directly from GitHub:
pip install git+https://github.com/RobertoJuniorWXYZ/RealLift.git
⚡ Quick Start
1. Requirements & Design
Before starting an experiment, find the best clusters and estimate the required duration for a target MDE.
from reallift import run_geo_requirements
# Find best geo clusters and estimate duration
summary = run_geo_requirements(
filepath="historical_data.csv",
date_col="date",
n_treatment=1,
mde=0.015,
max_days=60
)
2. Run a Complete Geo Experiment
Execute the full pipeline including validation, duration estimation, synthetic control, and placebo tests.
from reallift import run_geo_experiment
# Run full experiment pipeline
result = run_geo_experiment(
filepath="your_data.csv",
date_col="date",
treatment_start_date="2025-05-01",
n_treatment=1,
mde=0.02
)
# Access results
print(f"Observed Lift: {result['results'][0]['synthetic']['lift_mean_abs']:.4f}")
📖 Examples
For a deep dive into the library's capabilities, check out our demonstration notebooks in the examples/geotests/ directory.
🛠️ Requirements
- Python 3.8+
- Pandas, Numpy, Scikit-Learn, Scipy, Matplotlib, CVXPY
📄 License
MIT License. See LICENSE for details.
Developed with ❤️ 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.1.1.tar.gz.
File metadata
- Download URL: reallift-0.1.1.tar.gz
- Upload date:
- Size: 3.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab4472dae3dafaea48a905716db32996f6ff2e5907831576ab15e4261a466b1f
|
|
| MD5 |
3051dfc6d563684efa2ab020a376f9c6
|
|
| BLAKE2b-256 |
3174ccf3e61436942f159e16131dfa6e6a6fd2ba8b429bafb5e98d83bf229a3e
|
Provenance
The following attestation bundles were made for reallift-0.1.1.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.1.1.tar.gz -
Subject digest:
ab4472dae3dafaea48a905716db32996f6ff2e5907831576ab15e4261a466b1f - Sigstore transparency entry: 1190935971
- Sigstore integration time:
-
Permalink:
RobertoJuniorWXYZ/RealLift@0d3d18b0dcd6abfd2e43243fad6710b885817c45 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/RobertoJuniorWXYZ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d3d18b0dcd6abfd2e43243fad6710b885817c45 -
Trigger Event:
push
-
Statement type:
File details
Details for the file reallift-0.1.1-py3-none-any.whl.
File metadata
- Download URL: reallift-0.1.1-py3-none-any.whl
- Upload date:
- Size: 22.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 |
25b5f017c7879f035c966dce0d65e54bf889e82a4007ca1c56ccafd659456acb
|
|
| MD5 |
fdfbf0f5463d872ed8801436d96e0cf5
|
|
| BLAKE2b-256 |
989409630b38d2270a09874a885dd6e9220bd5076223bfff4af9e1f125b44b8a
|
Provenance
The following attestation bundles were made for reallift-0.1.1-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.1.1-py3-none-any.whl -
Subject digest:
25b5f017c7879f035c966dce0d65e54bf889e82a4007ca1c56ccafd659456acb - Sigstore transparency entry: 1190935980
- Sigstore integration time:
-
Permalink:
RobertoJuniorWXYZ/RealLift@0d3d18b0dcd6abfd2e43243fad6710b885817c45 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/RobertoJuniorWXYZ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d3d18b0dcd6abfd2e43243fad6710b885817c45 -
Trigger Event:
push
-
Statement type: