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.0.dev202410271729615378
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.7 MB
Release files / pyAgrum_nightly-1.17.0.dev202410271729615378-cp313-cp313-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9a6d46131dadf1f441def81a84a05c7b6c9d11af195409e2aa87e458f8a19782
|
|
BLAKE2b-256 checksum How to use checksums |
4e231c149f46f1c9943cda9afa6bcd9771e2d5ccd6a0199ba585c47a4ef0fa66
|
| 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.0.dev202410271729615378-cp313-cp313-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
abe3e03e30065dcdd6addbcc3ef4951d041fc2b78743f8ed9492006d05f2c10b
|
|
BLAKE2b-256 checksum How to use checksums |
a16ad6419bde75ddc7af3bab78bd6444731e49c7847df8393090555083b29037
|
| 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.0.dev202410271729615378-cp313-cp313-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
ff2a82031e9999b03b320cdb71892387590d21a1aeb5ec523bf29b563e6e125e
|
|
BLAKE2b-256 checksum How to use checksums |
6e8c0e39ce158d16a5fa02a589ca74adc6f231d41806f6482db7eac21e6a415f
|
| 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.0.dev202410271729615378-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
558060ecd617225327699401282424ccd793cb69f9f62924ef7f663c0352e728
|
|
BLAKE2b-256 checksum How to use checksums |
4d62b42b8e941aa8e24ed62dd599bc89710337a1b9894248eebc178690d0e372
|
| 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.0.dev202410271729615378-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
6dc66d4068e1e7817b16dfcb7d1c80f4c51059791a6c28a99435290b3e1ce287
|
|
BLAKE2b-256 checksum How to use checksums |
b5d05c6dd376805e51fe8c4b770ab04fb54866f941ae69f9016203ffda7abde3
|
| 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.0.dev202410271729615378-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d814b85823b53b9a72304a43610ae6275d9f564e2b3f2aa9f30b39b0fe99b257
|
|
BLAKE2b-256 checksum How to use checksums |
57a8b0c58c72328d0a126fca1bf5e57454ee7306318833e2fb240c847857b939
|
| 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.0.dev202410271729615378-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
eb14c198d7fe8d5317aebd1197c806cbfb52c077110f8799321e18ba57777d30
|
|
BLAKE2b-256 checksum How to use checksums |
cd5edbb3871aa35605b0e836aa23f8154220f136689601886aa4027b9bd7e2b5
|
| 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.0.dev202410271729615378-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
701351703b2deab2dcb327ed771dceba89a6b162ba740ae71bd7f8e28479315d
|
|
BLAKE2b-256 checksum How to use checksums |
f986b2b0d5f50bf4d4c9276f65e746d4bbf114880b7d3af629443c2494b0b5ea
|
| 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.0.dev202410271729615378-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
8daf16cdfe7b7dbd79434c7c6718e6578a0ff0f0117c51f27b91b50fbacc85a9
|
|
BLAKE2b-256 checksum How to use checksums |
c72e4b299356b9d86861f26717b032fdf4bd7ea16332023ede4a3a35ba17b136
|
| 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.0.dev202410271729615378-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
c42f2facfab1b543dc554f2a316bd7375239ef831459a43406ea6bd0d6ae768b
|
|
BLAKE2b-256 checksum How to use checksums |
f35fb59096de9736a60b8739a07dd6e4e571d245c7967c997dc3605bcf1dc967
|
| 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.0.dev202410271729615378-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9ed40280f1477d677df2fe5f360db6c2949c603dea9e3a50f711e3ff269be726
|
|
BLAKE2b-256 checksum How to use checksums |
f465cc49a60ddb94fe164ed47c8c79c159f3c2bcec32e06eadb2f92f0354e2e5
|
| 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.0.dev202410271729615378-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
550038a2acee8decafb8cd477cf6da4d5c47ca02cb26d7448a8b5a24ffa1a73e
|
|
BLAKE2b-256 checksum How to use checksums |
1b5a6017a5eb206c2b9dc1c07b6ed7e14caffd1378f2eff518dca6294a4a6b3d
|
| 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.0.dev202410271729615378-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
e8cb432bfbaf4cdc977ff30831c40732de61ba95fb9f672ab227d96e442245a0
|
|
BLAKE2b-256 checksum How to use checksums |
5967060d4d5ecea77aa13376eeb0c0f55d793fdc60d33b30275d508687301003
|
| 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.0.dev202410271729615378-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
059c6bfcaa2667c9d3a56121acc586e7a49fa5e7aeec86095f310f32bc21c26d
|
|
BLAKE2b-256 checksum How to use checksums |
95be423ebdd811adade20d4e1a426e918906c183ea1ce754ff72c4cfb4eaaede
|
| 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.0.dev202410271729615378-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
0ab8c2f78b629de26dc61f9d19520bd95ff3965c49cd16d9992fdacd2e3a019f
|
|
BLAKE2b-256 checksum How to use checksums |
ccde35561ffe49563b56a66ec4dcc73b1ff144ffa735d5e17814fc9a8e19eb73
|
| 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.0.dev202410271729615378-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
dcbe388a715501fe7d33792aa87aa7b6fe03aabbcad514ed0dc7d94ac30e0d24
|
|
BLAKE2b-256 checksum How to use checksums |
ddbb4b80d70635cd1c43858a93a1f2ab503de163c2390a88fd4c960295a2a61a
|
| 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.0.dev202410271729615378-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
f7aa74dcff5148b8376bde14a086a1a1a78fbe06994d38c4172a8062c94c2c0c
|
|
BLAKE2b-256 checksum How to use checksums |
6c169ec2a3bf6aaaed859db89e1d281183bc1110c5a37630de9bbb87adbd7889
|
| 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.0.dev202410271729615378-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
2b42a98381b374cd9807cbc7b3896bce1272b187da90599353ea096cbae10ef5
|
|
BLAKE2b-256 checksum How to use checksums |
89509c2b4bd3ae41a4c7ad7fbe4f0402f95f875cd91218b018685dac4e9dff55
|
| 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.0.dev202410271729615378-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
a27c2193a1b1358235dc790e087101931f35a7b672407bf35ebf4fcb7b55e57e
|
|
BLAKE2b-256 checksum How to use checksums |
cf19780493e098eea9786950e7f5ccfad42c336fd861a1313fe75d8a190529d9
|
| 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.0.dev202410271729615378-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410271729615378-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 |
c925fb164475ae234e56bd521c855e4833daabb6835e03dd5034e9c4cb315aba
|
|
BLAKE2b-256 checksum How to use checksums |
9c738ff156d4215c9fd28191bb74c9c166326ca14e4be15477a59c003e767f22
|
| 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
|