This release is a pre-release and may not be stable for production use.
pyAgrum
pyAgrum is a scientific C++ and Python library dedicated to Bayesian Networks and other Probabilistic Graphical Models. It provides a high-level interface to the part of aGrUM allowing to create, model, learn, use, calculate with and embed Bayesian Networks and other graphical models. Some specific (python and C++) codes are added in order to simplify and extend the aGrUM API.
Example
import pyAgrum as gum
# Creating BayesNet with 4 variables
bn=gum.BayesNet('WaterSprinkler')
print(bn)
# Adding nodes the long way
c=bn.add(gum.LabelizedVariable('c','cloudy ?',["Yes","No"]))
print(c)
# Adding nodes the short way
s, r, w = [ bn.add(name, 2) for name in "srw" ]
print (s,r,w)
print (bn)
# Addings arcs c -> s, c -> r, s -> w, r -> w
bn.addArc(c,s)
for link in [(c,r),(s,w),(r,w)]:
bn.addArc(*link)
print(bn)
# or, equivalenlty, creating the BN with 4 variables, and the arcs in one line
bn=gum.fastBN("w<-r<-c{Yes|No}->s->w")
# Filling CPTs
bn.cpt("c").fillWith([0.5,0.5])
bn.cpt("s")[0,:]=0.5 # equivalent to [0.5,0.5]
bn.cpt("s")[{"c":1}]=[0.9,0.1]
bn.cpt("w")[0,0,:] = [1, 0] # r=0,s=0
bn.cpt("w")[0,1,:] = [0.1, 0.9] # r=0,s=1
bn.cpt("w")[{"r":1,"s":0}] = [0.1, 0.9] # r=1,s=0
bn.cpt("w")[1,1,:] = [0.01, 0.99] # r=1,s=1
bn.cpt("r")[{"c":0}]=[0.8,0.2]
bn.cpt("r")[{"c":1}]=[0.2,0.8]
# Saving BN as a BIF file
gum.saveBN(bn,"WaterSprinkler.bif")
# Loading BN from a BIF file
bn2=gum.loadBN("WaterSprinkler.bif")
# Inference
ie=gum.LazyPropagation(bn)
ie.makeInference()
print (ie.posterior("w"))
# Adding hard evidence
ie.setEvidence({"s": 1, "c": 0})
ie.makeInference()
print(ie.posterior("w"))
# Adding soft and hard evidence
ie.setEvidence({"s": [0.5, 1], "c": 0})
ie.makeInference()
print(ie.posterior("w"))
LICENSE
Copyright (C) 2005-2024 by Pierre-Henri WUILLEMIN et Christophe GONZALES {prenom.nom}_at_lip6.fr
The aGrUM/pyAgrum library and all its derivatives are distributed under the LGPL3 license, see https://www.gnu.org/licenses/lgpl-3.0.en.html.
Maintainers
Lionel Torti
Gaspard Ducamp
Metadata
Release files for pyAgrum-nightly 1.17.2.9.dev202503201739452835
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 92.0 MB
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp313-cp313-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
798a73060de187923121efed2005bacd4b9ab3ea23f67038ae305aa5d61d504b
|
|
BLAKE2b-256 checksum How to use checksums |
b6c46fa3676e83b40f47b3b80e38a3781630548cfe109e8c94e0e248549046e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp313-cp313-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp313-cp313-manylinux2014_x86_64.whl |
|---|---|
| Size | 6.0 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
10327f8a5778b70c64b9a5ee6b13981e573ae174d79606820fcb7c056a490a71
|
|
BLAKE2b-256 checksum How to use checksums |
96a1afe3fb07055f397e6f18d7e77aca6d644fc473d4da99fae290a23f388526
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp313-cp313-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp313-cp313-manylinux2014_aarch64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
4f398a2ece3b40d30351a4234809441ab64d0252498101e6088eb34a4cf86383
|
|
BLAKE2b-256 checksum How to use checksums |
e78b6563f9a5dcb9c8282684e21dec9203364aada4db1680538f02e66d79c674
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3d0184eaf297f0183c43843b8e48aed8de4b9359f7a809e5b116eb3712151e14
|
|
BLAKE2b-256 checksum How to use checksums |
0a4fc0a1e6a88aee8f1c643084ce827a2a7c6418aaa31e08d2138fc423d349e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp313-cp313-macosx_10_13_x86_64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
70a43540df270645b22faf0556626adcf1a7caf2fc67c9645da2874acb827612
|
|
BLAKE2b-256 checksum How to use checksums |
e343588b42b915b25189051e76913110a7475677fd5f48e338550b11e404a13c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
60eea80d988958dafb9c91d54ea8813e4ffb7d4262dd49f05caaed138bbfe6d8
|
|
BLAKE2b-256 checksum How to use checksums |
e990ffdb4b3f411c96dbaedda66600b533ad2aab40d256a05c5be06c9c32a394
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp312-cp312-manylinux2014_x86_64.whl |
|---|---|
| Size | 6.0 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
7d379d0be8458af4e283f0922a33eee3e37f2bb5f8efc0f253a418a7ffb7d6f2
|
|
BLAKE2b-256 checksum How to use checksums |
0b63aa65d44c70e49ea0caa6c7be76870c67fcddcb47f4320e3a724908077509
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp312-cp312-manylinux2014_aarch64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
db82dfc7fbcaf341090c1f1f186ac255923ed576f5a0ed7654147c033d9a88e5
|
|
BLAKE2b-256 checksum How to use checksums |
93db3d3ba679d0b94b12307a3b9bbe7e1cc4d33ed4424e96257bbb654342fcf9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
29e77b1468d6edd394e98f179dfe87fdfdf32923ff15b025be81f2c2fa7bdeaa
|
|
BLAKE2b-256 checksum How to use checksums |
4c234595d2bd6049cb9400ab38740fe473e020dde47668c51561f7e06e18853f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp312-cp312-macosx_10_9_x86_64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.12 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
5ea2d9041cda45c0a9713074b02ff541ed00a4749f24d8efe12af4078d556719
|
|
BLAKE2b-256 checksum How to use checksums |
bf67604bd597803fbc80ba6014026d63c0944376bc57423d2b6c5d81540c66e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5f0a12a19f0a4cfef872f740ab200175e10cd9b88976466c0fdad12e252e9872
|
|
BLAKE2b-256 checksum How to use checksums |
4a908a60e685868fac2af6c596e43be6dd37427187c536b4d0b18c30862893cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp311-cp311-manylinux2014_x86_64.whl |
|---|---|
| Size | 6.0 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
a9d054414287200456f4beaf8f4b8d456e60cb7e303fcb649c975ffb116d453b
|
|
BLAKE2b-256 checksum How to use checksums |
513b76a77d36c0083c230a71c68891923d2027775dce669db6bde18e114b0c91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp311-cp311-manylinux2014_aarch64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
7696f023186ecf90db3fd462bfd335b9d98e5ade34120e74482b2ad9f1dc724d
|
|
BLAKE2b-256 checksum How to use checksums |
e5fc77b11d2c9e2ace80185b12baef89ab6bb9c8ac9b64fe52da678a7dedd634
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a60f6b53bf820a74ba9e5968e1b6ceee0f31109e553c059fb325d80790b54850
|
|
BLAKE2b-256 checksum How to use checksums |
d3be259efd41637d6c798612d9b9d8470d7dd4181cfb0702d1249e2abb94039c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
a15438727aa89fb5dd7b4626b3f943906c82c25c26a066c79c00a2da7b7eeb00
|
|
BLAKE2b-256 checksum How to use checksums |
919bc844f660a9560540f523a7eabde50efce7286bc3a5c6f56856b610e51d31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
72d737aa7cf3935e45f092f9c4ccb6e9a62c61dc50b2321c176719f42ceb2b63
|
|
BLAKE2b-256 checksum How to use checksums |
aee42e3f394c6708328b35b86a4354c6acade56dec6b72ad8155863bfdcb86e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp310-cp310-manylinux2014_x86_64.whl |
|---|---|
| Size | 6.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
65d69be8df8f3fdcfa15786b099e9323add4e73f47aa58ffe1d71ecf8968cfa3
|
|
BLAKE2b-256 checksum How to use checksums |
055b8a72f67c22af1336bf7cd3ff8080388c2cb301d3de932e600317a05c1f65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp310-cp310-manylinux2014_aarch64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
dec6e566983e84ed33d03a8931fcc30e20dcadfd6b53d44f5037c2e19964be08
|
|
BLAKE2b-256 checksum How to use checksums |
5f7f36f8d10499b6d4b47eeaebc0306cc7aaa746e0e778b74c2fe08c2306ecc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
48579b5a8a7953133ee1c6e3628a8623369954f9afe899e48509702f14a075d3
|
|
BLAKE2b-256 checksum How to use checksums |
4c3c8e8eab94d09346235068fa112c6db7abe6dedb1825cabbde130e1e39cd65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|
Release files / pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp310-cp310-macosx_10_13_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.9.dev202503201739452835-cp310-cp310-macosx_10_13_x86_64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.10 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
d6ec7a67c69a82649728c1e26f715cfea03921a8c54de37bc0ec6df296b3d0c3
|
|
BLAKE2b-256 checksum How to use checksums |
7fc2746a51e7d93108b3ee028e51d2985630ed80bcecb72e32a40e8948f6fcb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.15rc1
|