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.dev202501271731932516
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.dev202501271731932516-cp313-cp313-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
378d6df12be23eb483790815cd73ff42d32d95e32fad02ddda48f5330700d1ed
|
|
BLAKE2b-256 checksum How to use checksums |
15c7974a22d93c8ce640e9aa4c4a07df34e261713b1c99e9b57d7060d3e82a78
|
| 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.dev202501271731932516-cp313-cp313-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
1bec78b72d7c8a18e5e9d215958d9efc291c325314555e8a0ab9ea1503ab865e
|
|
BLAKE2b-256 checksum How to use checksums |
4a77bdd7ff8a1e7ce71e2608adc88fdf1170e050304831aa0a90c8fbf5f06329
|
| 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.dev202501271731932516-cp313-cp313-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
5107f2799d99ef0618f29fb9d34edba2503a4f6cdb50c6c7f103b2d04c53294a
|
|
BLAKE2b-256 checksum How to use checksums |
fe8c0ead7be7daf9a4682eb9d75d3da8852c7821aa932967206657ea5b3cd5de
|
| 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.dev202501271731932516-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
0e915887c3b136672b956007ab29438771f4af54d910cf50c3ab7947a9533c61
|
|
BLAKE2b-256 checksum How to use checksums |
e1f5987223b873f7284d4f92478dd4128d79962540ce77e20ca4b18be329db54
|
| 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.dev202501271731932516-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
8d20036ed5239d05bf21a9e9aa07010ef4ef342d8fd0aa075a0c6afc71737aa6
|
|
BLAKE2b-256 checksum How to use checksums |
341d946b4cad9647683b74f366a1a913c43d6f5c1d95f6d2ef446140329bd644
|
| 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.dev202501271731932516-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5a5422072c3d24cbe2e2742c12c78e8a4eb2c429087228f3448f7c620ef8fa50
|
|
BLAKE2b-256 checksum How to use checksums |
5a3061f0cd82f556c0867606247877df3cd26bc26c540645ff84800f3922da7e
|
| 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.dev202501271731932516-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
0e5a9d65959456726fc8a381ab9ee743f95942a41c710dee9eea6853c3323aed
|
|
BLAKE2b-256 checksum How to use checksums |
70d2db890486b45dd287e0024f26dc88472ff820295be24f701fc042772e812d
|
| 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.dev202501271731932516-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
29873761a8b3813ad5c1a34aab5c1e5398edb5747713b4cc95dfc996ac8fa4e7
|
|
BLAKE2b-256 checksum How to use checksums |
3c57b9f498b4e0a888a3e5be926797fbbcabfff6f6810da8d39d27ecc1b8ade8
|
| 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.dev202501271731932516-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
646979b9300dd920f6432b3d91c9c66b93780d5d826450013947abdeab896d17
|
|
BLAKE2b-256 checksum How to use checksums |
34dd1d745996cb2f60ed85e232cb4643f679a6505fd75aa3b94c2dba239f4bbc
|
| 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.dev202501271731932516-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
9d27bc8fffa9520d2f2fe6b3f83777fa393c399c8dc860fd0bd5833d1f63efab
|
|
BLAKE2b-256 checksum How to use checksums |
d92eab9ba3c2182c460ef4695fd9a25ea3ad7b05a424b7ca62c87fb7d6b874a7
|
| 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.dev202501271731932516-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5c55f5f5c65fc51a95af8eb451adb4a8529ab7b45fa968a068decf2b630bc75d
|
|
BLAKE2b-256 checksum How to use checksums |
2474fd5bf16ea3d0069d986d41ce40e0fc30c0342bd8fe23aef657653ec63407
|
| 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.dev202501271731932516-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
715160785661dda3e7b4e2bb5a42457ac765b98f703cb4be70e8af34c0a4c3e8
|
|
BLAKE2b-256 checksum How to use checksums |
0c60cf4266f8aea63bf68f1248141df5a2ee1d92c07f6e732fb23f8d09c29520
|
| 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.dev202501271731932516-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
795ac8c6ab56ea485bc15b596aa6e402881a816c096253b2fadd133bcc920d3d
|
|
BLAKE2b-256 checksum How to use checksums |
1667746a8dbeaa81c7ac456fee5fa3df37b99a6d4f5071c88cf544df5aa76f64
|
| 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.dev202501271731932516-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
176aa2513142efd35ab1764104da385e44b89e3a5e02558dd1ba176b27adaba7
|
|
BLAKE2b-256 checksum How to use checksums |
cfb811421cb710a77d7531229393abe4cff36a48d092be927414d65d547166ee
|
| 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.dev202501271731932516-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
c8ba6d2ceffe7b8b38ab008b3590dbb460fca6dcb185b474657cd166637462d7
|
|
BLAKE2b-256 checksum How to use checksums |
13faec5e364bc2fda6e2fd14e3260dc0607b455c6c786a393009dbcf3dc6253d
|
| 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.dev202501271731932516-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8487293bdddda23e01fa272f305ece98d83db0fca57dc7cdd0257df8616e790e
|
|
BLAKE2b-256 checksum How to use checksums |
0e680bc73816641ef4649f6c54836ec37d70e959ce14b6e762d05ebedc0e19e6
|
| 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.dev202501271731932516-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
336a5fdc443da218ef6b27345ef6a2fbbcd0ee51782466b2b59f61b99a632443
|
|
BLAKE2b-256 checksum How to use checksums |
a3c91ee147347d8188b8c067f29721f361e51a0a533b79993906fdf7c8e8a4a1
|
| 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.dev202501271731932516-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
f81c93b92e539a1b875ba7fc00131a4c38190ad1721321f469e8af55448fc811
|
|
BLAKE2b-256 checksum How to use checksums |
51dc887d243eb807a8a4c6636b2db3738cd6a5a57822d97946d43ce168e1c52e
|
| 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.dev202501271731932516-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
5ec333770da4c8451566ab07f11bedd9f8f500fa4d2906e4eab940e262874a55
|
|
BLAKE2b-256 checksum How to use checksums |
bb3dddab5c51dc997351b13dc502408956695e9d33d7198038b82952c4942b91
|
| 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.dev202501271731932516-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.2.dev202501271731932516-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 |
6e301e99dff91a43967183f7ebdf42b09f7237c0217018e9e219964ac028e608
|
|
BLAKE2b-256 checksum How to use checksums |
3624188bab92171aac2fe2662f8a5e2d8fa3d274d8b930fdf3a4732720cb8c08
|
| 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
|