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.
Supported Data Types¶
Casual Discovery |
Parameter Estimation |
Causal Inference |
Probabilistic Inference |
|
---|---|---|---|---|
Categorical |
Yes |
Yes |
Yes |
Yes |
Continuous |
Yes |
Yes |
Yes (partial) |
Yes |
Mixed |
Yes |
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:
Ankur Ankan, & Johannes Textor (2024). pgmpy: A Python Toolkit for Bayesian Networks. Journal of Machine Learning Research, 25(265), 1–8.
Bibtex:
@article{Ankan2024,
author = {Ankur Ankan and Johannes Textor},
title = {pgmpy: A Python Toolkit for Bayesian Networks},
journal = {Journal of Machine Learning Research},
year = {2024},
volume = {25},
number = {265},
pages = {1--8},
url = {http://jmlr.org/papers/v25/23-0487.html}
}