Skip to main content

A library for Probabilistic Graphical Models

Project description


Build Downloads codecov Version Python Version License asv

Join the pgmpy Discord server Read the Docs Examples Tutorial

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.

Examples

  • Creating a Bayesian Network: view | Open In Colab
  • Structure Learning/Causal Discovery: view | Open In Colab
  • Parameter Learning: view | Open In Colab
  • Probabilistic Inference: view | Open In Colab
  • Causal Inference: view | Open In Colab
  • Extending pgmpy: view | Open In Colab

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pgmpy_no_torch-1.0.1.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pgmpy_no_torch-1.0.1-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file pgmpy_no_torch-1.0.1.tar.gz.

File metadata

  • Download URL: pgmpy_no_torch-1.0.1.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for pgmpy_no_torch-1.0.1.tar.gz
Algorithm Hash digest
SHA256 868deff0fbef89eeb72b180a820219e774c767cde7bc1c53874f84f177086049
MD5 8802a392d908dc1f59e2ca1e0ebe94b6
BLAKE2b-256 f5a2701b0264f54dd18fdb92eb0436430e4565163cc1a133379dd5c5bb49165b

See more details on using hashes here.

File details

Details for the file pgmpy_no_torch-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pgmpy_no_torch-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for pgmpy_no_torch-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8f9fe5f9afa72a3668f068d10074270ab365d3a91c257f52c6283b1d2711d6ec
MD5 e85d3b1e1085944f9819256ae41e4e18
BLAKE2b-256 512e7d2f4d0c5a48af9e9b4ee13859197efd48ae939f2ff6cb0f5432f23a8e33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page