pgmpy

pgmpy

โ˜… 3.8 ๐Ÿ”– 1200 saves ๐Ÿ’ฐ Free GitHub

pgmpy is a Python toolkit for causal and probabilistic reasoning, available on GitHub with about 3,360 stars under the MIT license and actively maintained in 2026. Where most modern AI tooling focuses on prediction, pgmpy focuses on understanding why things happen: it gives you the building blocks to model cause and effect with graphical models and to reason about interventions, not just correlations.

Overview

The library implements data structures for a wide range of causal and graphical models, including DAGs, PDAGs, MAGs, PAGs, Bayesian networks, dynamic Bayesian networks, and structural equation models. On top of those structures it provides algorithms for causal discovery from data, causal identification, effect estimation, probabilistic inference, model validation, parameter estimation, and simulation, including support for mixed data types. A design goal is composability: algorithms for each task follow a unified API, are scikit-learn compatible where possible, and can be dropped into sklearn pipelines or used as foundations for higher-level tools. Documentation, examples, and tutorials are published on the project site, and the package installs from PyPI or conda-forge. The project has a long history in the open-source community and is used in teaching as well as applied work, with estimators and inference algorithms that prioritize correctness and transparency over black-box convenience. For domains where decisions must be explained and defended, that clarity is exactly the point.

Key Features

  • Bayesian networks and a broad family of graphical models
  • Causal discovery, identification, and effect estimation algorithms
  • Probabilistic inference, parameter estimation, and simulation
  • Dynamic Bayesian networks and structural equation models
  • Unified, modular API that is scikit-learn compatible
  • Handles mixed data types for real-world datasets

๐Ÿ’ณ Pricing

pgmpy is free and open source under the MIT license.

Who Is It For

pgmpy is for data scientists and researchers working on causal inference, risk and reliability modeling, healthcare and policy analysis, and anyone who needs principled probabilistic reasoning in Python.

๐Ÿš€ Visit pgmpy Official Site

๐Ÿšฉ Report an issue