pgmpy is a Python package for working with Bayesian Networks and related models such as Directed Acyclic Graphs, Dynamic Bayesian Networks, and Structural Equation Models. It combines features from causal inference and probabilistic inference literature to allow users to seamlessly work between them. It implements algorithms for structure learning, causal discovery, parameter estimation, probabilistic and causal inference, and simulations.
- Documentation: https://pgmpy.org/
- Installation: https://pgmpy.org/started/install.html
- Mailing List: https://groups.google.com/forum/#!forum/pgmpy .
- Community chat: discord (Older chat at: gitter)
Examples
- Creating a Bayesian Network: view |
- Structure Learning/Causal Discovery: view |
- Parameter Learning: view |
- Probabilistic Inference: view |
- Causal Inference: view |
- Extending pgmpy: view |
- Full List of Examples: https://github.com/pgmpy/pgmpy/tree/dev/examples
- Tutorials: https://github.com/pgmpy/pgmpy_notebook/
Citing
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}
}
Development
Code
The latest codebase is available in the dev branch of the repository.
Building from Source
To install pgmpy from the source code:
$ git clone https://github.com/pgmpy/pgmpy
$ cd pgmpy/
$ pip install -r requirements.txt
$ python setup.py install
To run the tests, you can use pytest:
$ pytest -v pgmpy
If you face any problems during installation let us know, via issues, mail or at our discord channel.
Contributing
Please feel free to report any issues on GitHub: https://github.com/pgmpy/pgmpy/issues.
Before opening a pull request, please have a look at our contributing guide If you face any problems in pull request, feel free to ask them on the mailing list or gitter.
If you would like to implement any new features, please have a discussion about it before starting to work on it. If you are looking for some ideas for projects, we a list of mentored projects available at: https://github.com/pgmpy/pgmpy/wiki/Mentored-Projects.
Building Documentation
We use sphinx to build the documentation. Please refer: https://github.com/pgmpy/pgmpy/wiki/Maintenance-Guide#building-docs for steps to build docs locally.
License
pgmpy is released under MIT License. You can read about our license at here
Metadata
Release files for pgmpy-no-torch 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pgmpy_no_torch-1.0.4.tar.gz | 1.9 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pgmpy_no_torch-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.9 MB
Release files / pgmpy_no_torch-1.0.4.tar.gz
| Download URL | pgmpy_no_torch-1.0.4.tar.gz |
|---|---|
| Size | 1.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3328032df0ef7a0f54829e9e54cc08d627dd3161978ed2f55b77367762d0d5dd
|
|
BLAKE2b-256 checksum How to use checksums |
74cc938c7256457e80b25b09793e204cef36ddae3e415b00fe210e30bfd287a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / pgmpy_no_torch-1.0.4-py3-none-any.whl
| Download URL | pgmpy_no_torch-1.0.4-py3-none-any.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
764ec07685e3f950440e5aab089721f6104b0e3fb74d72fe83ae675ec00b690c
|
|
BLAKE2b-256 checksum How to use checksums |
6eff5f18efa5e9834643b41e416936e5d7f74247735084e44e72298500c99a9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Security for pgmpy-no-torch 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.