pgmpy/pgmpy
Python Toolkit for Causal and Probabilistic Reasoning
What it solves
pgmpy provides a framework for causal and probabilistic reasoning using graphical models. It allows users to build, learn, and perform inference on complex models that represent dependencies between variables, enabling the discovery of causal relationships and the prediction of outcomes based on observed evidence.
How it works
The library implements various data structures for graphical models, including Directed Acyclic Graphs (DAGs), Bayesian Networks, and Structural Equation Models. It provides a modular, composable API for several key tasks:
- Structure Learning: Learning the model structure from data, with the ability to integrate expert knowledge.
- Parameter Estimation: Estimating conditional probability distributions (CPDs) from observed data.
- Inference: Computing posterior distributions (probabilistic inference) or interventional distributions (causal inference).
- Simulation: Generating synthetic data based on specified evidence or interventions.
The tool is designed to be scikit-learn compatible where possible, allowing it to be integrated into standard ML pipelines.
Who it’s for
It is designed for researchers and developers working with probabilistic graphical models, causal discovery, and causal inference.
Highlights
- Broad Model Support: Supports DAGs, PDAGs, MAGs, PAGs, Bayesian Networks, Dynamic Bayesian Networks, and Structural Equation Models.
- Causal Toolset: Includes algorithms for causal discovery, identification, and validation.
- Flexible Data Handling: Works with discrete data, linear Gaussian data, and mixture data with arbitrary relationships (via a Torch backend).
- Modular API: Uses a unified, composable API that makes the library extensible and compatible with scikit-learn pipelines.
Related
- Project
- Project
- Project
- Project
- Project