Name | causalem JSON |
Version |
1.0.1
JSON |
| download |
home_page | None |
Summary | Causal Inference using Ensemble Matching |
upload_time | 2025-10-08 03:39:17 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License
Copyright (c) 2025-Present Alireza S. Mahani, Mansour T.A. Sharabiani
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
keywords |
causal-inference
matching
ensemble learning
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# CausalEM – Ensemble Matching for Causal Inference
> **CausalEM** is a toolbox for multi-arm treatment‑effect estimation and mediation analysis using stochastic matching and a stacked ensemble of heterogeneous ML models. It supports continuous, binary, and survival outcomes.
## Table of Contents
- [Key Features](#key-features)
- [API](#api)
- [Installation](#️-installation)
- [Package Vignette](#package-vignette)
- [Quick Start](#-quick-start)
- [Two-arm Analysis](#two-arm-analysis)
- [Multi-arm Analysis](#multi-arm-analysis)
- [Confidence-Interval Calculation](#confidence-interval-calculation)
- [Heterogeneous Ensemble](#heterogeneous-ensemble)
- [Stacking vs No-Stacking](#stacking-vs-no-stacking)
- [TE Estimation for Survival Outcomes](#te-estimation-for-survival-outcomes)
- [Mediation Analysis](#mediation-analysis)
- [CausalEM in R](#causalem-in-r)
- [Installation (R)](#installation-r)
- [Quick Start (R)](#quick-start-r)
- [License](#license)
- [Release Notes](#release-notes)
---
## Key Features
| Feature | Impact |
|---------|--------|
| **Stochastic nearest-neighbor (NN) matching** | Larger effective sample size (ESS) and improved TE estimation accuracy compared to standard (deterministic) NN matching |
| **G-computation using two-staged, stacked ensemble of heterogeneous learners** | Generalization of standard G-computation framework to ensemble learning; cross-fitting of propensity-score and outcome models, similar to DoubleML |
| **Support for multi-arm treatments** | Improved multi-arm ESS via stochastic matching |
| **Mediation analysis** | Plug-in G-computation for interventional mediation effects (IDE/IIE) with binary treatment and binary/continuous mediators and outcomes, supporting bootstrap confidence intervals and optional stochastic matching |
| **Support for survival outcomes** | Use of data simulation from survival outcome models to implement stacked-ensemble for TE estimation in right-censored, time-to-event data |
| **Bootstrapped confidence interval (CI) estimation** | Honest estimation of CI by including entire (matching + TE estimation) pipeline in bootstrap loop |
| **Compatible with `scikit-learn`** | Maximum flexibility in using ML models by providing access to `scikit-learn` (and `scikit-survival` for survival) for propensity-score, outcome and meta-learner stages |
| **Full reproducibility of results** | Careful implementation of random number generation (RNG) seeding, including in `scikit-learn` models |
| **Available in Python and R** | Identical function-centric API in both languages using `reticulate`; combined with RNG management, leads to identical, reproducible results across platforms |
---
## API
| Function | Brief description |
| ------------------------ | --------------------------------------------------------- |
| `estimate_te` | Main pipeline – ensemble matching + meta‑learner |
| `estimate_mediation` | Mediation analysis with plug-in G-computation |
| `StochasticMatcher` | 1:1 nearest‑neighbor matcher (deterministic ↔ stochastic) |
| `summarize_matching` | Diagnostics: ESS, ASMD, variance ratios, overlap plots |
| `load_data_lalonde` | Standard Lalonde job‑training dataset (two-arm, continuous outcome) |
| `load_data_tof` | New simulated Tetralogy of Fallot (ToF) dataset (two-arm or three-arm, survival/binary/continuous outcome) |
---
## ⚙️ Installation <!--- install -->
```bash
pip install causalem
```
Optional dev extras:
```bash
pip install "causalem[dev]"
```
Minimum Python 3.9. Tested on macOS and Windows.
---
## Package Vignette
For a more detailed introduction to `CausalEM`, including the underlying math, see the _package vignette_ [insert link later], available on arXiv.
---
## 🚀 Quick Start <!--- quickstart -->
### Two-arm Analysis
Load the necessary packages:
```python
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from causalem import (
estimate_te,
load_data_tof,
stochastic_match,
summarize_matching
)
```
Load the ToF data with two treatment levels and binarized outcome:
```python
X, t, y = load_data_tof(
raw = False,
treat_levels = ['PrP', 'SPS'],
outcome_type="binary",
)
```
Stochastic matching using propensity scores:
```python
lr = LogisticRegression(solver="newton-cg", max_iter=1000)
lr.fit(X, t)
score = lr.predict_proba(X)[:, 1]
logit_score = np.log(score / (1 - score))
cluster = stochastic_match(
treatment=t,
score=logit_score,
nsmp=10,
scale=1.0,
random_state=0,
)
diag = summarize_matching(
cluster, X,
treatment=t, plot=False
)
print("Combined Effective Sample Size (ESS):", diag.ess["combined"])
print("Absolute standardized mean difference (ASMD) by covariate:\n")
print(diag.summary)
```
TE estimation (includes stochastic matching as the first step, followed by outcome modeling):
```python
res = estimate_te(
X,
t,
y,
outcome_type="binary",
niter=5,
matching_scale=1.0,
matching_is_stochastic=True,
random_state_master=1,
)
print("Two-arm TE:", res["te"])
```
### Multi-arm Analysis
Load data for multi-arm analysis:
```python
df = load_data_tof(
raw = True,
outcome_type="binary",
)
t_all = df["treatment"].to_numpy()
X_all = df[["age", "zscore"]].to_numpy()
y_all = df["outcome"].to_numpy()
```
Constructing propensity scores using multinomial logistic regression:
```python
lr_multi = LogisticRegression(multi_class="multinomial", max_iter=1000)
lr_multi.fit(X_all, t_all)
proba = lr_multi.predict_proba(X_all)
ref = "PrP"
cols = [i for i, c in enumerate(lr_multi.classes_) if c != ref]
logit_multi = np.log(proba[:, cols] / (1 - proba[:, cols]))
```
Multi-arm stochastic matching:
```python
cluster_multi = stochastic_match(
treatment=t_all,
score=logit_multi,
nsmp=5,
scale=1.0,
ref_group=ref,
random_state=0,
)
diag_multi = summarize_matching(
cluster_multi, X_all, treatment=t_all, ref_group=ref, plot=False
)
print("Multi-arm ESS per draw:\n", diag_multi.ess["per_draw"]) # dict of counts by group
```
Multi-arm TE estimation:
```python
res_multi = estimate_te(
X_all,
t_all,
y_all,
outcome_type="binary",
ref_group=ref,
niter=5,
matching_scale=1.0,
matching_is_stochastic=True,
random_state_master=1,
)
print("Multi-arm pairwise effects:\n", res_multi["pairwise"])
```
### Confidence-Interval Calculation
Adding bootstrap CI to the two-arm analysis:
```python
res_boot = estimate_te(
X,
t,
y,
outcome_type="binary",
niter=5,
nboot=200,
matching_scale=1.0,
matching_is_stochastic=True,
random_state_master=1,
random_state_boot=7,
)
print("Bootstrap CI:", res_boot["ci"])
```
### Heterogeneous Ensemble
```python
learners = [
LogisticRegression(max_iter=1000),
RandomForestClassifier(n_estimators=200, max_depth=3),
]
res_ensemble = estimate_te(
X,
t,
y,
outcome_type="binary",
model_outcome=learners,
niter=len(learners),
do_stacking=True,
matching_scale=1.0,
matching_is_stochastic=True,
random_state_master=42,
)
print("Ensemble TE:", res_ensemble["te"])
```
### Stacking vs No-Stacking
```python
# No-stacking: average per-iteration effects without appearance weights
res_ns = estimate_te(
X,
t,
y,
outcome_type="binary",
niter=5,
do_stacking=False,
random_state_master=0,
)
# Stacking: meta-learner fit with appearance weights over the matched union
res_stack = estimate_te(
X,
t,
y,
outcome_type="binary",
niter=5,
do_stacking=True,
random_state_master=0,
)
```
### TE Estimation for Survival Outcomes
```python
X_surv, t_surv, y_surv = load_data_tof(
raw=False
, treat_levels = ['SPS', 'PrP']
)
res_surv = estimate_te(
X_surv,
t_surv,
y_surv,
outcome_type="survival",
niter=5,
matching_scale=1.0,
matching_is_stochastic=True,
random_state_master=0,
)
print("Survival HR:", res_surv["te"])
```
### Mediation Analysis
```python
# Load ToF data with mediation structure
from causalem.datasets import load_data_tof
from causalem.mediation import estimate_mediation
# Load ToF data: binary treatment (PrP vs SPS), continuous mediator (op_time), binary outcome
X, A, M, Y = load_data_tof(
raw=False,
treat_levels=['PrP', 'SPS'], # Binary treatment comparison
outcome_type="binary", # Binary outcome for simpler interpretation
include_mediator=True # Include mediator variable (op_time)
)
# Estimate mediation effects
result = estimate_mediation(X, A, M, Y, random_state_master=42)
print("Total Effect (TE):", result["te"])
print("Interventional Direct Effect (IDE):", result["ide"])
print("Interventional Indirect Effect (IIE):", result["iie"])
print("Proportion Mediated:", result["prop_mediated"])
```
---
## License
This project is licensed under the terms of the MIT License.
## Release Notes
### 1.0.1
- Removed the R section of `README.md` since it has not been released yet.
- Added release notes for version 1.0.0.
### 1.0.0
- Removed `binarize_outcome` parameter from `load_data_lalonde` and `load_data_tof`.
- Absorbed `load_data_tof_with_mediator` into `load_data_tof`.
### 0.7.0
- Added mediation analysis functionality with `estimate_mediation` function for interventional mediation effects using plug-in G-computation.
- Supports binary treatment with binary/continuous mediators and continuous outcomes.
- Features bootstrap confidence intervals and optional integration with stochastic matching for improved robustness.
- Estimates total effect (TE), interventional direct effect (IDE), and interventional indirect effect (IIE).
### 0.6.2
- Exposed a new `n_mc` argument in estimate_te for specifying Monte‑Carlo draws per matched unit in survival analyses, replacing the previously fixed single draw.
- Clarified treatment‑effect estimands for stacking vs. no‑stacking modes, noting that stacked results are appearance‑weighted across the matched union.
- Documented appearance‑weighted meta‑learning and matched‑union survival contrasts.
### 0.6.1
- Corrected the version number in `pyproject.toml` file.
### 0.6.0
- Improved consistency of return data structure when `do_stacking=False` in multi-arm TE estimation.
### 0.5.4
- Added github action for publishing to PyPI
### 0.5.3
- First public release
### 0.5.1
- Edits to readme
- Added github action for publishing to (test) PyPI
### 0.5.0
- First test release
Raw data
{
"_id": null,
"home_page": null,
"name": "causalem",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "causal-inference, matching, ensemble learning",
"author": null,
"author_email": "\"Alireza S. Mahani, Mansour T.A. Sharabiani\" <alireza.s.mahani@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/94/ac/6f10c8a5463a33fa66e2653a5b66e0b58a9ea08f8879626e29b4edcfd4e8/causalem-1.0.1.tar.gz",
"platform": null,
"description": "# CausalEM \u2013 Ensemble Matching for Causal Inference\r\n\r\n> **CausalEM** is a toolbox for multi-arm treatment\u2011effect estimation and mediation analysis using stochastic matching and a stacked ensemble of heterogeneous ML models. It supports continuous, binary, and survival outcomes.\r\n\r\n## Table of Contents\r\n\r\n- [Key Features](#key-features)\r\n- [API](#api)\r\n- [Installation](#\ufe0f-installation)\r\n- [Package Vignette](#package-vignette)\r\n- [Quick Start](#-quick-start)\r\n - [Two-arm Analysis](#two-arm-analysis)\r\n - [Multi-arm Analysis](#multi-arm-analysis)\r\n - [Confidence-Interval Calculation](#confidence-interval-calculation)\r\n - [Heterogeneous Ensemble](#heterogeneous-ensemble)\r\n - [Stacking vs No-Stacking](#stacking-vs-no-stacking)\r\n - [TE Estimation for Survival Outcomes](#te-estimation-for-survival-outcomes)\r\n - [Mediation Analysis](#mediation-analysis)\r\n- [CausalEM in R](#causalem-in-r)\r\n - [Installation (R)](#installation-r)\r\n - [Quick Start (R)](#quick-start-r)\r\n- [License](#license)\r\n- [Release Notes](#release-notes)\r\n\r\n---\r\n\r\n## Key Features\r\n\r\n| Feature | Impact |\r\n|---------|--------|\r\n| **Stochastic nearest-neighbor (NN) matching** | Larger effective sample size (ESS) and improved TE estimation accuracy compared to standard (deterministic) NN matching |\r\n| **G-computation using two-staged, stacked ensemble of heterogeneous learners** | Generalization of standard G-computation framework to ensemble learning; cross-fitting of propensity-score and outcome models, similar to DoubleML |\r\n| **Support for multi-arm treatments** | Improved multi-arm ESS via stochastic matching |\r\n| **Mediation analysis** | Plug-in G-computation for interventional mediation effects (IDE/IIE) with binary treatment and binary/continuous mediators and outcomes, supporting bootstrap confidence intervals and optional stochastic matching |\r\n| **Support for survival outcomes** | Use of data simulation from survival outcome models to implement stacked-ensemble for TE estimation in right-censored, time-to-event data |\r\n| **Bootstrapped confidence interval (CI) estimation** | Honest estimation of CI by including entire (matching + TE estimation) pipeline in bootstrap loop |\r\n| **Compatible with `scikit-learn`** | Maximum flexibility in using ML models by providing access to `scikit-learn` (and `scikit-survival` for survival) for propensity-score, outcome and meta-learner stages |\r\n| **Full reproducibility of results** | Careful implementation of random number generation (RNG) seeding, including in `scikit-learn` models |\r\n| **Available in Python and R** | Identical function-centric API in both languages using `reticulate`; combined with RNG management, leads to identical, reproducible results across platforms |\r\n\r\n---\r\n\r\n## API\r\n\r\n| Function | Brief description |\r\n| ------------------------ | --------------------------------------------------------- |\r\n| `estimate_te` | Main pipeline \u2013 ensemble matching + meta\u2011learner |\r\n| `estimate_mediation` | Mediation analysis with plug-in G-computation |\r\n| `StochasticMatcher` | 1:1 nearest\u2011neighbor matcher (deterministic \u2194 stochastic) |\r\n| `summarize_matching` | Diagnostics: ESS, ASMD, variance ratios, overlap plots |\r\n| `load_data_lalonde` | Standard Lalonde job\u2011training dataset (two-arm, continuous outcome) |\r\n| `load_data_tof` | New simulated Tetralogy of Fallot (ToF) dataset (two-arm or three-arm, survival/binary/continuous outcome) |\r\n\r\n---\r\n\r\n## \u2699\ufe0f Installation <!--- install -->\r\n\r\n```bash\r\npip install causalem\r\n```\r\n\r\nOptional dev extras:\r\n\r\n```bash\r\npip install \"causalem[dev]\"\r\n```\r\n\r\nMinimum Python\u00a03.9. Tested on macOS and Windows.\r\n\r\n---\r\n\r\n## Package Vignette\r\n\r\nFor a more detailed introduction to `CausalEM`, including the underlying math, see the _package vignette_ [insert link later], available on arXiv.\r\n\r\n---\r\n\r\n## \ud83d\ude80 Quick\u00a0Start <!--- quickstart -->\r\n\r\n### Two-arm Analysis\r\n\r\nLoad the necessary packages:\r\n\r\n```python\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom sklearn.ensemble import RandomForestClassifier\r\nfrom sklearn.linear_model import LogisticRegression\r\n\r\nfrom causalem import (\r\n estimate_te,\r\n load_data_tof,\r\n stochastic_match,\r\n summarize_matching\r\n)\r\n```\r\nLoad the ToF data with two treatment levels and binarized outcome:\r\n```python\r\nX, t, y = load_data_tof(\r\n raw = False,\r\n treat_levels = ['PrP', 'SPS'],\r\n outcome_type=\"binary\",\r\n)\r\n```\r\nStochastic matching using propensity scores:\r\n```python\r\nlr = LogisticRegression(solver=\"newton-cg\", max_iter=1000)\r\nlr.fit(X, t)\r\nscore = lr.predict_proba(X)[:, 1]\r\nlogit_score = np.log(score / (1 - score))\r\n\r\ncluster = stochastic_match(\r\n treatment=t,\r\n score=logit_score,\r\n nsmp=10,\r\n scale=1.0,\r\n random_state=0,\r\n)\r\n\r\ndiag = summarize_matching(\r\n cluster, X,\r\n treatment=t, plot=False\r\n)\r\nprint(\"Combined Effective Sample Size (ESS):\", diag.ess[\"combined\"])\r\nprint(\"Absolute standardized mean difference (ASMD) by covariate:\\n\")\r\nprint(diag.summary)\r\n```\r\nTE estimation (includes stochastic matching as the first step, followed by outcome modeling):\r\n```python\r\nres = estimate_te(\r\n X,\r\n t,\r\n y,\r\n outcome_type=\"binary\",\r\n niter=5,\r\n matching_scale=1.0,\r\n matching_is_stochastic=True,\r\n random_state_master=1,\r\n)\r\nprint(\"Two-arm TE:\", res[\"te\"])\r\n```\r\n\r\n### Multi-arm Analysis\r\n\r\nLoad data for multi-arm analysis:\r\n```python\r\ndf = load_data_tof(\r\n raw = True,\r\n outcome_type=\"binary\",\r\n)\r\nt_all = df[\"treatment\"].to_numpy()\r\nX_all = df[[\"age\", \"zscore\"]].to_numpy()\r\ny_all = df[\"outcome\"].to_numpy()\r\n```\r\nConstructing propensity scores using multinomial logistic regression:\r\n```python\r\nlr_multi = LogisticRegression(multi_class=\"multinomial\", max_iter=1000)\r\nlr_multi.fit(X_all, t_all)\r\nproba = lr_multi.predict_proba(X_all)\r\nref = \"PrP\"\r\ncols = [i for i, c in enumerate(lr_multi.classes_) if c != ref]\r\nlogit_multi = np.log(proba[:, cols] / (1 - proba[:, cols]))\r\n```\r\nMulti-arm stochastic matching:\r\n```python\r\ncluster_multi = stochastic_match(\r\n treatment=t_all,\r\n score=logit_multi,\r\n nsmp=5,\r\n scale=1.0,\r\n ref_group=ref,\r\n random_state=0,\r\n)\r\ndiag_multi = summarize_matching(\r\n cluster_multi, X_all, treatment=t_all, ref_group=ref, plot=False\r\n)\r\nprint(\"Multi-arm ESS per draw:\\n\", diag_multi.ess[\"per_draw\"]) # dict of counts by group\r\n```\r\nMulti-arm TE estimation:\r\n```python\r\nres_multi = estimate_te(\r\n X_all,\r\n t_all,\r\n y_all,\r\n outcome_type=\"binary\",\r\n ref_group=ref,\r\n niter=5,\r\n matching_scale=1.0,\r\n matching_is_stochastic=True,\r\n random_state_master=1,\r\n)\r\nprint(\"Multi-arm pairwise effects:\\n\", res_multi[\"pairwise\"])\r\n```\r\n\r\n### Confidence-Interval Calculation\r\n\r\nAdding bootstrap CI to the two-arm analysis:\r\n```python\r\nres_boot = estimate_te(\r\n X,\r\n t,\r\n y,\r\n outcome_type=\"binary\",\r\n niter=5,\r\n nboot=200,\r\n matching_scale=1.0,\r\n matching_is_stochastic=True,\r\n random_state_master=1,\r\n random_state_boot=7,\r\n)\r\nprint(\"Bootstrap CI:\", res_boot[\"ci\"])\r\n```\r\n\r\n### Heterogeneous Ensemble\r\n\r\n```python\r\nlearners = [\r\n LogisticRegression(max_iter=1000),\r\n RandomForestClassifier(n_estimators=200, max_depth=3),\r\n]\r\nres_ensemble = estimate_te(\r\n X,\r\n t,\r\n y,\r\n outcome_type=\"binary\",\r\n model_outcome=learners,\r\n niter=len(learners),\r\n do_stacking=True,\r\n matching_scale=1.0,\r\n matching_is_stochastic=True,\r\n random_state_master=42,\r\n)\r\nprint(\"Ensemble TE:\", res_ensemble[\"te\"])\r\n```\r\n\r\n### Stacking vs No-Stacking\r\n\r\n```python\r\n# No-stacking: average per-iteration effects without appearance weights\r\nres_ns = estimate_te(\r\n X,\r\n t,\r\n y,\r\n outcome_type=\"binary\",\r\n niter=5,\r\n do_stacking=False,\r\n random_state_master=0,\r\n)\r\n\r\n# Stacking: meta-learner fit with appearance weights over the matched union\r\nres_stack = estimate_te(\r\n X,\r\n t,\r\n y,\r\n outcome_type=\"binary\",\r\n niter=5,\r\n do_stacking=True,\r\n random_state_master=0,\r\n)\r\n```\r\n\r\n### TE Estimation for Survival Outcomes\r\n```python\r\nX_surv, t_surv, y_surv = load_data_tof(\r\n raw=False\r\n , treat_levels = ['SPS', 'PrP']\r\n)\r\nres_surv = estimate_te(\r\n X_surv,\r\n t_surv,\r\n y_surv,\r\n outcome_type=\"survival\",\r\n niter=5,\r\n matching_scale=1.0,\r\n matching_is_stochastic=True,\r\n random_state_master=0,\r\n)\r\nprint(\"Survival HR:\", res_surv[\"te\"])\r\n```\r\n\r\n### Mediation Analysis\r\n\r\n```python\r\n# Load ToF data with mediation structure\r\nfrom causalem.datasets import load_data_tof\r\nfrom causalem.mediation import estimate_mediation\r\n\r\n# Load ToF data: binary treatment (PrP vs SPS), continuous mediator (op_time), binary outcome\r\nX, A, M, Y = load_data_tof(\r\n raw=False,\r\n treat_levels=['PrP', 'SPS'], # Binary treatment comparison\r\n outcome_type=\"binary\", # Binary outcome for simpler interpretation \r\n include_mediator=True # Include mediator variable (op_time)\r\n)\r\n\r\n# Estimate mediation effects\r\nresult = estimate_mediation(X, A, M, Y, random_state_master=42)\r\n\r\nprint(\"Total Effect (TE):\", result[\"te\"])\r\nprint(\"Interventional Direct Effect (IDE):\", result[\"ide\"]) \r\nprint(\"Interventional Indirect Effect (IIE):\", result[\"iie\"])\r\nprint(\"Proportion Mediated:\", result[\"prop_mediated\"])\r\n```\r\n\r\n---\r\n\r\n## License\r\n\r\nThis project is licensed under the terms of the MIT License.\r\n\r\n## Release Notes\r\n\r\n### 1.0.1\r\n\r\n- Removed the R section of `README.md` since it has not been released yet.\r\n- Added release notes for version 1.0.0.\r\n\r\n### 1.0.0\r\n\r\n- Removed `binarize_outcome` parameter from `load_data_lalonde` and `load_data_tof`.\r\n- Absorbed `load_data_tof_with_mediator` into `load_data_tof`.\r\n\r\n### 0.7.0\r\n- Added mediation analysis functionality with `estimate_mediation` function for interventional mediation effects using plug-in G-computation.\r\n- Supports binary treatment with binary/continuous mediators and continuous outcomes.\r\n- Features bootstrap confidence intervals and optional integration with stochastic matching for improved robustness.\r\n- Estimates total effect (TE), interventional direct effect (IDE), and interventional indirect effect (IIE).\r\n\r\n### 0.6.2\r\n- Exposed a new `n_mc` argument in estimate_te for specifying Monte\u2011Carlo draws per matched unit in survival analyses, replacing the previously fixed single draw.\r\n- Clarified treatment\u2011effect estimands for stacking vs. no\u2011stacking modes, noting that stacked results are appearance\u2011weighted across the matched union.\r\n- Documented appearance\u2011weighted meta\u2011learning and matched\u2011union survival contrasts.\r\n\r\n### 0.6.1\r\n- Corrected the version number in `pyproject.toml` file.\r\n\r\n### 0.6.0\r\n- Improved consistency of return data structure when `do_stacking=False` in multi-arm TE estimation.\r\n\r\n### 0.5.4\r\n- Added github action for publishing to PyPI\r\n\r\n### 0.5.3\r\n- First public release\r\n\r\n### 0.5.1\r\n- Edits to readme\r\n- Added github action for publishing to (test) PyPI\r\n\r\n### 0.5.0\r\n\r\n- First test release\r\n",
"bugtrack_url": null,
"license": "MIT License\r\n \r\n Copyright (c) 2025-Present Alireza S. Mahani, Mansour T.A. Sharabiani\r\n \r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights\r\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n copies of the Software, and to permit persons to whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n \r\n The above copyright notice and this permission notice shall be included in all\r\n copies or substantial portions of the Software.\r\n \r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n SOFTWARE.\r\n ",
"summary": "Causal Inference using Ensemble Matching",
"version": "1.0.1",
"project_urls": null,
"split_keywords": [
"causal-inference",
" matching",
" ensemble learning"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ee97ee30e831a1a10cd4fda2634a558f35864f86c42aa353badec00de94ab4b4",
"md5": "b548c9ef02dac8af787e6fce8cb4a0a8",
"sha256": "52de01db842759f8690a7328144b3837d630402aca04637bfbd27522b6868883"
},
"downloads": -1,
"filename": "causalem-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b548c9ef02dac8af787e6fce8cb4a0a8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 146762,
"upload_time": "2025-10-08T03:39:15",
"upload_time_iso_8601": "2025-10-08T03:39:15.272637Z",
"url": "https://files.pythonhosted.org/packages/ee/97/ee30e831a1a10cd4fda2634a558f35864f86c42aa353badec00de94ab4b4/causalem-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "94ac6f10c8a5463a33fa66e2653a5b66e0b58a9ea08f8879626e29b4edcfd4e8",
"md5": "5c4bcc715819e3b01f82585cf8bf5db1",
"sha256": "ddea39b7f4b9db3138596098819caedf4721f3a2b4eb731c3c66703078460586"
},
"downloads": -1,
"filename": "causalem-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "5c4bcc715819e3b01f82585cf8bf5db1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 169958,
"upload_time": "2025-10-08T03:39:17",
"upload_time_iso_8601": "2025-10-08T03:39:17.062179Z",
"url": "https://files.pythonhosted.org/packages/94/ac/6f10c8a5463a33fa66e2653a5b66e0b58a9ea08f8879626e29b4edcfd4e8/causalem-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-08 03:39:17",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "causalem"
}