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.dev202410121727562243
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.dev202410121727562243-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a366680c95d78d8774f5d201b5d4bb504fb4af2ec30dfc6407420e801fd38219
|
|
BLAKE2b-256 checksum How to use checksums |
bb9cbb0ceb83420087e73d9c9dd8d57c99bde4ef0631d9d13c96aab541887fef
|
| 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.dev202410121727562243-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
08ada94d4ec8246eef83ace7e6ff621f86f9e51bded4355e5fa57b893b28951b
|
|
BLAKE2b-256 checksum How to use checksums |
4857bb134fb7ffeb2b8e60b1eed6715668339ec9c45c006cc0a2f65699928acf
|
| 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.dev202410121727562243-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
1ca130ca6ef34f3855a685273646262e0e4bb527f0d013747ff697141af314da
|
|
BLAKE2b-256 checksum How to use checksums |
b88ea1dd7348f6adecb09946cf85a1ef4d5bc1bb7996b0ec736dc0a5521e12f2
|
| 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.dev202410121727562243-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
6e86a89769f3fb5106feb189f257682a5a74f11965621da777f2ba6564bbec3c
|
|
BLAKE2b-256 checksum How to use checksums |
8d0abf0f3c64d9648c14363b67a16f8edd82348ff8ccd5c037612decc0967438
|
| 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.dev202410121727562243-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
1a110f7eb21bc7b3126fd292a061ec94f01e7d6a17cae084744ab9c9dacd39ae
|
|
BLAKE2b-256 checksum How to use checksums |
7806e80209d9a33558c2b7054c83c23cad56716d46f1a6f41880d3470af7d95c
|
| 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.dev202410121727562243-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
560f283a8725fc914ae8a20905acef079886fd92b4c4734b41d7045feaa762fb
|
|
BLAKE2b-256 checksum How to use checksums |
6100465347f71eaec7b7369626e21bd7b4cf65d01a57d59545aee8dffb274ae7
|
| 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.dev202410121727562243-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
085c3ccab3e34cc4436689f0f2385ee1aab90da68de8128537f7eca354f80464
|
|
BLAKE2b-256 checksum How to use checksums |
a7825b63e175415ad4842b66df0aff422e6293618d557040e527fd47ef5f7608
|
| 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.dev202410121727562243-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
87bafc1b85f789a63927dfe72962171a18d813346140ed304250b74c23b316fa
|
|
BLAKE2b-256 checksum How to use checksums |
939ba961470ec477d84a9827118d30abc437881f8bcf63b72ca241b5131884cf
|
| 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.dev202410121727562243-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
666e0940a910b9368e13a80b68bd9f9971f431613e639d77fce883fc07a7efe2
|
|
BLAKE2b-256 checksum How to use checksums |
b64d736a78d6bd9ae3509dc25387c731583e6def7243be7835140b047bdb88b6
|
| 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.dev202410121727562243-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
25091d0532976e1de7dc7c9a24a5991b14770930c949f30bd92b0790c9bf27bc
|
|
BLAKE2b-256 checksum How to use checksums |
b19f8c14e475ed67a7b70119246cbc3c50ae32a7d870437ca4c4b523ae1d0c43
|
| 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.dev202410121727562243-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ecc40f5d170d899a87ff0732ad189d64e1ffdbdb72b23a761272dcf7c20ef347
|
|
BLAKE2b-256 checksum How to use checksums |
52421b79a79244a8078238b6f01c16ef05bb390a31b1524bf9084a203e0473de
|
| 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.dev202410121727562243-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
9fcbd22491eb79be4e64170d6e82b42a4d210bf787d09fc7aacde7f550883e4b
|
|
BLAKE2b-256 checksum How to use checksums |
11189c804713c6220e46e83ab5c54d6d91d6d44eff12dd9e05b5964b631ab3d5
|
| 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.dev202410121727562243-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
dffd4657cbe94755211da10977bae80e170a227b07904d72fa0a753b99749699
|
|
BLAKE2b-256 checksum How to use checksums |
8408a79f344714a30c1c2ac6ea6f29b146d5a9bcf16e534441e7a576bfd664ed
|
| 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.dev202410121727562243-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
1f33f89312c0539ee1dd3282f47d96b7f29a8bb5f8aca2e137fcc5fe0f9df6f9
|
|
BLAKE2b-256 checksum How to use checksums |
2c65a84dbbab859b7ce946eacb362916e0848c91458819bb55da1b938010bdef
|
| 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.dev202410121727562243-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410121727562243-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 |
777434b2a486f312ecab1db00a3f06a95134895101becdb6e2d5a9d8a12b857d
|
|
BLAKE2b-256 checksum How to use checksums |
bc0c444c4279bfdcfa5f78580ab2aa3f2e59b768e8dbdd6495fe7f34459240a4
|
| 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
|