Causal AI: causal discovery, causal inference, and process intelligence.
pip install ergodic==0.3.2 Copy PIP instructions
Causal AI in one Python package. ergodic learns causal graphs from data, tells you whether a question can be answered from them, and estimates the effect with an interval. It also covers quasi-experiments on panels, process mining on event logs, structural causal models, and Bayesian forecasting with drivers. ergodic runs locally; the optional [welt] extra calls the hosted Welt service. ergodic is pre-1.0, so the API can change between minor versions.
pip install "ergodic" # or uv add "ergodic" Requires Python 3.11 or later. The extras "ergodic[scm]", "ergodic[forecast]" and "ergodic[latent]" add PyMC for structural causal models, forecasting and hidden regimes. "ergodic[welt]" connects to Welt, which runs hosted models on your data.
from ergodic import discover, estimate_effect, identify_effect from ergodic.datasets import load_earthquake alarm = load_earthquake(n=10_000, seed=0) # the burglar-alarm network (Pearl, 1988) graph = discover(alarm.data, method="pc").graph # learn the graph from data alone for edge in sorted(edge.glyph() for edge in graph.edges): print(edge) print(identify_effect(graph, "Burglary", "JohnCalls")) # can the data answer it? print(estimate_effect(graph, alarm.data, "Burglary", "JohnCalls", treated="True")) Alarm --> JohnCalls Alarm --> MaryCalls Alarm <-- Burglary Alarm <-- Earthquake Identification(adjustment: P(JohnCalls | do(Burglary)) = sum_z P(JohnCalls | Burglary, z) P(z), with z = {Earthquake}) EffectEstimate(aipw, analytic: ate=0.7997, se=0.0337, 95% CI [0.734, 0.866], n=10000) The true effect, from the network's own tables, is 0.793: inside the interval. The documentation starts from this program and goes step by step.
Apache-2.0. See LICENSE and NOTICE. Made by Ergodic.
bayes forecast foundation latent neural scm welt
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




