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.15.1.9.dev202408201723794729
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 92.7 MB
Release files / pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d069e454ae0a8a2955ee0a9d30c109a8de159d534646df0c47077538a03e9b74
|
|
BLAKE2b-256 checksum How to use checksums |
dfb866d5b76bf647b33b4f0af9b16f0cfd4e33d2c5c0ba284eab48e9853b0b64
|
| 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.15.1.9.dev202408201723794729-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp312-cp312-manylinux2014_x86_64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e44f54414160d5d1952c8e0cf600f56eee74df7d62adc9f4c1ca3cea28f286d6
|
|
BLAKE2b-256 checksum How to use checksums |
fd27c96fd0bc64c80c0711bd84ec3be3ff232d942756d66109c1a1af9dc26918
|
| 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.15.1.9.dev202408201723794729-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-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 |
bb5cc42ec6822313b0a4ddff1a8f36c9a81bb5c6bc9197e4b2d70fc5ca050264
|
|
BLAKE2b-256 checksum How to use checksums |
ab5e37d7e2051079bb9b3007a418b2a68be07b26af0119d97e57cf39f7443022
|
| 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.15.1.9.dev202408201723794729-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-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 |
54acb400f7e5a9bed781b1afe68b0ad164a71d5aadcc8534b952487caa9de766
|
|
BLAKE2b-256 checksum How to use checksums |
3e3efa81f5825c619df2c5332402ea38ecd5678f60a3ea8ecf6462eefc2d1439
|
| 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.15.1.9.dev202408201723794729-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-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 |
b2871863df8dcb78e4784bd86834aa605a6b0451ea8db5aca72c9dbc35cac9ee
|
|
BLAKE2b-256 checksum How to use checksums |
9aa08f963854e6a37865bb6d258f2ca82daf010a90cb834aaa31f4e1817ea179
|
| 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.15.1.9.dev202408201723794729-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1dbeb610b5beccf990f2de3d0e3aecb0bdb79afdaeede7958c17d92c6d85e6a6
|
|
BLAKE2b-256 checksum How to use checksums |
7a51ff690b70cf8497e2ab339564d7cefcbcb2070fc50aebfe76303f34e3ef3a
|
| 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.15.1.9.dev202408201723794729-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp311-cp311-manylinux2014_x86_64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
b2a57d503d40b6cb89a237a010be494d07e9ba8678c2488d0b4a138363c33796
|
|
BLAKE2b-256 checksum How to use checksums |
ac853441d43bdb1b9db04f4e078720262b12c3692e39ddbc33d92b966e5249f1
|
| 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.15.1.9.dev202408201723794729-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-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 |
3f88e230cb0914ea355ad34db3e911024355702280c6567dc9ad9b90b0b63f55
|
|
BLAKE2b-256 checksum How to use checksums |
7eaa88ecec1d6d65289bbb18438a639baa0a722f1c7b0a9bd15c0067cac7f9f5
|
| 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.15.1.9.dev202408201723794729-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-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 |
a6c41d4d2a137437ea0c9aa96ee83cce1cdb981b0e468a2a23d66c8935742e76
|
|
BLAKE2b-256 checksum How to use checksums |
b320332bafcde0f141a6a951ab8cacd5637616c7fa1d75672b6e3acdeeaf2cb5
|
| 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.15.1.9.dev202408201723794729-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-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 |
05e039569038b1815b4180a0eeb715da65296a02b999599e40f582998d534323
|
|
BLAKE2b-256 checksum How to use checksums |
cb9daf7e3ee44a6b2d58b8b98ed248e4121daf6e37be0b67b3a97ff685717fa2
|
| 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.15.1.9.dev202408201723794729-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7fa42a7440ccef3be0a6cbe0d59c178bbf5d17bc6ffae7a0c5ce51bc950fa0c7
|
|
BLAKE2b-256 checksum How to use checksums |
996dfae76344a537fad6099c8808d9a0775349770603a7b5b1240072b1e846b1
|
| 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.15.1.9.dev202408201723794729-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp310-cp310-manylinux2014_x86_64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
dd36f524243c7b47840d10db182a17333b772ffff759b960c2451a3ff0c9f707
|
|
BLAKE2b-256 checksum How to use checksums |
4f6ca3f46dfb8e71ffd8d1f28b566091a9d3a89fdf67a70d5129daa26689ead9
|
| 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.15.1.9.dev202408201723794729-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-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 |
d32d5b933f1a1afb40f4de289d2609667f77bff2ad56a16044c3407de2437ae2
|
|
BLAKE2b-256 checksum How to use checksums |
3f44b09d70c63bc72cb6644d5d1372a50d5b9881138a83eff99ad22bdcc7a210
|
| 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.15.1.9.dev202408201723794729-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-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 |
47421417a4a7ee1d944b1ccf2ac0238ea99b627cae4ebad7ba3ca373cba2181e
|
|
BLAKE2b-256 checksum How to use checksums |
01e62a01a2a99b0bb10811a304e61d246fe8c77355974e923fe5f433a001b4eb
|
| 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.15.1.9.dev202408201723794729-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-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 |
36b181c1872f2d4fdd242711e7a50d432edbd4a4275048ab8a5cb633897d860f
|
|
BLAKE2b-256 checksum How to use checksums |
597a8e289e0d99e04c17955c9b5f2eb1d01a3399272c418661ab75c175ef25d2
|
| 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.15.1.9.dev202408201723794729-cp39-cp39-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6265da7e357b72261456b21c0b2baf59b9c4ced28a14d3e9680d04b8d0e88f61
|
|
BLAKE2b-256 checksum How to use checksums |
a7e6caf2c66bf39a33e238a7905c50774d66dc44d0b2a4d05089d9a9adef5378
|
| 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.15.1.9.dev202408201723794729-cp39-cp39-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp39-cp39-manylinux2014_x86_64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
af6e002e02cd184fc01d3037ed99f081a4faa9101f80c3fca7878525734ba356
|
|
BLAKE2b-256 checksum How to use checksums |
3de5831a4aa9ad12a691b43741973044b3a94673fbc3585b6e87721ca4018022
|
| 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.15.1.9.dev202408201723794729-cp39-cp39-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp39-cp39-manylinux2014_aarch64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
0fcabd7a7ae1f724d3857847e376eea42dc1481e0a7f0d1317b18a132e82659a
|
|
BLAKE2b-256 checksum How to use checksums |
c7b0f049bc2fd692d3d2b4f9b8a2f7f99e4b035d0db561ca49d56e637c5784ff
|
| 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.15.1.9.dev202408201723794729-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp39-cp39-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.9 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6e3bf9abc7668863a0cea555150227aa21e4187f9d95f3e28eb40d6280aea568
|
|
BLAKE2b-256 checksum How to use checksums |
c36a31a99fe79a9b00fe499c2f9e8b41b7a36eca4eeecd479a4727b36c062837
|
| 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.15.1.9.dev202408201723794729-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408201723794729-cp39-cp39-macosx_10_9_x86_64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.9 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
22ffb22dbb00047e309e17fdf58e8a7354e3023bb50f554671f6ee1f9160813a
|
|
BLAKE2b-256 checksum How to use checksums |
cfea73b5e856a8b7840c8f888406ca4869f982294e914c6b54c32c4f993a3891
|
| 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
|