skillfed

pyAgrum-nightly

Bayesian networks and other Probabilistic Graphical Models.

pyagrum-nightly v3.0.0.9.dev202608141786444173 310.0K downloads/30d#7,749 on PyPI
License unclear LGPL-3.0-only OR MIT Active released

What it is and what it does

pyAgrum wraps a C++ probabilistic graphical model library and exposes it through a Python API for Bayesian Networks and related models. It lets you construct networks by adding nodes and arcs, populate conditional probability tables, save and load models in standard formats (BIF), and run inference algorithms to compute posterior probabilities given evidence.

The library is designed for researchers and practitioners in AI, statistics, and decision analysis who need to model uncertainty and reason under incomplete information. It depends on numpy for numerical operations, matplotlib for visualization, pydot for graph layout, and scikit-learn for machine learning integration. The package supports modern Python versions (3.10–3.14) and runs on macOS, Linux, and Windows.

Use it for:

  • Build and query Bayesian networks to model causal relationships and perform probabilistic inference with hard or soft evidence
  • Learn network structure and parameters from data using the library's training capabilities
  • Diagnose faults or predict outcomes in systems where uncertainty and conditional dependencies matter
  • Visualize probabilistic graphical models and export them to standard formats for sharing or downstream analysis
  • Integrate probabilistic reasoning into financial, insurance, or risk-assessment applications

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pyAgrum is a Python library for creating, learning, and performing inference on Bayesian Networks and other Probabilistic Graphical Models, with a C++ backend and high-level Python interface.

Yes, if you need Bayesian Networks or probabilistic graphical models in Python. Active maintenance, no known vulnerabilities, dual licensing (LGPL/MIT) gives flexibility, and broad platform support. Caveat: this is a nightly build (released today), so verify stability for your use case; production users may prefer the stable release track.

Install

pyagrum-nightly on PyPI

pip

pip install pyagrum-nightly

uv

uv add pyagrum-nightly

poetry

poetry add pyagrum-nightly

Installing pyAgrum-nightly

Before you install

Medium install friction due to compiled wheels; nightly build released today (0 days since release). Active maintenance status. Requires Python 3.10 or later. Pre-built wheels available for macOS (x86_64, arm64), Linux (x86_64, aarch64), and Windows.

License in practice

Dual-licensed under LGPLv3 and MIT at your choice. License treatment marked unclear in metadata, but description states you can integrate into your software under either license or both. No GPL contamination if you use only the pyAgrum interface, not native third-party interfaces.

Quickstart

pip install pyagrum-nightly

import pyagrum as gum
bn = gum.fastBN("w<-r<-c{Yes|No}->s->w")
bn.cpt("c").fillWith([0.5, 0.5])
ie = gum.LazyPropagation(bn)
ie.makeInference()
print(ie.posterior("w"))

Requires Python 3.10 or later. This is a nightly build; consider testing before production deployment.

Verify before relying

  • Whether the nightly build is suitable for production use or intended for testing only
  • Specific performance characteristics or scalability limits for large graphical models
  • Whether all four runtime dependencies (numpy, matplotlib, pydot, scikit-learn) are required or optional

Package facts

License LGPL-3.0-only OR MIT (unclear)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 4 — numpy, matplotlib, pydot, scikit-learn
Maintenance actively maintained — 0 days since the last release
First released
Downloads 310,025/month — #7,749 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyagrum_nightly-3.0.0.9.dev202608141786444173-cp310-abi3-macosx_10_15_x86_64.whl; pyagrum_nightly-3.0.0.9.dev202608141786444173-cp310-abi3-macosx_11_0_arm64.whl; pyagrum_nightly-3.0.0.9.dev202608141786444173-cp310-abi3-manylinux2014_aarch64.whl; pyagrum_nightly-3.0.0.9.dev202608141786444173-cp310-abi3-manylinux2014_x86_64.whl; pyagrum_nightly-3.0.0.9.dev202608141786444173-cp310-abi3-win_amd64.whl

Keywords: probabilities, probabilistic-graphical-models, inference, diagnosis

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Financial and Insurance IndustryIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)License :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: C++Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: MathematicsTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

bayesian networks pythonprobabilistic graphical modelsbayesian inference librarygraphical model learningprobabilistic reasoningbelief network toolsgraphical model inference
bayesian-networksprobabilistic-inferencegraphical-models

More Libraries packages