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.dev202410081727562243
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.dev202410081727562243-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
374e2b9eef476e57766692918599f8275a80638b205b90bf789f4273e16873c2
|
|
BLAKE2b-256 checksum How to use checksums |
7e182c4c436181142409b3aea61e9d82986e088216f266cf9171a4ffdfb6f275
|
| 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.dev202410081727562243-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
fb3238631e022a6ad1dfc88303a1b7d348afec1c9642211253bfa486261cf119
|
|
BLAKE2b-256 checksum How to use checksums |
d57ee7e4768f406260fa873daf7232a8805238ec27d22149b0390249f5d61e73
|
| 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.dev202410081727562243-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
7299acce02bbaeae557893cd78edd0618e929a4ede675910c3daea010a51042a
|
|
BLAKE2b-256 checksum How to use checksums |
45cadbf10c9ba6ade171206dd95d4126c2edcf506953dd36e255ae702a07579d
|
| 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.dev202410081727562243-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
b960d166133ecad281665b46e2eade78b50e486101c15a19069a2f0527ec514c
|
|
BLAKE2b-256 checksum How to use checksums |
07a3639bf17805d24de93c50de19ce368c5cd01e610efadceaa33a3985d51191
|
| 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.dev202410081727562243-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
8ec10eefdf999e7e2910698279d8e02262b2c981143e7264634fc236a385e0f7
|
|
BLAKE2b-256 checksum How to use checksums |
b4f5275cae680ff56219c606391de37b678fd6b47e7e7550a7deaa0ea33ec666
|
| 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.dev202410081727562243-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4d5640a1ba486f4bb7bde5a1efbb4308abe31506273e8175e468a0cf83770fb4
|
|
BLAKE2b-256 checksum How to use checksums |
e4c3a5bc6b1460901d453d95540ed6509df519b1a162c25906519b982110a639
|
| 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.dev202410081727562243-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
2230004472261477e566785c337d6e7e5a633669f742a23f28d08090ffe7a421
|
|
BLAKE2b-256 checksum How to use checksums |
00f38160ebc91b42b976523b77aca56ce9d5946931248c0acc29b6238fa92b1f
|
| 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.dev202410081727562243-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
909335d8567f86184a7f1c37c6d6e81023d32cde947177633a9e317d0d6d2eff
|
|
BLAKE2b-256 checksum How to use checksums |
9f633124a18eed369ac7d14bde951d9607137c2bc23aa52d0bcc6008842aee90
|
| 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.dev202410081727562243-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
1c630e61b30d54ca221267b862f7a2e059afb24641a24c224efa1ecc3409c7d3
|
|
BLAKE2b-256 checksum How to use checksums |
e740a310efb08637260a996a0a1baae9f359428ed33c40bfb246da17cef642c9
|
| 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.dev202410081727562243-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
1b56d3c6c4af77334627d641da749885667e9fa9ed65312775d983b351801419
|
|
BLAKE2b-256 checksum How to use checksums |
88a0fa4ad58fb0e6429b3324c0f176247cf346208630bc2e1da5c2ef4f939c00
|
| 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.dev202410081727562243-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4fab184ff9b33badfe0323d6cbbe75654dafd56f2d2aba3dc9996e67d12a1fcb
|
|
BLAKE2b-256 checksum How to use checksums |
fec924e9888456b3a829b4b71d6c2503701a78248c34831f9468966b403bc5b6
|
| 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.dev202410081727562243-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
4ef9d19822a075b770b3cfd92aac95cc63cb5ef715ac3623c15d3db0560ce9db
|
|
BLAKE2b-256 checksum How to use checksums |
f0d05ea262b13efc8e9086aae3dba8365261b6fb809f5cebbbb5913e6690ee82
|
| 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.dev202410081727562243-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
b801cef2b0779a62596afc3b27d374f18789b3da8f43c6b0262674dd7db17e08
|
|
BLAKE2b-256 checksum How to use checksums |
fd68e53059824ea9bde030eb58deeb390b1e541f8009ae1060bd0214590eaf55
|
| 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.dev202410081727562243-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
9df0bf256bc9d94e93bd20e950a98a9e87ecfaeb68381641f674dbc6290bf60b
|
|
BLAKE2b-256 checksum How to use checksums |
07309b15100b4d2ddfb05995f4c96c549b735814d4af05ffed5731a853054a67
|
| 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.dev202410081727562243-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410081727562243-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 |
5c22be2dc9e3a344f28feeac0da9bbca2477f69474d8014182e43093c101cecc
|
|
BLAKE2b-256 checksum How to use checksums |
b36530db958ea180cf1020e11ff25a93c949f9e9804584796804a790536b7e4e
|
| 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
|