Skip to main content

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 it directly from source:

pip install .

Coming soon to PyPI: pip install reallift


⚡ Quick Start

1. Run a Complete Geo Experiment

from reallift import run_geo_experiment

result = run_geo_experiment(
    filepath="your_data.csv",
    date_col="date",
    treatment_start_date="2025-05-01",
    n_treatment=1,
    mde=0.1
)

# Access results
print(f"Observed Lift: {result['results'][0]['synthetic']['lift_mean_abs']:.4f}")

2. Manual Geo Splitting

from reallift import find_best_geo_split

best_split = find_best_geo_split(
    filepath="historical_data.csv",
    date_col="date",
    n_treatment=2
)
print(best_split)

📖 Examples

For a deep dive into the library's capabilities, check out our demonstration notebook.


🛠️ 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


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.1.0.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

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

reallift-0.1.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for reallift-0.1.0.tar.gz
Algorithm Hash digest
SHA256 317863eaa42eb81fe670cc8502c23bc07669aa20817ff87928febd3efd69955a
MD5 82b79c2d5adf071d66dafb935cee8750
BLAKE2b-256 437db917fdafcf1368d07a3d37afe4554b6a4cdc5a1d07dc62f76176148fc3ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for reallift-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: reallift-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.0 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96aa84300f135b1171ffd1c7e730b3b01fadbffa77b5d907e310a554a61303b4
MD5 38b0e354d6358bb2073b2b768f204280
BLAKE2b-256 e340c68935f1c3b16641ee2f51f2fa3d8f247a2efd54a47da7fe850f40124543

See more details on using hashes here.

Provenance

The following attestation bundles were made for reallift-0.1.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