A Python toolkit for causal and probabilistic reasoning using graphical models like Bayesian Networks and Structural Equation Models.
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.
Data scientists, researchers, and machine learning practitioners working on causal inference, probabilistic modeling, or graphical model applications in Python.
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.
Python Toolkit for Causal and Probabilistic Reasoning
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
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.
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.
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.
With badges for CI/CD, code coverage, and active community channels like Discord, pgmpy demonstrates ongoing maintenance and support, backed by organizations like NumFOCUS.
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.
Advanced features like Functional Bayesian Networks require setting backends like PyTorch, adding dependency management overhead and potential compatibility issues with other Python ecosystems.
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.