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.dev202410021727562243
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.dev202410021727562243-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fc9d0de846a397c207c9aa38e2384d5be466eb6ee2b464e94a29ce306554310a
|
|
BLAKE2b-256 checksum How to use checksums |
10086d120d7ad24900b6248b1b5a3ccc8a690161e72d0bd11e541c7ca451d48a
|
| 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.dev202410021727562243-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
a78ca96e1b81b902d8f7481dcac625b3d971e3985df24b8414d4edcfa06380b1
|
|
BLAKE2b-256 checksum How to use checksums |
1fcfe462b3283b02b340ad3db8ad5a32ac4809957d99d9b60863cad4703ea8af
|
| 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.dev202410021727562243-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
e04bc9ac623cebfde7200ee13d629def0367c7d95aaa127e4f91b609814a112f
|
|
BLAKE2b-256 checksum How to use checksums |
7063644804528235e65f445e287f84785098f26396b80d033d34e47b73406c51
|
| 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.dev202410021727562243-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
229987e08c9ae765eb18c0ad3f9808215f8a97c23f1d01ab680cd218fd52e929
|
|
BLAKE2b-256 checksum How to use checksums |
53d63a45c98ac43af366ee0b5d1af8ac7b6d143ff946a46145da184667639c4b
|
| 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.dev202410021727562243-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
b96a5af1bd11302f94fb04823be83f5751d0dc5594eb2608d8e70869f9807a78
|
|
BLAKE2b-256 checksum How to use checksums |
8f548ad4f1634238b6bb52cafccf684dd5ac04f5cc7e13e92d68ad4016812c0e
|
| 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.dev202410021727562243-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
28217abed22eea8be4b92022497391a5443bbcf6b6a79d6ff17b871fc2a77593
|
|
BLAKE2b-256 checksum How to use checksums |
f0c544110dc51be2fc0503164d3b29c78d5a01fca0f7e7b10906fdc290f42944
|
| 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.dev202410021727562243-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
304e9baaee414408dd8533643501bcbb55e84aca7fabe56d43c7dad797b59fc8
|
|
BLAKE2b-256 checksum How to use checksums |
78965258d7d478ad9d0863a023f4e6c39d3987ab0b4e1d4d067d73ffe8777dcc
|
| 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.dev202410021727562243-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
3405374aa9c8533047b09be158ec13e61cffa03025e4433ec21edd01ddf5f9f2
|
|
BLAKE2b-256 checksum How to use checksums |
d6e5d072bdb60a30cbbd9f4db1dd2a3e07f866c13954c97c1abeb89621a7c17c
|
| 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.dev202410021727562243-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
3b2ed0766e0b3164920141b0363488d27a056a5ea292d4bb17f08f2ee39c1a22
|
|
BLAKE2b-256 checksum How to use checksums |
1489b15329d3a88539ac1d6e877eac7469a4bc112e9f53e568adb60f1b1a6594
|
| 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.dev202410021727562243-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
eb0f0dddf76c43358b156f6177d0b29b2bce9e6f5d38486e817ea66af54ec1bb
|
|
BLAKE2b-256 checksum How to use checksums |
f1df2bcb069d57185d124120c14586014f68198c173cb4bff65e4fc3eed20470
|
| 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.dev202410021727562243-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6fb98b23585e4e64836d19cb4886e39381b803c2216d2d983c04341ef4603034
|
|
BLAKE2b-256 checksum How to use checksums |
bf56d75f3b301b1a250683127cbf15e0d82691082c91887007256e5b703491ff
|
| 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.dev202410021727562243-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
75bac126331f3fc3d252e0f8aac86ae21fe680010fdd131c714321c5021c2dfa
|
|
BLAKE2b-256 checksum How to use checksums |
8cdf2a04388b1750749ffea29918fb67cd5ec67320edd02e99fb71ae93ed0bfe
|
| 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.dev202410021727562243-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
f740af2ec275e458dd2a4232b4c364bd02f5323b0116ce47ec52e915bb995bb7
|
|
BLAKE2b-256 checksum How to use checksums |
60cde2ff573b9adc048e0a893f4eeb09c77a7f5323a7e0dc7a4986e1d5d789d0
|
| 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.dev202410021727562243-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
85703cd019d7b50f3179e00d146be32a6f422aef3df22c16a7e30a3276be281d
|
|
BLAKE2b-256 checksum How to use checksums |
c605ade80610bab4e3ff8b729b35bcf71ca9f99a10ba10be329422a099117c70
|
| 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.dev202410021727562243-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.16.0.dev202410021727562243-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 |
389f9bf37a797cf5dd0a4e118ce9d1dfdc6a9b6fad45ddd4cb34ec9c41472fc7
|
|
BLAKE2b-256 checksum How to use checksums |
e101f0012645e9bc87bd83c92e509a56848098fe1e5b94529b3feebbd1b91970
|
| 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
|