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.16.0.dev202410031727562243
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 70.2 MB
Release files / pyAgrum_nightly-1.16.0.dev202410031727562243-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
517dcd3d851857eab7283c975c1993c7af8ee98a33e0fe1dc42ea196ed69a12b
|
|
BLAKE2b-256 checksum How to use checksums |
b228e858e34c4380edb47c9b3916cdc2967275a09e9f7eedcd883ec839b613c9
|
| 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.16.0.dev202410031727562243-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-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 |
abf2e7a5ae30a89c153a2acf15342a84ef64d9a584a205470388a04c91a4213d
|
|
BLAKE2b-256 checksum How to use checksums |
41b35b90102f143bd699e6cd8bdf456da8805b0571e56297f80177b2cc35881a
|
| 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.16.0.dev202410031727562243-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-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 |
77de12ed5ee9001f54a67acf256e98e446f985fa240bfad3a7aec97b6b4d9cd7
|
|
BLAKE2b-256 checksum How to use checksums |
c3b3d95bcd4af18590cc91aab13f82c5673a33262e7a0b14d0de2aa90a852ff2
|
| 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.16.0.dev202410031727562243-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d7ae234d37b363a8c71cc4b22f81b6592171fc65faf0bec38ac4e1079457140e
|
|
BLAKE2b-256 checksum How to use checksums |
a14cf06035a5fa68e59e4a6b56bf02ad9ecd29874c8cca8c0c46b0f88599d09d
|
| 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.16.0.dev202410031727562243-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-cp312-cp312-macosx_10_9_x86_64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.12 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
d5fbc5111578c59c9adb4f3c1a7e8b67d27523706fb661b6416b37732c36cd81
|
|
BLAKE2b-256 checksum How to use checksums |
160c1813fd099ac7423f357d6dc763241ec18238f925bb656b7546b91e8cfa28
|
| 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.16.0.dev202410031727562243-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2aa7489ba87a4f9b3d1c00d3200ad404c8d84a7ede5754d01dc4232908c9007a
|
|
BLAKE2b-256 checksum How to use checksums |
230e248fb16ce266120a7ac1fff3fa371cf4a97b92c837e925153edd72641291
|
| 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.16.0.dev202410031727562243-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-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 |
7512606439985f68ef663e60e253c480ab3a61ef0ae8f6de9337b350824536d6
|
|
BLAKE2b-256 checksum How to use checksums |
c7654ca277db1306d5382460984224377e4fbbdb208931d147202aafe154bc9b
|
| 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.16.0.dev202410031727562243-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-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 |
60f68159d67cfd496cd40a4f670d8d6b4cbd0f6757d62cb029512374a9b77cf8
|
|
BLAKE2b-256 checksum How to use checksums |
4fdcad87bc24469f48be1ac6740766ae8d5d775863a9737c7c50dcc956143e1f
|
| 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.16.0.dev202410031727562243-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7ed12267c42a862c232e04f98c14c7342ba7bc007bf0b536a22b6c48ea98f484
|
|
BLAKE2b-256 checksum How to use checksums |
1112b85ddc49be8193ac9883e935b4de6a9ad6cdbe50233c5e346af417d7ce16
|
| 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.16.0.dev202410031727562243-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
28ae822cd764dd6137e1532e2c878329d663668e5a0af6002e2a6d068c304d82
|
|
BLAKE2b-256 checksum How to use checksums |
da769c1973602d542c05b44b16109cd241e28668992c2166868e45e1b7015ba5
|
| 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.16.0.dev202410031727562243-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
25ddeb65353882e35e8b1f2fdba45322d5a06e2ab918b7bde7320e0cc77518ae
|
|
BLAKE2b-256 checksum How to use checksums |
55473866bb299312ec978307a5146630c2d66081025d962cbb81a24cc151bacd
|
| 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.16.0.dev202410031727562243-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-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 |
1e458a5130633188f3c9c15972c088fef8ce632acfdc5ed9525d954f0fca5b6b
|
|
BLAKE2b-256 checksum How to use checksums |
946e84fac9ed755cf845cec2181f42001919a6421f0c5524717e49d9b219a740
|
| 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.16.0.dev202410031727562243-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-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 |
9d1c7806abbd02ec281c20f492fe9a2b12d725ffeaa674bb33dc2ac08d16e7cc
|
|
BLAKE2b-256 checksum How to use checksums |
610a4f04d047202084c39f197422e9a8653e93faa5e52716d16e0f9e1facfc96
|
| 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.16.0.dev202410031727562243-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1fb4f5b4c9ef502f7b5a5e84aceee22c5a6c3dcb679e741fd69a3442ca28648e
|
|
BLAKE2b-256 checksum How to use checksums |
ec2eaf936bb922961d72fa003d2da11b14d45dd5b0bf6833bbf5cb4c18be2abb
|
| 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.16.0.dev202410031727562243-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410031727562243-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
5d4ffcccfe0ab1d2cbade5707039660ecdfb5f6eb924eef65123069812b74bbd
|
|
BLAKE2b-256 checksum How to use checksums |
dfbda9e16817b6d5f4b5b19fd059a45b4d3f0c82bff6aff8bed2715f69b407e0
|
| 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
|