{"id":19932042,"url":"https://github.com/amazon-science/causal-validation","last_synced_at":"2025-05-03T11:31:03.092Z","repository":{"id":254334380,"uuid":"846190955","full_name":"amazon-science/causal-validation","owner":"amazon-science","description":"Validate your causal models!","archived":false,"fork":false,"pushed_at":"2024-10-24T19:57:06.000Z","size":2459,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-26T06:43:42.865Z","etag":null,"topics":["causal-inference","economics","machine-learning","statistics"],"latest_commit_sha":null,"homepage":"https://amazon-science.github.io/causal-validation/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amazon-science.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-22T17:50:12.000Z","updated_at":"2024-10-24T19:56:21.000Z","dependencies_parsed_at":"2024-10-23T10:10:16.445Z","dependency_job_id":"b5dfcb97-02b0-4de6-b547-28b1338e883a","html_url":"https://github.com/amazon-science/causal-validation","commit_stats":null,"previous_names":["amazon-science/causal-validation"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fcausal-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fcausal-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fcausal-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fcausal-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amazon-science","download_url":"https://codeload.github.com/amazon-science/causal-validation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224360233,"owners_count":17298319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["causal-inference","economics","machine-learning","statistics"],"created_at":"2024-11-12T23:08:50.533Z","updated_at":"2024-11-12T23:08:51.258Z","avatar_url":"https://github.com/amazon-science.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Causal Validation\n\nThis package provides functionality to define your own causal data generation process\nand then simulate data from the process. Within the package, there is functionality to\ninclude complex components to your process, such as periodic and temporal trends, and\nall of these operations are fully composable with one another. \n\nA short example is given below\n```python\nfrom causal_validation import Config, simulate\nfrom causal_validation.effects import StaticEffect\nfrom causal_validation.plotters import plot\nfrom causal_validation.transforms import Trend, Periodic\nfrom causal_validation.transforms.parameter import UnitVaryingParameter\nfrom scipy.stats import norm\n\ncfg = Config(\n    n_control_units=10,\n    n_pre_intervention_timepoints=60,\n    n_post_intervention_timepoints=30,\n)\n\n# Simulate the base observation\nbase_data = simulate(cfg)\n\n# Apply a linear trend with unit-varying intercept\nintercept = UnitVaryingParameter(sampling_dist = norm(0, 1))\ntrend_component = Trend(degree=1, coefficient=0.1, intercept=intercept)\ntrended_data = trend_component(base_data)\n\n# Simulate a 5% lift in the treated unit's post-intervention data\neffect = StaticEffect(0.05)\ninflated_data = effect(trended_data)\n\n# Plot your data\nplot(inflated_data)\n```\n\n![](https://raw.githubusercontent.com/amazon-science/causal-validation/main/static/readme_fig.png?token=GHSAT0AAAAAACTFBAFOPO3QHKOVJ26W4DU4ZWHSWFA)\n\n\n## Examples\n\nTo supplement the above example, we have two more detailed notebooks which exhaustively\npresent and explain the functionalty in this package, along with how the generated data\nmay be integrated with [AZCausal](https://github.com/amazon-science/azcausal).\n1. [Data Synthesis](https://amazon-science.github.io/causal-validation/examples/basic/): We here show the full range of available functions for data generation.\n2. [Placebo testing](https://amazon-science.github.io/causal-validation/examples/placebo_test/): Validate your model(s) using placebo tests.\n3. [AZCausal notebook](https://amazon-science.github.io/causal-validation/examples/azcausal/): We here show how the generated data may be used within an AZCausal model.\n\n## Installation\n\nIn this section we guide the user through the installation of this package. We\ndistinguish here between _users_ of the package who seek to define their own data\ngenerating processes, and _developers_ who wish to extend the existing functionality of\nthe package.\n\n### Prerequisites\n\n- Python 3.10 or higher\n- [Hatch](https://hatch.pypa.io/latest/) (optional, but recommended for developers)\n\nTo install the latest stable version, run\n`pip install causal-validation`\nin your terminal.\n\n### For Users\n\n1. It's strongly recommended to use a virtual environment. Create and activate one using your preferred method before proceeding with the installation.\n2. Clone the package `git clone git@github.com:amazon-science/causal-validation.git`\n3. Enter the package's root directory `cd causal-validation`\n4. Install the package `pip install -e .`\n\n### For Developers\n\n1. Follow steps 1-3 from `For Users`\n2. Create a hatch environment `hatch env create`\n3. Open a hatch shell `hatch shell`\n4. Validate your installation by running `hatch run dev:test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-science%2Fcausal-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famazon-science%2Fcausal-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-science%2Fcausal-validation/lists"}