Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Data Science
  3. pgmpy

pgmpy

MITPythonv1.1.2

A Python toolkit for causal and probabilistic reasoning using graphical models like Bayesian Networks and Structural Equation Models.

Visit WebsiteGitHubGitHub
3.4k stars1.2k forks0 contributors

What is pgmpy?

pgmpy is a Python toolkit for causal and probabilistic reasoning using graphical models such as Bayesian Networks, Dynamic Bayesian Networks, and Structural Equation Models. It provides data structures and algorithms for tasks like causal discovery, inference, parameter estimation, and simulations, helping users model and analyze complex probabilistic relationships.

Target Audience

Data scientists, researchers, and machine learning practitioners working on causal inference, probabilistic modeling, or graphical model applications in Python.

Value Proposition

Developers choose pgmpy for its comprehensive, modular API that supports a wide range of graphical models and causal reasoning tasks, with scikit-learn compatibility for easy integration into existing machine learning workflows.

Overview

Python Toolkit for Causal and Probabilistic Reasoning

Use Cases

Best For

  • Learning causal structures from observational data
  • Performing probabilistic inference in Bayesian Networks
  • Estimating parameters for graphical models from data
  • Simulating synthetic data under interventions or evidence
  • Conducting causal inference using do-calculus
  • Building and validating Structural Equation Models

Not Ideal For

  • Applications requiring real-time, low-latency inference on large graphical models
  • Teams needing out-of-the-box graphical user interfaces for model visualization and interaction
  • Projects focused exclusively on predictive modeling without causal interpretation
  • Environments with strict memory constraints or need for embedded systems deployment

Pros & Cons

Pros

Comprehensive Model Support

pgmpy supports a wide range of graphical models including DAGs, Bayesian Networks, and Structural Equation Models, as shown in the quickstart examples for discrete, linear gaussian, and mixture data.

Modular and Extensible API

The library emphasizes a composable, scikit-learn compatible API, allowing algorithms to be used directly or combined in pipelines, facilitating integration into existing machine learning workflows.

Integrated Causal Reasoning

It provides built-in algorithms for causal discovery, validation, and inference using do-calculus, enabling end-to-end causal analysis without switching between different tools.

Active Development and Community

With badges for CI/CD, code coverage, and active community channels like Discord, pgmpy demonstrates ongoing maintenance and support, backed by organizations like NumFOCUS.

Cons

Computational Performance Overhead

Inference and learning tasks on large or complex models can be slow due to the high computational complexity of probabilistic reasoning algorithms, which may not suit high-throughput applications.

Dependency on External Libraries

Advanced features like Functional Bayesian Networks require setting backends like PyTorch, adding dependency management overhead and potential compatibility issues with other Python ecosystems.

Steep Conceptual Learning Curve

Effective use demands a solid understanding of graphical models and causal inference theory, making it less accessible for users without a background in these areas, despite comprehensive documentation.

Frequently Asked Questions

Quick Stats

Stars3,354
Forks1,185
Contributors0
Open Issues451
Last commit7 days ago
CreatedSince 2013

Tags

#bayesian-networks#simulation#probabilistic-inference#data-science#structure-learning#causal-inference#synthetic-data#python#statistical-modeling#probabilistic-graphical-models#parameter-estimation#machine-learning

Built With

P
Python

Links & Resources

Website

Included in

Python290.8kMachine Learning72.2kData Science3.4k
Auto-fetched 14 hours ago

Related Projects

PyTorch - Tensors and Dynamic neural networks in Python with strong GPU accelerationPyTorch - Tensors and Dynamic neural networks in Python with strong GPU acceleration

Tensors and Dynamic neural networks in Python with strong GPU acceleration

Stars104,599
Forks32,166
Last commit14 hours ago
scikit-learnscikit-learn

scikit-learn: machine learning in Python

Stars67,554
Forks27,506
Last commit2 days ago
keraskeras

Deep Learning for humans

Stars64,362
Forks19,798
Last commit1 day ago
streamlitstreamlit

Streamlit — A faster way to build and share data apps.

Stars45,948
Forks4,420
Last commit16 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub