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.dev202410061727562243
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.dev202410061727562243-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8565282b9b57f9685abe70c6c4c2e0a85ab5eb4e61a9784258f40552ec0fd261
|
|
BLAKE2b-256 checksum How to use checksums |
8971a34db28db1b0834935e7fb3593633f0d72ad1cbe17647e44cef924838c79
|
| 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.dev202410061727562243-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
641cbe4afb9d4a33d0d9fd6d4646992893fcc643690bc9e9e09c3a6d89b988dc
|
|
BLAKE2b-256 checksum How to use checksums |
2db6ea331a96b43be5bc148d283c85ddd6b8f1b58d68cabc21158e2ceda73906
|
| 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.dev202410061727562243-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
0eebd9cb00a998215ec5fa7bdf174f71c22f0f55bb891c9e834920c941d148b2
|
|
BLAKE2b-256 checksum How to use checksums |
b7264b572df02188a5673329844f5c1d72eb536a1933e08d245a5383c09cc3d7
|
| 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.dev202410061727562243-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
530d3c43f95085da95e071d479b7ddd8ae35dc2d314e07af52e9e3ab045e3c8d
|
|
BLAKE2b-256 checksum How to use checksums |
ec895a8d50ca3540c86ba5475a9dfd51403ad062a382f6e87e8026eb6afd890c
|
| 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.dev202410061727562243-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
7872876a7b4b4689795aded8053c1cde4eeef28703b6e1a7dabeacfc2ee42772
|
|
BLAKE2b-256 checksum How to use checksums |
3a48e456da3d40aa8a2e46af666e30aac448ebec11243ed0190d6eb7ca958e55
|
| 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.dev202410061727562243-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8e6b0e57d74f206632ad4540b1d676a297449b411cd6fafa34e127b1c49f5534
|
|
BLAKE2b-256 checksum How to use checksums |
2e2744830effe20a3039c9c20896eb0302a739352a2a1e49aa742c01ae2ad464
|
| 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.dev202410061727562243-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
292c35b92a972fa223e0141993038c13d5dd07827b59ced325b3017b539c7e85
|
|
BLAKE2b-256 checksum How to use checksums |
5f43cde326751e1e34fdc3292f4db9b2c06bbc1a87ca2fbf79d9e99ce2981e2c
|
| 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.dev202410061727562243-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
01b211e639b97c2e09f3af6fb2585b66b4a7bb6c375edfd9f99917a912889037
|
|
BLAKE2b-256 checksum How to use checksums |
e02ed9c67fe8646fa3179d349a9300f10909dd255d972ca85d7aa653d66a2b56
|
| 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.dev202410061727562243-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
71033c94225108d61a9343c81cf5d2f5b3befc18e5be53ab85d74c3d6d539f2b
|
|
BLAKE2b-256 checksum How to use checksums |
7cfaf368e85c0e764183481510e66a0d6df8212d64195e0457ad1ae1de11a06f
|
| 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.dev202410061727562243-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
e76b2dc0f4f950b3065d6cce6f9723a21d8c00840ea3b2dd2f723c610cc4d308
|
|
BLAKE2b-256 checksum How to use checksums |
9ffe8755519a6b749b79f6d647f46902ad6bc22cbf9cf503674fb7ae70a11e84
|
| 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.dev202410061727562243-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
446e31ad9f3a1aeab53f0071cdaa878c5029cd9c3e623c7f110ed94ada7093b6
|
|
BLAKE2b-256 checksum How to use checksums |
7d84909149f01ec2c678b006f96d1e7a96efe8ac12871c6f6e0915b1ba544b75
|
| 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.dev202410061727562243-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
276ad92129beac5047c5c24f652040014da03ce3a946578393f4b82f9e4386ec
|
|
BLAKE2b-256 checksum How to use checksums |
2dd40672cd4f330bad94894a81cbda69d2cfec8b35837f98c4f015a01c2be1cb
|
| 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.dev202410061727562243-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
b5dd84ebfbbc30f85be7df003142e04ad130aecd01f31285282b712548f0e128
|
|
BLAKE2b-256 checksum How to use checksums |
9920badadf2c4d2beec1b35a294928d68e69aa4d63e7275280caaf7c61d9d53e
|
| 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.dev202410061727562243-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
09615db2f6ef47c25e53a081b21f152d6ca2c5da2223ea214268b498676a4b15
|
|
BLAKE2b-256 checksum How to use checksums |
ff82b4dfe95ab82cec60c85a462e93cf48f1313adfd05e792b697ccb50ab936c
|
| 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.dev202410061727562243-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410061727562243-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 |
1d2b807512d427f3cbb8f538796a7e2d52d926ce2476d58772f84c92b24b58c6
|
|
BLAKE2b-256 checksum How to use checksums |
8a1c7b5680fcbd14dcb9d40b612e33dd7d8bed6010744169ccb46e5e1dddb036
|
| 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
|