Skip to main content

Causal Impact of an intervention integrated with control group selection

Project description

pycausalmatch

pycausalmatch is a Python library for causal inference integrated with the process of selecting suitable control groups

Description

The functionality that has been implemented so far is essentially a Python translation of the features available in the R library: https://github.com/klarsen1/MarketMatching , which combines 2 packages: https://github.com/dafiti/causalimpact and https://github.com/DynamicTimeWarping/dtw-python

The DTW package is used for selection of most suitable control groups.

The R library has a detailed README.

The causal impact from this Python version matches the impact for the test market ('CPH') in the example in the R library, as shown in the plots in the starter_example notebook.

Installation

Use the package manager pip to install pycausalmatch.

pip install pycausalmatch

Usage

from pycausalmatch import R_MarketMatching as rmm

rmm.best_matches(**kwargs) # returns
rmm.inference(**kwargs) # returns

TODOs

  • Improve README!

  • add tests

  • add statistical inference

  • use software project structure template

  • Add parallel execution (I plan to use Bodo)

  • Add Streamlit app

  • switch to https://github.com/WillianFuks/tfcausalimpact

  • add remaining functionality of the R package

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

pycausalmatch-0.0.1.tar.gz (8.8 kB view hashes)

Uploaded Source

Built Distribution

pycausalmatch-0.0.1-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

Supported by

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