Registry / ai-ml / causallib

causallib

JSON →
library0.10.0pypypiunverified

A Python package for flexible and modular causal inference modeling. Current version 0.10.0. Provides a scikit-learn compatible API for causal effect estimation, including propensity score matching, weighting, doubly robust estimation, and survival analysis. Released irregularly.

pip install causallib
INSTALL
IMPORT
SIG · CAUSALLIB
C
causallib
ai-mlpythonv0.10.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Weight
✓ from causallib import Weight
✗ from causallib.estimation import Weight

Fits Inverse Probability Weighting (IPW) to estimate potential outcomes on the IHDP dataset.

from causallib.datasets import load_ihdp from causallib.estimation import IPW from sklearn.linear_model import LogisticRegression data = load_ihdp() X = data['X'] a = data['a'] y = data['y'] learner = LogisticRegression(solver='lbfgs') ipw = IPW(learner) ipw.fit(X, a) potential_outcomes = ipw.estimate_population_outcome(X, a, y) print(potential_outcomes)
Debug
Known issues
gotchaData must be provided as DataFrames (not array-like). Many methods internally expect pandas DataFrames for indexing and column alignment; passing numpy arrays may cause silent errors or attribute failures.
fix
Convert inputs to pandas DataFrame/Series before fitting.
affects: all
breakingIn version 0.9.0 the evaluation module was refactored; plot APIs changed. Old imports from causallib.evaluation no longer work.
fix
Use the new causal_metrics module and updated plot functions. See migration guide in the release notes.
affects: >=0.9.0
deprecatedThe `causallib.simulation` module is being phased out. Networkx >=3 may break old simulation code.
fix
Use the newer simulator API or external simulation libraries.
affects: >=0.9.6
Upgrade
Version history
0.10.0latest on PyPI · released Apr 6, 2025
Audit
Dependencies
scikit-learnrequiredCore dependency for model wrappers and evaluation.
pandasrequiredData handling and input validation.
numpyrequiredNumerical computations.
Agent activity
26 hits · last 30 days
node
22
Amazon
1
OpenAI (training)
1
Resources
causallib — pip install causallib · libregistry