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.dev202408221723794729
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.dev202408221723794729-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
18465a3fabb4b18baf67d5784118053228986e40bdb2aea3bcf5a9a010be8ff9
|
|
BLAKE2b-256 checksum How to use checksums |
e0d8f550a8edea80031eada4daefb0fa921f8a21d1ac4665c5ecf0805ec0fc7d
|
| 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.dev202408221723794729-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
5d8fcaa47b25f8f39f7b9cbc740998e19b7b5ac17907925c5795411a98075e03
|
|
BLAKE2b-256 checksum How to use checksums |
af11288d1847b999ba462158648e9ce2924de060bf881ab04c8d94086fdf8d7b
|
| 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.dev202408221723794729-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
afa7870e195f82334cc0326d321fde45f5140de4bbfa7feb89355f139b430e4d
|
|
BLAKE2b-256 checksum How to use checksums |
93d2a35e7a2ec0e404b9ef05263a8f226cdcc4538fc6263ed98531a9db6f75da
|
| 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.dev202408221723794729-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
82435bb9c4223bd933aff67fab7486dc4e88b98a6670be9ffda69e3c8a5dc49b
|
|
BLAKE2b-256 checksum How to use checksums |
7638d2829bdb6e0e609d91c87640761400b583372642ab4669e5b1d0bd71583d
|
| 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.dev202408221723794729-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
3e35d71f75a3577c534262997e03c1bdffa40940ec0d66a92d44ac69a6d443a7
|
|
BLAKE2b-256 checksum How to use checksums |
0795ebf09efb2381fd20ad3d2a597525a86dcbbb2cb403dccbdf3917e36abca0
|
| 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.dev202408221723794729-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
be4b4d1a4aff00431ef4791ac299588a1834d0e0728165956a7c6c8278d045c4
|
|
BLAKE2b-256 checksum How to use checksums |
84b7202a9377fbeb046968b081ccd178fda09b4e73c3201522861ba0945ffbfd
|
| 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.dev202408221723794729-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
c480524556d01fbcb99d18a0dcd5e6bd213243d1ec71140763d9544305229fde
|
|
BLAKE2b-256 checksum How to use checksums |
0e3530db9f305e99fe2362c6dade818434821b57df28574dae5256e9bbf7a955
|
| 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.dev202408221723794729-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
7ab3e40e443bb78d824f5547eaddf0c0721f6be1b18014e0b4231a891cf2f0bc
|
|
BLAKE2b-256 checksum How to use checksums |
c446ce311004532b961be72014843dd7eaa972403d96518ed6c7cb7c36168e46
|
| 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.dev202408221723794729-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
14dff32a86425c6d10ce919b104b4c40f46808a8b1af8e7c7a6315bd5036d666
|
|
BLAKE2b-256 checksum How to use checksums |
6f844b227379429ceafae7f57e5bc51018f0f8c9edd45eaf5ff96308834e235d
|
| 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.dev202408221723794729-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
d985fc28592dc1faa0db3ecd8ece1e08fadb197b75e13d9aec52a0fa0d973f85
|
|
BLAKE2b-256 checksum How to use checksums |
b60c9b17a614e049f4d8c46aa4b7ec5ae40afc3d748228c121582ebba3919c83
|
| 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.dev202408221723794729-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6b4895a0c025817de65adee6157b85f50cbadcd86da42801fe7bdc6dbb938d1e
|
|
BLAKE2b-256 checksum How to use checksums |
b852cd9bec677f650316c4f96d15fa70fe108f39bd80a2573a7bc7e5fe94d7d3
|
| 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.dev202408221723794729-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
38bcd8a302a098cb7d5a9863ddc2ef3b29ac8a36a5c5329e1574091d68ec3033
|
|
BLAKE2b-256 checksum How to use checksums |
d37ef6982932c3099adb26a5ae158410ebf54822f8e1b1fb1dc188b0839dd474
|
| 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.dev202408221723794729-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
483c0456846d6352173d7dcf05851a82ab19607ad8c4105653b7691551f66662
|
|
BLAKE2b-256 checksum How to use checksums |
a716e2715ecfb41c4cd2b21e2ba63fb28aff2ceaeea78d018d40fbb96b6d6d78
|
| 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.dev202408221723794729-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
67267bad5abeb77a80815e34f35456ce6fb4aea69acac38a35fea69a0efee572
|
|
BLAKE2b-256 checksum How to use checksums |
b4f4b4b56fb93756a4f9f1f490e3b6a13cc35294aebe510fd8c91909a634f7ad
|
| 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.dev202408221723794729-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
1a9157828277df16e73b04434d54b3e19d806aca4a0639cdf4feaa8d9ad3ab6a
|
|
BLAKE2b-256 checksum How to use checksums |
8aba3034bf55d52d1a7b005c66fd696110847977aec8a3f0b5278177b9f3d717
|
| 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.dev202408221723794729-cp39-cp39-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f031d96d0135033875ddff9f23373a038fc232bf3b5d773f026a1c6d79d84865
|
|
BLAKE2b-256 checksum How to use checksums |
13cdfda97d7b28d0324d013cef1579eabc966edab01c0f73d85599839841c8ef
|
| 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.dev202408221723794729-cp39-cp39-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
d70340b4240f19d792252ab0b4296190918057b65441b135f7e46f404eae9ad4
|
|
BLAKE2b-256 checksum How to use checksums |
e1c83b2248c4f838ae791d51eb3650c3e4f3690d863892ec0cbbb63cf1f14383
|
| 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.dev202408221723794729-cp39-cp39-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
dfe054f840987ba9c27c053949e6d90c6fd6fbe0ba3f72e7192843a4b314d2cd
|
|
BLAKE2b-256 checksum How to use checksums |
b267ec5f8f4168109b60331cf589aedbc6d21adf89f6a6a0537e4684ede47440
|
| 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.dev202408221723794729-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
b7c937be2729f8564c8de2b0cfff91490f67ee2a5640b67e0125d9784d0e0051
|
|
BLAKE2b-256 checksum How to use checksums |
da5e400a6e0c9bd46a7c583b997e4eb74682cf131fcc93e4b31017e1cf32d024
|
| 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.dev202408221723794729-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.1.9.dev202408221723794729-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 |
33aad3d0b5cf0ff282ab6df5926fdd97d17c833a6181c893b05c733d20fd77ae
|
|
BLAKE2b-256 checksum How to use checksums |
29b768a6b69503108c047064d53ee90319ad2f1f6a499cb9a0a25f9a410a3779
|
| 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
|