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.0.9.dev202407291721169663
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.6 MB
Release files / pyAgrum_nightly-1.15.0.9.dev202407291721169663-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cce215260c9dee8ccd81ffb8ead7c5c8f7726d6e88a9efe42e111fabef9629c7
|
|
BLAKE2b-256 checksum How to use checksums |
f10bbe342fe56e698ee1a992696e4a073295dc0befc717543b13515a97f4466a
|
| 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.0.9.dev202407291721169663-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
35a25d69d61487d0bdb89803df65a0fa834bc892136914285263e248176e9f6e
|
|
BLAKE2b-256 checksum How to use checksums |
087258d8013ded07317f82e0bd7bfe2849c80cf12d0ea962a4f61a46a49f92a0
|
| 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.0.9.dev202407291721169663-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
3f6d3f30a2aeb8b87371f0e310734d298fd410230bbcce6c0ad0671508690d2a
|
|
BLAKE2b-256 checksum How to use checksums |
b85866b803759edaf4dc9dcd7131ce75f18a80742d1829bfa68013c62324600a
|
| 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.0.9.dev202407291721169663-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
2f788e88a6d9aba3fe61ba283cd92851a63808139de805ce10da33ee2e3192d5
|
|
BLAKE2b-256 checksum How to use checksums |
d93b8e9bb72deb1abe7a0f4f1e7dfe5df798c141feb567d128ac55c3ec7bf1ce
|
| 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.0.9.dev202407291721169663-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
d0f92903a68e0194b80a57c42d9e47e5270da0d77e0bb1e09a42142016cb22a0
|
|
BLAKE2b-256 checksum How to use checksums |
a1a7d1cfb3cb6f83abd94317bf02a6e18862b9392daa88e08a64b8f3a104834c
|
| 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.0.9.dev202407291721169663-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
699f8b27e5a17675e57f7943dca1630646624be29f55908879472a9bd69833d2
|
|
BLAKE2b-256 checksum How to use checksums |
91501912dc40eea53b2fb7e184ab8b6a85eeb67443db1dea33d9a833f4d3f6bc
|
| 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.0.9.dev202407291721169663-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
3b4e18df47e79f0cf839a07209f3492ae71d3ebfb99b4bd116e5c1354d25b50c
|
|
BLAKE2b-256 checksum How to use checksums |
cf0161ff71411d9d26a278500f107043ed00304734b2cd69ef7be55b4f671d12
|
| 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.0.9.dev202407291721169663-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
4f13fb360496cdd792e137ee27ae7edd12c5fbfa5b3c9c7afdde02ddeb38cdf1
|
|
BLAKE2b-256 checksum How to use checksums |
2b601caf23b10339c371aab42492f3463514f5d1c3fb9273583b9eec05da2090
|
| 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.0.9.dev202407291721169663-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
76701f9ba4aae8c8e0f8b50d3d14603e1e996f8b32a23d355a0f2be1dcbac534
|
|
BLAKE2b-256 checksum How to use checksums |
a433bb3f522bec01b4a31861612d95be93483ec5e6952d8dfc324757a9986d0e
|
| 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.0.9.dev202407291721169663-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
ac2e634e8ee461d2f1a47af5545b8a609141dd5e8b231837342d062c5506f4ef
|
|
BLAKE2b-256 checksum How to use checksums |
3f26f879733711a09e327386ef70f1a71c3d267201b2dc3b873d272a37ab8bbb
|
| 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.0.9.dev202407291721169663-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
58ce9ad0f5752dcc94d2bf077bb09bd00e366abd76c4af674ddc42de80dad4ec
|
|
BLAKE2b-256 checksum How to use checksums |
6922ab3ba1dd94d922198087c5cccf1be3062e8dea772e576d2e197772d10618
|
| 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.0.9.dev202407291721169663-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
edae01f3ff544feadfd997af1a2e39b74fd62ba3a2bef81149d1378347df3ee6
|
|
BLAKE2b-256 checksum How to use checksums |
4c4299f6f523c5d90c750858d22877202afa3c44cc55a2804995c9f020420320
|
| 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.0.9.dev202407291721169663-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
d897a4a5f7555f181035c25ac498a664ccbb2edb511883c371fdd433625d2a5e
|
|
BLAKE2b-256 checksum How to use checksums |
0730df208fa1669fc7e403cd4ae8c4cdbf1666fd47b9ebf28c978862df44ef92
|
| 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.0.9.dev202407291721169663-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
45d84b0cbf39689d6f3a591ece801d55cfded4c90ac21639611ada2c7dcf264a
|
|
BLAKE2b-256 checksum How to use checksums |
bdcc56248a070a1e4ce3429fbba34db1942c62d12d5867f6b474805b162ef4ce
|
| 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.0.9.dev202407291721169663-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
af968b4d8182f72c364c2e9b54b7e67f2be9f03b8ccd2a294516a6e666972c9d
|
|
BLAKE2b-256 checksum How to use checksums |
fc51e46541244ebdb321a11de48bd58f15d1960b0de128debaf955322a41119f
|
| 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.0.9.dev202407291721169663-cp39-cp39-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b78add5c6428ed0c1039c9de572779c180c8b5330390df1f3eb7f1097f802a72
|
|
BLAKE2b-256 checksum How to use checksums |
195e3b4cd024ad1ebbbb8c9e870631d62f79cc01d17743814087fc400fcc0455
|
| 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.0.9.dev202407291721169663-cp39-cp39-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
3159705dbfb129967bea986aeec51d341a78ab0f6c64f4ae2f22e6bc7f375e38
|
|
BLAKE2b-256 checksum How to use checksums |
6c72b34fb5c68d961682cd5d87f06dad6b3005dee5cbe407e599adcd63c8bf40
|
| 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.0.9.dev202407291721169663-cp39-cp39-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
f5f9017943debe9354f4ae0612dc7cd36676d55d3bd8f43c447b3e65bd440bca
|
|
BLAKE2b-256 checksum How to use checksums |
3b84ebea95aba0c324194c5000a6dcea30c42c3dd9f13836c5f8ca1cb15a087b
|
| 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.0.9.dev202407291721169663-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
7704a218637ad09d72cfb21afee4ccfc8bb84f3db2825dda8b986ec285ea1be7
|
|
BLAKE2b-256 checksum How to use checksums |
5b131cdf96fee93ec3a52dc7019e6d0d6a909ebd265e45736158366190cc40cc
|
| 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.0.9.dev202407291721169663-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407291721169663-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 |
e9b1fd6c08c9caf3dfbe855f0c59eea41566c76ca6c3a367a57848895eb376e3
|
|
BLAKE2b-256 checksum How to use checksums |
597bb2291b46e48ca54286f316614d8cff975ee4bea3a0df7ba7d90770399cb4
|
| 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
|