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.dev202410191729248609
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.dev202410191729248609-cp313-cp313-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ae440b1e86c3dc1b27403fe32fd167510d4a3475e2d7cfda8fdb51b651ff765d
|
|
BLAKE2b-256 checksum How to use checksums |
df6cf58b1ed66e2710cc9b27a6ed305c219130de30950ae6db1da584704df2cc
|
| 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.dev202410191729248609-cp313-cp313-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
f35ed3ddb585cc18f236633690d9b9a2fc6dc89c884561cc0e4ca744a2812336
|
|
BLAKE2b-256 checksum How to use checksums |
e98d5c7514cf7700ca654f1e2787c50e11b486d11663111a0d467fbfa832917b
|
| 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.dev202410191729248609-cp313-cp313-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
f239de7663f845376ac11b19d6fbde4d28d158a701b0f3d7b3adbc5897a6891a
|
|
BLAKE2b-256 checksum How to use checksums |
6fda60b607dcbd70d7b51ab76d2b469fbedcf31d9c99d9d3d03f307622871e44
|
| 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.dev202410191729248609-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
37ffb0770f1516fac304c02c9530a8911b6edd8e4b26954fbb34d88d7e74c2df
|
|
BLAKE2b-256 checksum How to use checksums |
c8144170332e568a3768bbb58c88cef71bb9a94e1a8524b30682079fa5fd5041
|
| 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.dev202410191729248609-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
94d0cc802c313aff633856d3bd64bb91ca1f2d416c16622f5cb1d759b483d881
|
|
BLAKE2b-256 checksum How to use checksums |
bcde79aeb6b34520d074f4d35fa73fa78133c2f8231b07ea39a44c1d9c1ed06b
|
| 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.dev202410191729248609-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7bd83c552494618d9f16d86f35508bbbd963573a7345bb9046274051fc9b0f93
|
|
BLAKE2b-256 checksum How to use checksums |
7ef5248c22add384bdb422e51086e03fd5a08fb34c439206927fae8b77113c6e
|
| 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.dev202410191729248609-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
df35a158f9d861a5da61b3132fdef13fae4dd5e297fedc8dfb983633995cb99b
|
|
BLAKE2b-256 checksum How to use checksums |
301427bfbfc97ebeaab26cbad387df190452e97b43802798feaa703b2a686ca3
|
| 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.dev202410191729248609-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
ebf4114b02ddc193b2bca279694fab6e9f53a94d389e1041d24892c0363ee523
|
|
BLAKE2b-256 checksum How to use checksums |
4624dcc3bb96b8af8370523921e831658c991a2bff164fabad4cad00853d0b63
|
| 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.dev202410191729248609-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
7b391d150b521e050d53afb8e7bad27f10dcd0aea0384ae2a864d74b4469f673
|
|
BLAKE2b-256 checksum How to use checksums |
bb90950b65ab9deca95d1d8b44401d5eb91dbb06a391db8dd6de4b65bce405e5
|
| 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.dev202410191729248609-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
e6c5ef646637d6d47bcec0ae407a9fb2f7eeaccd730190dc3b1f98d28427e3b3
|
|
BLAKE2b-256 checksum How to use checksums |
df9eb3543fbb260aa20433a38b8d586169a80aa27afff6ec6e845b6bc7e234b6
|
| 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.dev202410191729248609-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
83747a6ccfefddeebc1f69dc130599f771159481ecd775ec5f6e5c95f06375a8
|
|
BLAKE2b-256 checksum How to use checksums |
ca57fa2824a6cea0bc461969b8fdce6feedcdc3b280331ef51fa74de4ffeee4e
|
| 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.dev202410191729248609-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
8e4967f6c8175055d021c55799f0884242f460cada3f62c6ac79337af1afede0
|
|
BLAKE2b-256 checksum How to use checksums |
bd6dec917e9733613096e0738b74fadd86ace9e8f1364cc8be98006f45f1f462
|
| 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.dev202410191729248609-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
09aadb86e89d55b2d64c6b079f7dc4601b48f68a01bb8487973d33bd9922d5ff
|
|
BLAKE2b-256 checksum How to use checksums |
70f00df5c535ca210374833b8e7d1e96a908c8e180096f7f22e097469a9764d3
|
| 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.dev202410191729248609-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
365564db0897bfa6a927bac5ab796332855e92448f21dfd5cdb052d42ce27802
|
|
BLAKE2b-256 checksum How to use checksums |
75b57d5fd19ab522c3ebf67983f3da0060fc6ebb78cc7abb655f9e3775204ddf
|
| 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.dev202410191729248609-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
3c6e0573b63c0b8b7c4bb0192a7a1f895ec548e5ed26f1853477751d8f77fed6
|
|
BLAKE2b-256 checksum How to use checksums |
68b9c0df7cea8315189c7b0185815823d6ce640bca58db918065d380e063977b
|
| 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.dev202410191729248609-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f3000df494bf7afbcc2fa729bd11e6303a47af3d7ffb4fabf3cabc7830c77dcb
|
|
BLAKE2b-256 checksum How to use checksums |
c7a605daa42afdd3e1415aeeb48723cc237e75eeb234238e0927af2d9cc26ae4
|
| 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.dev202410191729248609-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
f354a4df91aa842564b0d5bb8ac44008a066f5b3d468fe06054240d0905f45f1
|
|
BLAKE2b-256 checksum How to use checksums |
965d0b130f1ecad93b00f5f338adced76b1e085ad10e0d69f9eb5e5226db63c4
|
| 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.dev202410191729248609-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
09be871c35dafec63963508e668629af0a89db8d01ededfe8b4bc4f1a6c93225
|
|
BLAKE2b-256 checksum How to use checksums |
869b0520cdbec79e3fe91cf47fe0fb81b705b8e44498efa75f5890c75101a5dd
|
| 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.dev202410191729248609-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
3340ed520dd29c1459d515ba3c63dc525487d3a2db9f63e7da8bba7ec9be7608
|
|
BLAKE2b-256 checksum How to use checksums |
dd57444801162634036a15e9ec27cd7388a2ef63dacc2f20398604c25d2dc2d4
|
| 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.dev202410191729248609-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.17.0.dev202410191729248609-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 |
124141ae1b0c93482371690d211212b45822c4c3992ff1c9ae90a17a7b224b3a
|
|
BLAKE2b-256 checksum How to use checksums |
21fca9cc70fbc1fd076775d1bf449377e688c8a6657fb9fb1c2c27c74cc4bc94
|
| 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
|