https://github.com/amazon-science/causal-validation

Validate your causal models!

https://github.com/amazon-science/causal-validation

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary

Keywords

causal-inference economics machine-learning statistics
Last synced: 10 months ago · JSON representation

Repository

Validate your causal models!

Basic Info
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 2
  • Open Issues: 3
  • Releases: 6
Topics
causal-inference economics machine-learning statistics
Created almost 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License Code of conduct

README.md

Causal Validation

This package provides functionality to define your own causal data generation process and then simulate data from the process. Within the package, there is functionality to include complex components to your process, such as periodic and temporal trends, and all of these operations are fully composable with one another.

A short example is given below ```python from causalvalidation import Config, simulate from causalvalidation.effects import StaticEffect from causalvalidation.plotters import plot from causalvalidation.transforms import Trend, Periodic from causal_validation.transforms.parameter import UnitVaryingParameter from scipy.stats import norm

cfg = Config( ncontrolunits=10, npreinterventiontimepoints=60, npostinterventiontimepoints=30, )

Simulate the base observation

base_data = simulate(cfg)

Apply a linear trend with unit-varying intercept

intercept = UnitVaryingParameter(samplingdist = norm(0, 1)) trendcomponent = Trend(degree=1, coefficient=0.1, intercept=intercept) trendeddata = trendcomponent(base_data)

Simulate a 5% lift in the treated unit's post-intervention data

effect = StaticEffect(0.05) inflateddata = effect(trendeddata)

Plot your data

plot(inflated_data) ```

Examples

To supplement the above example, we have two more detailed notebooks which exhaustively present and explain the functionalty in this package, along with how the generated data may be integrated with AZCausal. 1. Data Synthesis: We here show the full range of available functions for data generation. 2. Placebo testing: Validate your model(s) using placebo tests. 3. AZCausal notebook: We here show how the generated data may be used within an AZCausal model.

Installation

In this section we guide the user through the installation of this package. We distinguish here between users of the package who seek to define their own data generating processes, and developers who wish to extend the existing functionality of the package.

Prerequisites

  • Python 3.10 or higher
  • Hatch (optional, but recommended for developers)

To install the latest stable version, run pip install causal-validation in your terminal.

For Users

  1. It's strongly recommended to use a virtual environment. Create and activate one using your preferred method before proceeding with the installation.
  2. Clone the package git clone git@github.com:amazon-science/causal-validation.git
  3. Enter the package's root directory cd causal-validation
  4. Install the package pip install -e .

For Developers

  1. Follow steps 1-3 from For Users
  2. Create a hatch environment hatch env create
  3. Open a hatch shell hatch shell
  4. Validate your installation by running hatch run dev:test

Owner

  • Name: Amazon Science
  • Login: amazon-science
  • Kind: organization

GitHub Events

Total
  • Push event: 4
  • Pull request review event: 1
  • Pull request event: 4
Last Year
  • Push event: 4
  • Pull request review event: 1
  • Pull request event: 4

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 6
  • Total pull requests: 39
  • Average time to close issues: 13 days
  • Average time to close pull requests: about 7 hours
  • Total issue authors: 2
  • Total pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.08
  • Merged pull requests: 39
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 6
  • Pull requests: 39
  • Average time to close issues: 13 days
  • Average time to close pull requests: about 7 hours
  • Issue authors: 2
  • Pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.08
  • Merged pull requests: 39
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • thomaspinder (3)
Pull Request Authors
  • thomaspinder (31)
  • semihakbayrak (6)
  • B-Deforce (2)
Top Labels
Issue Labels
enhancement (2) documentation (1)
Pull Request Labels
enhancement (5) bug (2) documentation (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 51 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 9
  • Total maintainers: 1
pypi.org: causal-validation

A validation framework for causal models.

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 51 Last month
Rankings
Dependent packages count: 10.4%
Average: 34.6%
Dependent repos count: 58.8%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/docs.yml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3.5.2 composite
  • actions/setup-python v4 composite
  • pypa/hatch install composite
.github/workflows/test_docs.yml actions
  • actions/checkout v3.5.2 composite
  • actions/setup-python v4 composite
  • pypa/hatch install composite
.github/workflows/ruff.yml actions
  • actions/checkout v3.5.2 composite
  • chartboost/ruff-action v1 composite
.github/workflows/tests.yml actions
  • actions/checkout v3.5.2 composite
  • actions/setup-python v4 composite
  • pypa/hatch install composite
pyproject.toml pypi
  • azcausal *
  • beartype *
  • jaxtyping *
  • matplotlib *
  • numpy *
  • pandas *