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.11.0.9.dev202401261701813464-cp312-cp312-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.12 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.11 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.8 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8a93639284ede6c08387cc21bc388f3193094855211135ad258473d759de74a6
MD5 68709ac4906bbbe365fe89e1810731e3
BLAKE2b-256 9fcdb2860861f57a791003b7fd3d96c20bc21e8b0afb9c4acf08c3f991d39350

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a2fa27ccf8ce0e8f2c287f4c6695b0d6a3713bf04bf6bb205348d4bd6cd26996
MD5 0ee0019092ee16c72c326c9825e498a0
BLAKE2b-256 650cfca6fe9691f6c824705916110bd1cf3061233b6788efb698247346a44d7e

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0b69a7b09dc092d706e95af12318b6e65f2dbc6a2eb764b900576f8b9c6b38f9
MD5 8ce4b488e11b221066a3fddf795290a6
BLAKE2b-256 fa337cc72a0c3689430a23eec5a73d72f4f548771e9c0abee4f953b82cf7887c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 30e22904edbc095e0a56271487da6692cca745fa7043f1e1a6fa10323aa075f1
MD5 906e8754642e03f2d9facd3166c2c9cb
BLAKE2b-256 2d7fe330d943885ff27671724c4221cc1af9b8b966584523a909173cf43867da

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3c3e83a4b08a8cb079c0c59ebafc98cc1f2daf688ef2ae5367a645bb3db924d6
MD5 b5c73acc6c9b6bf830a810669e184fed
BLAKE2b-256 65707e3a586e85b16f64499ad5bec20fb8fef023b6a44412cb92fe1e20960135

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8c299be4848fc243fabcd15fdc26272e9cf839c10c2cf2b4ff782668b8016047
MD5 d39240ad075236f6896431bacfeed401
BLAKE2b-256 e6e816f05a3ea4b2d996bcebdfc7a31d329fb31b603372768e0d60b6943e6261

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1206b26d95a176b915769cccc02e5f2a088849ec394972a3169674e371176aa3
MD5 5defcdfb02f0466f0094ed88c54659eb
BLAKE2b-256 6a6aa9261c8442284ed3bff2f6d5e97cf7cced4e0be4bb253caa91a448358e73

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 206d28292e862b018d8f633dff55c5cdc69c244b30a5b35dfcd910ef0238a19a
MD5 c5fc7ef8a1cd1555d2aebb0cac8cce82
BLAKE2b-256 925b2ed3ef7e0664aaac9f8b7a08bfc73e518d7a1a75d1b659286cd6dd0e1ab2

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2f4a599df08dbeedd6489739b761196f2b41a4ea842b608f8ae3af06ff829e2
MD5 e0e7c2e3c8f31c4be421551996b5f72a
BLAKE2b-256 063d4c3e0f99907ce2b15fd9d9329bffd36d526f7462f329dfcad0eb545f3f35

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 61e108998b6d939876ee3dcc322d38a77eafc13821eb82ffa140962321c053e9
MD5 4ee3e3d5c2023cd6eef0c90cc9172a77
BLAKE2b-256 0054af73699a223a865eec3fd426810aa92cf7fdd8c5415bb2835b8b6a2bd3d9

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2474ca27e20b89dc7c3cca50cf5fc8abebc7b68688007cc5f2312d52d5f865af
MD5 e12523fbcc815960ca039479332bdb54
BLAKE2b-256 c9ca6be062aacbace1d10416a1c25437a83fbba814957e4767739a2da17f0a32

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d25ecf34fe2ac2bd3608fff2eddbafcf484321aff12c633b8146d1dd05bc8c27
MD5 06f6f6839d8f299cd55b9c28e119083e
BLAKE2b-256 dab78f1af665ab5016ae10e173e3feb066242fd508e6ab767ffc808515e8fd1d

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b0ecd66b7670257b70a2c5f5911449041e3c61e0deba7902f2e271d29ed6b9ee
MD5 f397e05a27cd58e2ab2104cdb16b6449
BLAKE2b-256 3f89236b44cf5894aa2fbaa9fcb8909beedc38acde8790cdb375d4a22017fae5

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d66c12225085eb23a93192642301ca4a6e272504011b5bd684fab6e6b69ffaf4
MD5 d14f26356212d7dc2954db4030f9e95d
BLAKE2b-256 c60510aa2da0021843d040f65c82dfa5ea3b8e357dfabc190932a533df198cf6

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4b648fa974bc9d98e2ca6140de863c2a2163acb91e46955008126b5f59de8233
MD5 9dc1716c4601e6c55c51da3be75ea25e
BLAKE2b-256 a9c30436eb6e9dbcd60e204447a4a00c19271ba912e04781463751d98cc4128e

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 27237bfe1427980a52362151c464c3a70629e45914979c4c4366d7e8d318df97
MD5 42abdd82efb0b4bccc7138617213030e
BLAKE2b-256 8a2946009d798efaf58d8c7bfe3c5ead54d17cf1f7ecc7a6c7718b6151f3f707

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 79b2f877b4269a578566c823371955675b00970a506185db522329fda9009d49
MD5 3253dde270288568c178f8d64de696ac
BLAKE2b-256 8610be2e1288f76986b8e1c87c19a9c5bf2c29bbfe2f9508b38ca38ecebd2f18

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 14c3f02a39e7b48301344cc9503606797da26b6e5d5f7f00bded51ab99e82445
MD5 982a85f9f1ffc665fc297c359780581d
BLAKE2b-256 05ad00197b303c853823d5258943a9f5ad5c2f77016bc8c0e481490572859757

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1f37b4b0ab3bbc29d70ef9562b17a5e039994e0ad8d449ca03a4eb4ca0c6fc7a
MD5 4acef2ebf3f8858fbf8557a23cc7f5bf
BLAKE2b-256 86e3c87b382da804c7ee42c5f9eb499f280ee502c1082171552e6292534796cf

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 72d425907ae72d2cf5521db19a03da0d70024fdc64ab515a04d85cc35ce2a587
MD5 d42a4688abef9ab7a104f1fad46fdeac
BLAKE2b-256 2ab31ffb001740fdcc6cadac8ebd2e0c0cd8e78ec5ced2a857d7f5446df38d11

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 5a64a0c8510e19844509f56d8c428faafd177bd4a7e40e4b0e566ae32f9b98b0
MD5 a3f0075dcb300a18b4453fcf667f9826
BLAKE2b-256 7355922f3eff6f12ab20b795d8273614dc50821e82dd2293f69a11db0fb4f17e

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 92287f337af5189386705b56601097b3a09947247660b260cbc01ac9b486754d
MD5 18f79f61a20735d4527a26b072f20184
BLAKE2b-256 8e72871d54c9336cc6d234215f6a16bc161bf20c57d419b73b8cd3d1bdb40681

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cba30474d86407a8c52609fbb2d39bda108ec5551b7e4e52f92f980b680558ac
MD5 76731d464fbb663b169f5304c60f0fed
BLAKE2b-256 dffbc3a19f3a7c706dda50e7a625a6f4add535a027d51437672b36ca23594d4a

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 74f319230c7029c3786840a2456648695438c20cdd1aca52c43a1d4928632f7c
MD5 27206332c329a7cf70ed0260f1009092
BLAKE2b-256 a4b38eba6d74e1dab941271ec2f9290894d44fc0452c8e3c1e33e6700e4174fe

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401261701813464-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6f97868bac6e0bf36662fd5eb8b8c9bbacf5ade475dc61e98d5f5d9e0592fa08
MD5 87e05c74fd333cd82b82076ac9e33cb0
BLAKE2b-256 ed5481312a9ba08811c593fd21f8b021ab3ef0d822563cd63fa76954c74ae97b

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