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.dev202501161731932516
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 93.8 MB
Release files / pyAgrum_nightly-1.17.2.dev202501161731932516-cp313-cp313-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
84d950c47acdc0712a8508ac9144382b3b32ad9cd9616e23a3ff7c09eaa9f2fe
|
|
BLAKE2b-256 checksum How to use checksums |
8ed584876b309553ca60ac7d6eb77efc6b28876891a65758a0bc3d0607e2df52
|
| 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.dev202501161731932516-cp313-cp313-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
bcde99089ea5283c8c42c9fc02db8482be0350d2cc7c718c7063e848940e56b9
|
|
BLAKE2b-256 checksum How to use checksums |
327690752d719694738e2a373059f1c251239484fe55e00a65ae0bf2064a9897
|
| 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.dev202501161731932516-cp313-cp313-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
55393c8a83c01e10abfab37c6f01ee2bfa213dd9ef10516640d3f054ab78b320
|
|
BLAKE2b-256 checksum How to use checksums |
3556772fde8d3e68df33034499a051c28487591d76b0fcec494e8b57b6e54d85
|
| 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.dev202501161731932516-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0075c60bb99c6ed3dcb141f408b3faa4650bcc09b4d1bc873c8b3b1d717b301f
|
|
BLAKE2b-256 checksum How to use checksums |
c3cb2a3a5473f568345dc8bf362bf5b879f586a48f92408a05e570170358bd7a
|
| 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.dev202501161731932516-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-cp313-cp313-macosx_10_13_x86_64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
b0407dd4a639ab87e0d2b2388dc085d1624f8fc06341e7fd8d9eca53a7eb0cc0
|
|
BLAKE2b-256 checksum How to use checksums |
85b24e05589d0a1db9db9a508e18794d961d915e1ac7482ff6987a6d3e0bf509
|
| 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.dev202501161731932516-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
23dadb6a9402769bb3035540919a1134d70ed4a4001da1ead97c015e2514b66d
|
|
BLAKE2b-256 checksum How to use checksums |
e7009cd35ab34bc305adb269737fca333a27cbc228c073cf16f111b61d7fcdc5
|
| 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.dev202501161731932516-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
ad50794cd0a10b56952b8e0e58aa5f1a066a8d12a1111aa3e2da9ed6c0bd23e1
|
|
BLAKE2b-256 checksum How to use checksums |
5593c741c2b01f0a385f455e470a44cd324bacc7ffcaba750b9909a1b4630e98
|
| 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.dev202501161731932516-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
031a4bbff15223d4e6a9a2f244e940267271dbba39ce9c6f21a637c754f3fce6
|
|
BLAKE2b-256 checksum How to use checksums |
27dd07c41c2488020c7fc21531ed71a7b7315fd6dd2ca046bf49143242274fe4
|
| 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.dev202501161731932516-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
a49ededd4f96dfa1827595a6371c3540ec55dc261882c0d354646029a1110f1f
|
|
BLAKE2b-256 checksum How to use checksums |
eebb71926df5439edbf45180b34a173fb5a9aa6c40156891bf7163737ca09543
|
| 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.dev202501161731932516-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
822e94f39eef91a40c5368bdd251f0dd877a4e175ccafb5af3f58d26857541b5
|
|
BLAKE2b-256 checksum How to use checksums |
c95157eb9a7e0420a4efcd03f0648a7a7e0f7f2d77c403df9a8faf130406c231
|
| 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.dev202501161731932516-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
431cc0407e71bcb543b66b1eca26668a24c56a619f5736c8fabc491de042bd49
|
|
BLAKE2b-256 checksum How to use checksums |
54ce5e638a94936d8a6def22d3c5f52e3f9848610d92da37262c2f8ae0d2e002
|
| 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.dev202501161731932516-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
8d94271ec88f96d10b6e16c182264dc4d4fab1b08ab8a045e3705f626c5c2a69
|
|
BLAKE2b-256 checksum How to use checksums |
3263af758b0c13c1ba7b6f080edb42b11fb464e53db02e9f50a210f6e48a2b38
|
| 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.dev202501161731932516-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
1bcd7219345275ad321094dc681fe2eb684e919b6e09cac2f6eff157ab9d437e
|
|
BLAKE2b-256 checksum How to use checksums |
649ba36fe7c07e87d30c8b8f0847b92bc2cc605902a3bf2e14c9b5ca1894a2f2
|
| 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.dev202501161731932516-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
fb50da6a5ecdd78ebe8d96d12ae395b2b881c44049bac42758f9a198df52c756
|
|
BLAKE2b-256 checksum How to use checksums |
1406bc55a051160e32b74d156f2002093567b255e84541beabc4144af81a7564
|
| 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.dev202501161731932516-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
6abfdf797187865f5706b4fa8d5ae5ccba50cffa1e94a63d34bdcc527dbe5dd6
|
|
BLAKE2b-256 checksum How to use checksums |
c17acfcacc96bce850118d205058c57ef58c2dbeb856f452ac27784720a573c1
|
| 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.dev202501161731932516-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
48b7cfa6986ec8d7553cd1bc2aa28b0bfe33200f24700c064c7285c820a1af18
|
|
BLAKE2b-256 checksum How to use checksums |
67f8f181723d357272daba5620f7139dd7992d00237ccf22319610622c461ca1
|
| 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.dev202501161731932516-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
7919e4ae5e7dae8e59de74afd62bbefbae566c6d42f541890a2852573bb3deac
|
|
BLAKE2b-256 checksum How to use checksums |
16cda8f60b1f0691734d29579599fa32fad29dcddc75cbc08e6931adbe474534
|
| 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.dev202501161731932516-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
763dfd5db4340a00af914dd06c82867580c7890ac962caca85202429718fb44d
|
|
BLAKE2b-256 checksum How to use checksums |
c0997f27e48800fb547dc73d0666a965886600b13cab1c9ed6e6133ae6ee1e8c
|
| 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.dev202501161731932516-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
cce17fb5d481d16f82a7768b665a894d66367a714e6f1fc977489a1b5a5d28de
|
|
BLAKE2b-256 checksum How to use checksums |
d684a0b90f5a50f08c468494497a3e9ef108234b423ea35725e2b8adb270af25
|
| 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.dev202501161731932516-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501161731932516-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 |
ea262a022222be9589183ccebbec0c3068fa39e8ee1adc4ad80dc860e8b124c8
|
|
BLAKE2b-256 checksum How to use checksums |
5fd51f1266b783c039443a419d4ae760f227a2eac4f9dc654975e9dcc35ade98
|
| 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
|