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.14.1.9.dev202407091719384100
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.1 MB
Release files / pyAgrum_nightly-1.14.1.9.dev202407091719384100-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
83518e5b40ad3f351f6b18c19066ba51ae8022569ff6230d7cdb6b2b66d051b4
|
|
BLAKE2b-256 checksum How to use checksums |
0aa607c81a568e192b0a847ddd62e596588b283458f9b61e2d79a7e985131bd5
|
| 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.14.1.9.dev202407091719384100-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
9f282247392a4e141d17801a32efa1bf8973717943f64e410fa33af401c64d32
|
|
BLAKE2b-256 checksum How to use checksums |
b1f900d8c8acf7b3ef9e19ee38e05eee9dfdf02589931c9524777ae8c0cfcf7f
|
| 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.14.1.9.dev202407091719384100-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
b755b9e80d34a8f71a03e7877036f5414ff7357a45419063d8292b6fafed062f
|
|
BLAKE2b-256 checksum How to use checksums |
1c44859703cad52438eef90a8ef2e4d24e5a33a44a6ea48a22f5800e81d2d1bd
|
| 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.14.1.9.dev202407091719384100-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
105e200e48f2e6931fd875d79776f8e5f2e853b2a06273a72f333cacdd3ed8ff
|
|
BLAKE2b-256 checksum How to use checksums |
4bba6024cb773eab7f7e90d8d797ef783d35084ad570a572227948ceb7f40768
|
| 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.14.1.9.dev202407091719384100-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
87d6d333b80219b0885b7b47cb047f9872a82782122fbad9128ceb8fec6c532f
|
|
BLAKE2b-256 checksum How to use checksums |
9151b94eee2135187f508c8d5515fbcbc02d68a52e9bb388892c04961f72d3d8
|
| 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.14.1.9.dev202407091719384100-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
80d5f0ffec2048c40319a8a646606d77be63670dd93f633e7f574498195d5e4e
|
|
BLAKE2b-256 checksum How to use checksums |
0a82fb82526a2beb191d29850b30399029662ed7781bdbf0c894607d7dcb4ea8
|
| 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.14.1.9.dev202407091719384100-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
4a3e95521f7143c3b4c65ca580bc63de993258b355313f98d13d8f70f102e6fd
|
|
BLAKE2b-256 checksum How to use checksums |
e20074098c8164d327b96b66e0602027f16394b4c28417d3fb70d045af686888
|
| 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.14.1.9.dev202407091719384100-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
b6d764e2359677f05e5bc0a4bac1d0b5ba9d95197bcdd61001395dbc67c9c85c
|
|
BLAKE2b-256 checksum How to use checksums |
9284e7949f6c340530f1ae4390f038e90f667ba2b4ebb024bdcd7050923b4dd6
|
| 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.14.1.9.dev202407091719384100-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6e6416af2a642fad23f5fd965ff4c1bbc5150194c5bd1b3ba9a96c20e800221a
|
|
BLAKE2b-256 checksum How to use checksums |
a3fa48f6368c63abfa7e36b95b860898857b28ec5edb65394edc6a361b890ddc
|
| 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.14.1.9.dev202407091719384100-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
58052826009cb532557ae8fbff6e7d95fa213a34e945a06fda808b276812f191
|
|
BLAKE2b-256 checksum How to use checksums |
317da5a41d5abc24cc9bfb4f16c19a63caa02428e64ccff4814a795f2086a167
|
| 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.14.1.9.dev202407091719384100-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
214854c413c1e27426c5b9cbf87a10d45a850be3597a3b5290842fe4b98b3062
|
|
BLAKE2b-256 checksum How to use checksums |
64f79cd3662c249c4c5225061b2f77b70720818d60348a4e4333b815db428d64
|
| 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.14.1.9.dev202407091719384100-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
8b48d7d7370c93d0a82d04d2674236126e3b0d1828a03d6551a8969c64128141
|
|
BLAKE2b-256 checksum How to use checksums |
85f50f6772aeeb96ff133aac00f6d9139fd53165ea0d965af95278dcbe0d90e6
|
| 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.14.1.9.dev202407091719384100-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
2bb0a7bab95926bb6fc5225620fefa57bef2919ba0dd3d8be33073b588da45cd
|
|
BLAKE2b-256 checksum How to use checksums |
d04d6b0176ca4f52c49f700ec298ea7313ddc05e015563ff6d16342a2cc4d02c
|
| 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.14.1.9.dev202407091719384100-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1142cf0476905392478da8d59aea3d00256c4d0bdb790acef9082bb8f01c4c4b
|
|
BLAKE2b-256 checksum How to use checksums |
71f9a0efcb3fe19053a9542fd9e913c547338df566b62f395aaf6d37edd6d845
|
| 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.14.1.9.dev202407091719384100-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
fa51b2f3e3644b7db2f07879f08726f21053dd4444db1ae13bbd501c9674f16a
|
|
BLAKE2b-256 checksum How to use checksums |
c5e8ce117d54e9c75f8b27af22d138a740991d42bb225251d0950b6f8b3d092e
|
| 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.14.1.9.dev202407091719384100-cp39-cp39-win_amd64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
38479db782a05cda1646a7410620079057d6747c3c81acebca3d0dcb5925fa4f
|
|
BLAKE2b-256 checksum How to use checksums |
c2203f413bb9664479b7786100f15e22ea05fc6707ed988a7e2cdb9b09b632a5
|
| 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.14.1.9.dev202407091719384100-cp39-cp39-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
463bc38da1f049ae0ae72e4f8c8beae034e493a480c833134e821b0cf01019ce
|
|
BLAKE2b-256 checksum How to use checksums |
349b38d0aa8bbe13d51f5503471a47ba0976d31268a172d5d7a96a8b58b7ea91
|
| 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.14.1.9.dev202407091719384100-cp39-cp39-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
23377cc0af3d6aecc4fe185ec1ee23a53211756ad5164d05e3ca7c723985023c
|
|
BLAKE2b-256 checksum How to use checksums |
fdaa57e92020ec0ac863e024fb32d7ce87f26b567e4f7e9cb958386991cc97ed
|
| 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.14.1.9.dev202407091719384100-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-cp39-cp39-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.9 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5673f1871cf7fd748af75be10a3d4929f4ce0cbc9bd817acfe815066744ed2d3
|
|
BLAKE2b-256 checksum How to use checksums |
bb08ee063925f9082ada8d27c6fc2e75116f6868ad6943850e8aec8f65fb3848
|
| 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.14.1.9.dev202407091719384100-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.14.1.9.dev202407091719384100-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 |
7b61705cc4e06250d436b8a0adc303ca7668467adb3dd7f552615f1e4d04783d
|
|
BLAKE2b-256 checksum How to use checksums |
717bf30f7867aa71c2adab85fa556475b6827f03e3e5c796e2072c60e684f00d
|
| 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
|