Skip to main content

Bayesian networks and other Probabilistic Graphical Models.

Project description

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,2023 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.

Authors

  • Pierre-Henri Wuillemin

  • Christophe Gonzales

Maintainers

  • Lionel Torti

  • Gaspard Ducamp

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.12 Windows x86-64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11 Windows x86-64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8 Windows x86-64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bd4b09b2de8e4601874be91f2b832647496cb7c18c9011945dc9570f11d9b4c1
MD5 a46610cb7c66d1903edd3292a94773a5
BLAKE2b-256 633837ce220eb509994e0a6f954f86ebf1c693b4c75ec4620ad2ebc509a619cc

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 95738ecf83501acf7aae7a1d724788539178b9b7cccd85d1f3f5771a1684abcc
MD5 886a52bd909b1a845330f91cb318f850
BLAKE2b-256 3e247103b9f8651d2ed86f1e763aed752e35a8d5a7af231c04a0682f7e88f162

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e605910dab63fd337bca365b302a7539e4a1ac52fb400af156f5814380afe505
MD5 71009bd77233100d883e399cb9cba175
BLAKE2b-256 ce131b17d81b231d26dc9df855c62835d422b00d9d5df781adb2f0028b6d1d12

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b7db40db607d5b82d34eb872c82d7c7da6ca10b52a238a6e1ae62db85436cfa
MD5 c31153aed56c64b0223c229d47d45f75
BLAKE2b-256 439f0b2fffbc9a32d9b8da5b24b91bb36536dbb75c7f3eb3b3dbcf1442490539

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4571b2cec88b84bce97e17b3024fdab31888ceced7b8370e18774df61f486c1f
MD5 7461df7a325881ce305c6e10305e095c
BLAKE2b-256 f7683517112659f48ae74d9ee1b73a3b4ae1139549472fecec29c4412feead66

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b9bd5b70384ae70e5a51a3edf250bbc964d3c7309a6b68f11ee84485b247e060
MD5 d9b041df14bb11e5a18dfa0b0fce653d
BLAKE2b-256 afecbe4ee72352c71911f93030f5144f5c5f2746cf756a7a3936013a46897ab2

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c08f7402064fb0e992a04c1dbcbaecabefdf7eee15369e3ef67d68a97db085c
MD5 911f805439d638bed16f6dff80daad4d
BLAKE2b-256 31d3555b8da223afafc506db466a135789511d632d64d9014a8507bb8d1a42ee

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5382100f83f44d123be6645febcbbde8801e0174d13653883a51e6de10741469
MD5 1ff6836deaffa9a50fe7bc53f60d21dc
BLAKE2b-256 5373ed5a1774f3dfc4f175d31438f24579b427cb3e54d0193c7bc13447517170

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 969e817065c14fca2790ab2e81e5feeecf5a1ba70b528983f2355b1885955cc4
MD5 37142e11b77f66bb83ca1fb8d9d0c1b5
BLAKE2b-256 2f08dbc809c8123fd1ca3e8fec3ce25443a8915871a74c45d33d6e7cbd9025d1

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 21c04aa0bed236d2f151ba5fe63adf9af77f997cd8b708f7e1d0b7989557adf0
MD5 024d4ee8f2c3276336b7866f1bca3b10
BLAKE2b-256 2fa60c1f57781513c59c8735e21ba66de23195e859ebda10d0bf06f7d1c48f79

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6c3293c1ad493e69cf012de2a2a85bed493441670b386081c19d44d7bd411f43
MD5 235f0ec342aa6eea5522d647a6a7ef4e
BLAKE2b-256 7e25d85d3d5badef14f0a949ed695126d5942315b87719d587f3eab594b69e70

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c98d4d85f90be46282cd4be379a86f2a09aef84793cf3235126d19e20bf3ca6
MD5 8436a2f09b0f503948fc95b5c0e8f44a
BLAKE2b-256 b4845fb9b2e30883c85b1893f424fc487e3c1aaff913e55bb4eff3c6d8de8678

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f1c65ed9ef0ec8ee85308f335e063afc852f8846786eb081d6cd7f4a1a7d5649
MD5 591f1af4b5a963910df443dab17a049b
BLAKE2b-256 459b76e09cee53e1e37096ae967c29e1a420564d33da39bafd4afcc112ee64d8

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e10aa231994bcdca5187b994d59bf0fde3b46bbe82cae5684aa77f790e25331
MD5 beb31093c4c531e119f222f7e0947c74
BLAKE2b-256 5ada61c28c1ab4871d8c5c730dbb6f6b7c1a283752093dda66c7e13041ff6ddd

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 50461c5cb43beabd6ef1f57384dd9cc29d09d17a31e30f96988dc045cebf6024
MD5 231b9b1492368492c530e82a1b61fd87
BLAKE2b-256 c1ee318c8221878dab24c0a07db0a6509f339219ed5de829fc6894e78d52fc8c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 924125b116bc016656eeab4ecff30186663762d4c959003066f7e90b113ef88d
MD5 a21d6dad33b94f64628a1b899d5d9367
BLAKE2b-256 8ad00f495c2ea737189eada71806c4a8836da7b4fee0dda1cb52efd9dbb9c82a

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f86a9620623f5bd949aef3d03f2803c32ee664306d77f912bf8e4b135080c2f7
MD5 c7fa064d4e36073e97a78c30329afa31
BLAKE2b-256 16dc1f3c2fac84ddaa01378a11476d03f1d6c89b16b3d07e6e1d26c8e4dd3e0e

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a3f06eb016aa107ced2e85b6927320242252074f2a9d55c71ceb536f7e2e1ff1
MD5 9cbc147f03d9962a96508cfba593ffd1
BLAKE2b-256 3639f28ab8d993fbd65fbb70b7e025dd641e6ea841c58d00ecdfef4ab7d522af

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22b4999e55f4a59ae8507456b2a19ccfe256b3e6053ba4eb3f889de9dd2e5b44
MD5 aea0b0b6837fb24ebcfd996cf03f2516
BLAKE2b-256 473686ef63c292beebe8ab58df40d5a73f754ead6d7ede4b563763b5994519ae

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8732b332d33f51d25d96c7dac7b07942dee5c94882a89b6e2bada0b209ca053d
MD5 a369d30d50da243616f311b77ba51bbe
BLAKE2b-256 00e0466c9fb6aaa7ece8a4290139413327275c2edd61bfa91520aa888a8164cc

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 bf068c307654438db109647e6ace94950e189638350e8e282e0f110ef2ce9dc0
MD5 04a769f779160d017d82748acbe44f8d
BLAKE2b-256 afbb2d2e59c2bc9336f809f7fb14a1fdaedd4e4a2ddbc58456ab25414fcfd5f2

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e5fc88b5bd3234a28210df899726ca70a193c8b140361e06db3942e169479765
MD5 ec84bf20de4e4e6e502afe5b87f4877c
BLAKE2b-256 05b1328e0f3b3561b5bce2dc19a7c2a0ca1d74ed08b4bb49c719751d03875fcb

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3b83a584fd04712422e43f1c545c8a755ceb4120b07f7c00524b8d986e903d0f
MD5 db68da06ae09d5a4e23b692f836c16cc
BLAKE2b-256 4c4e412ed9af1a30fd628d3d6834e44ff1b4560cc8d14775b543bbd9d5f620f3

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f37dc2021c26c5fa0718e5f08df7569e2fc247c60903b64320897269e793e135
MD5 a0684cdb12a926dc2913b73305e2bdeb
BLAKE2b-256 f43686e916795c393c0e47c63864875ed836ad61bd01e2925e28e19c3c9803e8

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405201715182293-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8059dab9e0cf432fe3728215fc5f3635476dec19d9c3afa93a480b2fffdab4ca
MD5 f76f7d0bb8292b542a729e2ba630f85d
BLAKE2b-256 7e08169c2164f5c452d3b2b1714fe21a019d5ee7320fc755ca480112ad4465e3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page