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

If you're not sure about the file name format, learn more about wheel file names.

pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp312-cp312-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.9+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.9+ x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 10.9+ x86-64

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.9macOS 10.9+ x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8macOS 11.0+ ARM64

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

Uploaded CPython 3.8macOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7d4087912b809565a265fe5f50e55cadae63536d1d131172135774b815cab05f
MD5 34b9be3c3169b03365ba6692f844f46c
BLAKE2b-256 e4a268ac3e365effd15fc2f8c05c6e8fa1a3ff3e2822379b75dbf2aa352ff1de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fc9cc2c2f7fa06471d22fcaa848774db29a09d2f5a275e84358217d741c520b2
MD5 d547a6696de1366f99641f0e85ff3fd4
BLAKE2b-256 d1e90c1dd85f263be9d37bcbff0cf0e1b601dd086601c2b6e8963a07fec2de5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b8947c065f3de5939f444319aba92903c2a23f036e02ba6b28da79fab01b4d43
MD5 78cc5a63da76b5ce680c3195ef5a14a0
BLAKE2b-256 b43ee0104f3016acea878502a411a2616bacfe2c58fcc934194f235ec3ae8e97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 61118fd8e9dbd5dd0724b7647f583853eb734e13425ed2aa050e7adc4bf1961e
MD5 20cad0859c9668f76a5621f535e588e3
BLAKE2b-256 881527fa14b40f33d7c35e0372ba334583e9329651e7510ed02a3de5d941ead2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 12348b3d824750f871929d8184ba0ba13ffb7897458e76ec87c8a7bad5f4236f
MD5 1601cd1cbd81f65cfa66a7ad7b265dc1
BLAKE2b-256 9eced68f7d6d80c949c90979bb3fccc5937d1e7232a7ba9e226f48cbf7f9a1cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7d79f7bf920fc6583c8631dc03f0bdee17a11bb913d047b6faeef7be6809cadc
MD5 c8aeaf9e7a8d8f82c3f6aa70d0a2e526
BLAKE2b-256 5c31b0fd662ec88cf7b4936f9b71a14310c75835d8cc98f0bf8fd7f9c6f2c041

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 588cffbb3df7578a1ffc666ea9bfacf0db9cbd032757336a48b4c2ac5270c06e
MD5 898ff105a6eaf4d448c9ba8b2dcd6f8c
BLAKE2b-256 e82fa3051c02ec6f3294b496441608a2e12b75700e4db37fdeecd808b23588d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c32f796ba104a3567ca1882ce36355638bac4b16e9d694267a6db9d00f06a23b
MD5 88a3ddb7b92c59a38355de509aba5fa2
BLAKE2b-256 cf4f43827b31d82db4883555510af130a1b22ead088fcdf4867a33d8e4073c51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1afae073e384bf18738d7a1fca42e98f9f942bb749a0c0b8f08c726e19b51137
MD5 0d8394231b72dbb742041cf77d075b33
BLAKE2b-256 7e86e01163bff8f7cae2b4749ff110d33ab3434e1dcc6187df68b44da9e7bdb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5ad9205de5c39ae361fdbfc742aaa3e40c0a3329440e62641000cf10476a239f
MD5 be3a63419aeba1e2530b3711c0d17f51
BLAKE2b-256 0bbd15edec8c867506b62d8a83cf0c57eeff694240e1be5dfbf05186b51e4e30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b6cc36a5142816ca17e4e3195f3c62bf611b17c11353514defc06d58346c2507
MD5 89424cd014b8321c23540b5ea7bb5390
BLAKE2b-256 a45be05b489e28b98a4e69b5ad936036fce75f1e0c350e8dba8f59552d031254

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6dd5e69b6e706113ec3b510f432f7c75aa36a97869879ac7b5fbed38450e25ff
MD5 50458298bdd057fc8322a17ed03cf475
BLAKE2b-256 f40510bb78105d1446c5eb311ef5451812f07111aba61a51cf1b3d1806b20984

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a05d7c841f0164db0723ebc1c6f0691b6299397727d8ee4cc8936b3a00b6118a
MD5 47f6431be55dd94bd90cbe8007c1d379
BLAKE2b-256 4ef6bd73f4455031d5f4f066c5be4c333a207a8970204aa6248daa0b7959a47d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9bf95c7847658221d02c4b64f548ef326df1da4ad0abd43c7ffb3442b0e24369
MD5 e4e3f9b70c919273d3c40bd3aea887a6
BLAKE2b-256 3d6cc360ad073432c6bceeab219e59e9113e6aedb79e3454c7804bb9b27edf69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 80fbc5d3d08e75f84a9bb4deb33d67a20f82ea23bb43a3e72b1d6276f9158a2b
MD5 7927d68f30343f30288338f63393ef47
BLAKE2b-256 12cf3c64411e5eb74d5af79156396cc5f289323014b90088f9b98c84202852f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 54f07915625f86b38a9350cf5e12fbf3ddd49c52585cd9f75bd3162720bf7f52
MD5 26fc91e1d7ee6c15cdd84b4612ffdc12
BLAKE2b-256 aca177bee1d3fdc0cf10e3126c78068507b0efa550ff9938d1b1eb88b8fab3e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 182bd57546df3fa89d7ab228f2ccd601615285bc8cd28637f82a71a26f29886b
MD5 b1a86bd60d82f665b4d6ce7b48c8b1ce
BLAKE2b-256 bcb084af5b79d097ebb5783c71790bf6d443b38171dfed7d99bdb27a7e6b8b4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2a426ce82841b17dda6666d8edcaafa12e61bb6d654a48c7b0d150480aa4916e
MD5 731e560dfc63180320b5eaec518f57e4
BLAKE2b-256 af250e881e4c8a9e643a24547ae51099773226c44dbcaa49eb305b7df6c41a7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a146321888d5674d8e76b434b148ca8f310f1387d2b5520f1c274f9e7febc034
MD5 5e0009a58e93119f423ed324ea35bd84
BLAKE2b-256 c7a35c82f61ebe7cd5362f70ef8050e4e72356d9a0c1bc79a4e9dcf0bd92f7af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c2231a5faeec76f10b5e499d0fb619586d67d9cff797136f98c61c7f829ad356
MD5 48bbd04743a0bbbb44e7089db7652b11
BLAKE2b-256 2a9aa616d24ad617edc95204cf045a0289a360d34e5594a4f271c3bbcdea66b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 70ce84ada9cfbe686cee5ffc85680a81905097af53d44b5b0fcfc57015995bb6
MD5 f1d5dd31bc8ec32e65ceda6919efe73f
BLAKE2b-256 090abf8502fc5be989bb439788d3540b5c660097752ade2657d9dc847cfd481d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 301e1da86eba3467f93ff6e3749cdaa10325bc1259fcdb8be2bdf3c4808be28b
MD5 10c71a530e63a82253b19ccff107d795
BLAKE2b-256 ab97b63048998ecf248cfc6b8c42dab4ab56158d47e6663aac07a8105dae326b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0b9c78d4264493cc7be4c842abdbaf7731104ef55dd9db678bbc79e93e2a2aff
MD5 bbad02bdb1cd3f78fdb4872ee153895a
BLAKE2b-256 50012dea3bdad2bf6d35e265a5ba63bb3b9fff90812f5c931b94c00eb19642ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a2a734bb12aeee7f7b2c25349523af377e9f94404546321376cfee35fffda5bc
MD5 1ff3cc66716651e14a8d164347b45301
BLAKE2b-256 6d45c93f797b0e330cb0ed0d48115401749ee0593eb0c7c7223c8d23a99499b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401181701813464-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b65aafb40511f6b078041a6525d46d59465211337205cc66a5a1b54fd8100afb
MD5 7f8005a4110ba818ff01c9b1ea02df0a
BLAKE2b-256 e4eda207928da370e51b7db8c44e85a875c9a522dbba4d49e0bd4f9cc7fb40e9

See more details on using hashes here.

Supported by

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