https://github.com/pgmpy/pgmpy/actions/workflows/ci.yml/badge.svg?branch=dev https://img.shields.io/pypi/dm/pgmpy.svg https://img.shields.io/pypi/v/pgmpy?color=blue https://img.shields.io/pypi/pyversions/pgmpy.svg?color=blue https://img.shields.io/github/license/pgmpy/pgmpy http://img.shields.io/badge/benchmarked%20by-asv-blue.svg?style=flat https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white

pgmpy is a Python package for causal inference and probabilistic inference using Directed Acyclic Graphs (DAGs) and Bayesian Networks with a focus on modularity and extensibility. Implementations of various algorithms for Causal Discovery (a.k.a, Structure Learning), Parameter Estimation, Approximate (Sampling Based) and Exact inference, and Causal Inference are available.


_images/pgmpy_workflow.png

Possible Workflows in pgmpy for Directed Acyclic Graphs (DAGs) and Bayesian Networks (BNs).


Supported Data Types

Casual Discovery

Parameter Estimation

Causal Inference

Probabilistic Inference

Categorical

Yes

Yes

Yes

Yes

Continuous

Yes

Yes

Yes (partial)

Yes

Mixed

Yes (only PC)

No

No

No

Time Series

No

Yes

Yes (ApproximateInference)

Yes


Algorithms

Causal Discovery / Structure Learning

Parameter Estimation

Probabilistic Inference

Causal Inference

PC with variants

Maximum Likelihood

Variable Elimination

do-operation

Greedy Equivalence Search(GES)

Bayesian Estimator

Belief Propagation

adjustment sets

Hill-Climb Search

Expectation Maximization (EM)

MPLP

Expert In The Loop

Sampling methods

Tree Search

Max-Min Hill-Climb

Exhaustive Search


Examples

Example notebooks: https://pgmpy.org/examples.html

Tutorial notebooks: https://pgmpy.org/tutorial.html


Citation

If you use pgmpy in your scientific work, please consider citing us:

Ankan, Ankur, Abinash, Panda. "pgmpy: Probabilistic Graphical Models using Python." Proceedings of the Python in Science Conference. SciPy, 2015.

Bibtex:

@inproceedings{Ankan2015,
  series = {SciPy},
  title = {pgmpy: Probabilistic Graphical Models using Python},
  ISSN = {2575-9752},
  url = {http://dx.doi.org/10.25080/Majora-7b98e3ed-001},
  DOI = {10.25080/majora-7b98e3ed-001},
  booktitle = {Proceedings of the Python in Science Conference},
  publisher = {SciPy},
  author = {Ankan,  Ankur and Panda,  Abinash},
  year = {2015},
  collection = {SciPy}
}

Indices and tables