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.dev202407241721169663
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.dev202407241721169663-cp312-cp312-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
99e320d9b8b755a9fde25b43580d7d461e6f153360195f3601709d54a01be03e
|
|
BLAKE2b-256 checksum How to use checksums |
396d0ede961595e32c442003c885164f48b1d3290a4b4d3887f33826ac953be7
|
| 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.dev202407241721169663-cp312-cp312-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
3739e08a77da13d26fbbd83355cd32f7433978bd03b325ca2e1fee551d178707
|
|
BLAKE2b-256 checksum How to use checksums |
642f36caf5658abd280a8f5129a3ff854533395075c9c92e23e6abc8f0c05127
|
| 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.dev202407241721169663-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
80e21c8bde26b5dc99c9aae32064526d3f3f32bc6e2f053989ef61db7578b37c
|
|
BLAKE2b-256 checksum How to use checksums |
73c1eafb342d716d2966e2f0be90da1313690e2dbd18fadb15cc83eea39d0217
|
| 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.dev202407241721169663-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
151cb61d58bb1dfec38fcf766e293d1c2096ac571e51db6a8ab904f80cc63ef2
|
|
BLAKE2b-256 checksum How to use checksums |
8e2c50a00c20a73ce1ba5d249f70e6f11e7c9e735977c9a98ad8cbee56db3881
|
| 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.dev202407241721169663-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
d2dc51fc97bb202617a1cb618ba54284d8a8afc706904373a362d6970772b013
|
|
BLAKE2b-256 checksum How to use checksums |
0b7edf18b8b6b4bb608e47494bc14d3e10603fa12d67b3708756a7fab308898b
|
| 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.dev202407241721169663-cp311-cp311-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
886846bc28f0a1bc536f5d5146373ba527af088ed7a82cc360cb5405460b4072
|
|
BLAKE2b-256 checksum How to use checksums |
8b766b9ed8f5be6ff89c7b9ece6042c0dd05bf610fe066aa94dd0d45d5135d8c
|
| 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.dev202407241721169663-cp311-cp311-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
86475844a5bed7ff73e53d0c331ff292b2a41d15cb1c85b6b1f959fa5ebfe4be
|
|
BLAKE2b-256 checksum How to use checksums |
cca0266dbcba4426d6f057ae851a1f89d6ffa7dfa0403f3d052ed6b0707263d6
|
| 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.dev202407241721169663-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
cddbb527c359f2facbde56e075ee0cee7622349202c46f5980c940057c20b906
|
|
BLAKE2b-256 checksum How to use checksums |
692c27c3b0ed86b35c0a0d08837363a1f29e9bfb8c4f963d67f5971b6cddcc1a
|
| 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.dev202407241721169663-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
5738d4a3f92fb6c2df981d135c4b2347cf450df68334a540fc1acb329e1e0437
|
|
BLAKE2b-256 checksum How to use checksums |
3eb7afd2f6495b42cca27163e603d763bbe08e53a303421acd5ea807f1b8af3e
|
| 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.dev202407241721169663-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
51284c67056f762de231d757c8b3190ed1c2483d35c46b3295c2ade5f04e5e6a
|
|
BLAKE2b-256 checksum How to use checksums |
5da1f879e357a6b2b99a1b6bba1076d46b93d3a2c4a7344688d01acad478b4b9
|
| 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.dev202407241721169663-cp310-cp310-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fc4042e0306088c180b32dbcfaeb4471995fa8fdd106eb6427da29ca5e8f2631
|
|
BLAKE2b-256 checksum How to use checksums |
0c076f3035303b7ffd6a9f76c6f07dd58dfb38b72ec2f4c141fbcd955f8c2409
|
| 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.dev202407241721169663-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
2a30b426b4844b0415746287ed7bca00ad2821a28122883dacec48e5d585ac6a
|
|
BLAKE2b-256 checksum How to use checksums |
b651e0edc77fae27ad83a7890fc8382aa118e69e6bcdc228cc4a47b9fc02071e
|
| 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.dev202407241721169663-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
2e39ad59b20ddc48d9985c1c868648c9a11eb515a8220b03f595e4d9abd34ef0
|
|
BLAKE2b-256 checksum How to use checksums |
8133f9fd00481561465558d83142e440a8bb6608c006a41ea5d5d0fbed557dec
|
| 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.dev202407241721169663-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
753bb5a5477bac43f8b3bbd0e3ddfe2dcba28007e9eeb875410c62352dece8aa
|
|
BLAKE2b-256 checksum How to use checksums |
c92220db10b6ef985de3bc42e65bdbfb6372e17eeb19d55496eaa9e7e34a2dbe
|
| 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.dev202407241721169663-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
6af30a25183129aac1a3cefae4cd8820769e22ab70ea46f4504b298a4480ba4d
|
|
BLAKE2b-256 checksum How to use checksums |
bddc1c75d3e8202375e1f90bf2cab3ac7d2839c09970c5f2a77173e964d59058
|
| 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.dev202407241721169663-cp39-cp39-win_amd64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ee5da13253863becd18efdf89b94d11c763e8b16144bf315e270f4f5473beed4
|
|
BLAKE2b-256 checksum How to use checksums |
7b260fe91277f205851bcbcf04015e5bb7aed270ac6e5664f7e6ec25260ab641
|
| 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.dev202407241721169663-cp39-cp39-manylinux2014_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
7c76ace5992c785def37710dd392f62c83c2a5a1f71225b4593e53df1e29081d
|
|
BLAKE2b-256 checksum How to use checksums |
cda003a15d1a7d7172aee92ae7e6d4e3203e55960f06d91f4e4c467add087e36
|
| 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.dev202407241721169663-cp39-cp39-manylinux2014_aarch64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
9a3b862615688765adbd49c8e531c09d3f1f53f727bf400a117e558cf6aeb522
|
|
BLAKE2b-256 checksum How to use checksums |
4f383c3dd7ff4b1efc2e533dda2d6f71acaaa53565c38f9e4adb2c810a5c833d
|
| 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.dev202407241721169663-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
e7654a1dc6676c29858ad180b252d0eb4dc07288e00516e7000f33f61c8282f2
|
|
BLAKE2b-256 checksum How to use checksums |
bf315131800f83ab8942ddc7d031eefc94a796a22669abfeee38a606841ad09b
|
| 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.dev202407241721169663-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | pyAgrum_nightly-1.15.0.9.dev202407241721169663-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 |
ff713019b38578044a4383f06edad5d8e89ad27e78959f6254c48fdd5f5a62fc
|
|
BLAKE2b-256 checksum How to use checksums |
2d3f6abbb24cad0a663b3a274940a35d7cb512525db12085f001e38b8fd13556
|
| 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
|