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.15.0.9.dev202408071721169663
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.6 MB
Release files / pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5c4cbf3009834f298591891641c810b51fb5dbae7aa6ee41f51f20cec3b206cc
|
|
BLAKE2b-256 checksum How to use checksums |
584cdbd84513b12ef5eebf782d0a26e89be0629c3b75077f34be5b7ae0cc5065
|
| 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.15.0.9.dev202408071721169663-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp312-cp312-manylinux2014_x86_64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
8de100447274bcb43c837d11174b29f1e7fa628d877736f31bc6203ef0a5473f
|
|
BLAKE2b-256 checksum How to use checksums |
5cf489af1e618989166f73afa70a8c9e5ac81676b32ae6e9fae71a4b5a28fa10
|
| 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.15.0.9.dev202408071721169663-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-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 |
f67938a84dc960c470fe4c8b94858b083b1fae2fc2d37c921e2362c000f3b239
|
|
BLAKE2b-256 checksum How to use checksums |
34b569f92caa8a5039134795027c8209a9c736ebb36c6c721dc553ee772a0358
|
| 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.15.0.9.dev202408071721169663-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-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 |
1664a630fa47e25a0acdb9b484e1ba464d2b7538bd9bdae436d24953a571e1c0
|
|
BLAKE2b-256 checksum How to use checksums |
12e2e05247a13e7dab77c489c823f9226c9ec98b1e87ce3affdb5a299996f376
|
| 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.15.0.9.dev202408071721169663-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-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 |
efabd8378d5628396e57fdd62729f5479c1571574dfbba3e091c7f00d9e66864
|
|
BLAKE2b-256 checksum How to use checksums |
3bdc13a06cfc5fa9f4fc67424f45accade5ea638e13f7eb32d20e94c36412ed2
|
| 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.15.0.9.dev202408071721169663-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
80cf859094b9e77eaff67f07d1bba6994b0b30563924b1f71fe508597760e7bc
|
|
BLAKE2b-256 checksum How to use checksums |
c7b316f28bd0f5f67a3f97941025231959679720e846ab035dbdc5e75517e73f
|
| 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.15.0.9.dev202408071721169663-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp311-cp311-manylinux2014_x86_64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e093c6b431c512bd7980ebfbf2ed08c79297a9ac9640197ef6ac58af8935fc8f
|
|
BLAKE2b-256 checksum How to use checksums |
cc4e3ee4729559a413d8714ae4e277d357aefc5dc5c0ce91015d12a7825dae1f
|
| 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.15.0.9.dev202408071721169663-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-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 |
52a0c0734169cba73bf827b76f4a30ac0f78ba9819ec80d6ac60cd3f262bf314
|
|
BLAKE2b-256 checksum How to use checksums |
f1e54950c51a548ef2218b9fb7dc00feb6086e1ce63dd739ba2af805f1f5323e
|
| 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.15.0.9.dev202408071721169663-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-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 |
eb95ab07812559ae0a2fb2ce3221a3a2f4f742da90e6b01ba790e05f7d4d0bfa
|
|
BLAKE2b-256 checksum How to use checksums |
9d8f2641f7a56ef4d0ee9466d95592124c1df0de0697b1e76e59cb9c30ef90d0
|
| 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.15.0.9.dev202408071721169663-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-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 |
b2fec6122b3da080850241d141ecc8dbb5323252345b8aa6644ae9ccc57a6c4d
|
|
BLAKE2b-256 checksum How to use checksums |
bbcf42691617cac005543edceb34a28121600c7cee10be2e55acf601c39a6ee4
|
| 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.15.0.9.dev202408071721169663-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
65c26faa14237f2653ceeb72a0f0d5c8e2e987783fea9c70db9a36ced19031ab
|
|
BLAKE2b-256 checksum How to use checksums |
1347e197beadbf584e00d132c2d02a0415a2b50962d1327f8489f0fc5af27f2a
|
| 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.15.0.9.dev202408071721169663-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp310-cp310-manylinux2014_x86_64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
9224dd220e9d518d54eefd79d92a35dda2575981f27052a64d8abaaa0242e8e7
|
|
BLAKE2b-256 checksum How to use checksums |
2039b0dae08e8c5c926b369b52d89130d6fcf0b6035df615f0db17289d20b36d
|
| 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.15.0.9.dev202408071721169663-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-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 |
1938f50f9be0f7320b458ddc34f75831b18d3c5fc8077f1555cbb4756b37667a
|
|
BLAKE2b-256 checksum How to use checksums |
682cc7d42e101bd88f5091a1cf6056682a0b246cfcf1534e8aea32c6bd1cc01c
|
| 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.15.0.9.dev202408071721169663-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-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 |
df30f98aaa4a3ae07cd5678388d62e1b8ef52d2072255e7c021de409a7882b4c
|
|
BLAKE2b-256 checksum How to use checksums |
f836a77f864346786af1cf319ad9e2df64f12dc159f610491ca7643f9f0dca73
|
| 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.15.0.9.dev202408071721169663-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-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 |
565f8878d90fbb14c21a2fcdc3fe4688075a0a99b16fc4e4adff75d4ddc1d054
|
|
BLAKE2b-256 checksum How to use checksums |
8b5c21408558ab613d5e511b825549f2df4d93ee0641e649a473d4061163f2b6
|
| 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.15.0.9.dev202408071721169663-cp39-cp39-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
688a1dd5a39178b6954f35be0b0f9c12a5c06913501a484bc14e6760ad4ab127
|
|
BLAKE2b-256 checksum How to use checksums |
01da2a37560d98a3a56b7606506e6854b2cb7ed8e333331450d6085a7b77731f
|
| 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.15.0.9.dev202408071721169663-cp39-cp39-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp39-cp39-manylinux2014_x86_64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
1871b345663da93764e94518cfccc02dcc1228720a43f0ed9c9e767531ec71e1
|
|
BLAKE2b-256 checksum How to use checksums |
d50dbda9882ca87a055c798fa139d5f3ee8bdbe28e2dc70aeb7631845b1368db
|
| 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.15.0.9.dev202408071721169663-cp39-cp39-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp39-cp39-manylinux2014_aarch64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
f76f6e798bf922a5bd2734d2dfb6fc52cdc64b452d7f946788bd2959596cb738
|
|
BLAKE2b-256 checksum How to use checksums |
01cc8ef7292fbe835a0fa448ad9b95e61b5f369d283f2387813113c40879da4a
|
| 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.15.0.9.dev202408071721169663-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp39-cp39-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.9 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f2ac5faaa3c05c931cf2ba794822808396d6c901f02f9f414139751268ffbf0e
|
|
BLAKE2b-256 checksum How to use checksums |
7f9f21de150fd165e1d39e5d6d2cdae9ffca44fc4543e4e2a5e4337b8ed39a9a
|
| 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.15.0.9.dev202408071721169663-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202408071721169663-cp39-cp39-macosx_10_9_x86_64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.9 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
22799563cd7d432822d3056e227dc2cf8b7faafa1cde090a910312717f89a10e
|
|
BLAKE2b-256 checksum How to use checksums |
f0cb2af1f61f43fa415270f6fb9744b5b4383ff36b80e57ec9efd1f8f444c0f2
|
| 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
|