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

Uploaded CPython 3.12 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401241701813464-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.dev202401241701813464-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.dev202401241701813464-cp311-cp311-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.11 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401241701813464-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.dev202401241701813464-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.dev202401241701813464-cp310-cp310-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401241701813464-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.dev202401241701813464-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.dev202401241701813464-cp39-cp39-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401241701813464-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.dev202401241701813464-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.dev202401241701813464-cp38-cp38-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.8 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401241701813464-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.dev202401241701813464-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.dev202401241701813464-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fd501f2b764ca7e6a973fff360e3ccf3ddae31afa9806373d11628497b1a2551
MD5 e420e9426d8a8f64863c810ee9188245
BLAKE2b-256 4b3aaa23cb4ef65809c9ba63e2b6a9ee0a4f42f7bb5a1444b28efad08da1e00a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 161c5c7f9e24ac2a55f34c2bd87984faa2129f6bcfaf416861875e1cd175dc46
MD5 f5af138e4528e0c7d62b673a55b4af7f
BLAKE2b-256 da4f8903d8fc7e0c572c1a7418396df49900edfe17192be674f246d928cf79f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5e3669d59135573ea1e28e445a574f175c0834cab65fc71c6be9e4584659ef84
MD5 6641fb0e80d6d670140ac8bbef1d0fe8
BLAKE2b-256 714f96e2d7807827681c3af36d6635c4d863db3b1181979b16a268180c2d2359

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 28310eb4a30f883693f8a2f1d4148c13ec34eb7a8c482bc1c3728f60943b29a9
MD5 de89d5a060bc92eef071ee96150dac65
BLAKE2b-256 d2e032b8440aa844b81ea68bd2d064b92fb2fddd27cd9a80b1b84c8670649da5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a11f309b44d0c5dc0a32710cb605f46ea634ca747cfaff6389068a21cbbb0514
MD5 75b8beb8b109e2d14b6898c4caf9e9f4
BLAKE2b-256 c6e19424c85517459243fae6767ee23abcc8a9d088f000294a1799ceffa6ee5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2f52f526ae6b4dd2d7d882e6ea42b1710db64809ead1e57ef5bde96e357c1b51
MD5 666e877417a424fcecf45ea3e203227c
BLAKE2b-256 cca982f33b5a19bb9f698df265557173a8daadfa78feb34ea2c1fb935a2e7f70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 13e90f9159e0f3e3643ad7b3324f43aa47705b58fee506f14018d8494f1fcff1
MD5 62c48bb04995cd1ca75fc5fc5d80099a
BLAKE2b-256 fac8bf35cfd6cfcf23b7d371739b4c06df7106e43ab9794ba129d5a43c74130e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8dee40725654d178741323b2890f60155eb56e30129f6a6cc511a6c9d47b22b6
MD5 58cd309f0583defeb8549623b496b578
BLAKE2b-256 08a84a804abcb8e6d0a687b020a5261a5cf7f534b8f9b41ad36cbbca735be8d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45b775ec6f90d8cfb1d5879667a4b7dd02866d712bacaa5f3f331eff2198a075
MD5 020a5defe867d9e6b4d75c0a59581ae6
BLAKE2b-256 40e74697513499290a7010c2a50f3e7c7af7ddc16cefee4ba78be7ba46c2f243

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3eddfd2d7adb74cd5fc6e8c3bbe81cc210b1f143b79382cef6468a3d94423661
MD5 5470adc9c86981445489df3690cf7900
BLAKE2b-256 94e7a8ff433988be757ca365357571087485f7448cf62d4bd85fb88963d87e15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b4b4ea406e1bee5c7af390eb1503bfc0995b47a8a925400f621d37d6138ed4c0
MD5 7ce6b06a3c544b6d6e0488820077f82d
BLAKE2b-256 f10c693d6b7578c2669b3cca9f455b039a31b21ac96e49e17c45349fc2306261

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f182e01a6bd50d52d5487a8d8440eaaee641ec74c15f46d97625fc1e353939fb
MD5 aa376f0f5e9059a18afe0954f5b1bc91
BLAKE2b-256 1131a29130de6e6961a0d746fa77f94f21a4186a75b191f8167c9b4d7e847bb9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 54b86f60e1ecddde50121ca99bf7015cf480835d12a2fe7ba4024c90bcdadb78
MD5 91f0c6cdd3b98327a7a12b8977e76310
BLAKE2b-256 d661647a9ae2e57db3eaf8bd16388da37764d218b2f4eeb1d5086639d720ff24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3c37e0a4c846181804ba8d08e3086c981eb18963d070a1f08ed5a552da0af2b
MD5 971370e7d3245dcdaa2c8f01893b21c3
BLAKE2b-256 4cfa220b526b8ed187f1e8f4e3602e20d9a506c6f946e4ffd7e9e9c2542e0265

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 93b735039cf70397f3d0e897704422504a38f92922495df9fb2deb42dea401f4
MD5 5a6ec7a2a7d3e0bdd2c05f5c121f79e3
BLAKE2b-256 fe62980ea1ddfa4ae55b1229d317dfc5a20644a359da830253c833f69a4a8f5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 559449e183591615cc3a942c59f6c51fc26cb966a1e6ea25c946ec27cb762907
MD5 d3d865c57f4195cc07165343ab8ae270
BLAKE2b-256 cf38f1de16559c3c16b5bfb24a44c5e3e162d3777473a5c07dfa7ca025c65dae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e79d3f7d42b0f97b7eff4595464a4a08af597ad6cabe0a011774cab0fd1feb84
MD5 8a9646d6972fc10912a09cc038a726d0
BLAKE2b-256 e417b4760efa3eee80c8ba45667d74c41940df6df09187115c768661fded6c4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a3a24db5bf9569a40033b57fb544df669c943a780d888e968eed4248c90e23a8
MD5 acbbf8e42fa7c79575be05be2c45397d
BLAKE2b-256 8bcd069957e6ff88705f31b30fd3091f64de1261e2186e1bb2300f6020476cfe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 98444a96b207eea2e92017a2fffbe4fffc1c57c5b21cb747d1b3d5053ab45595
MD5 e87b959334a81734fac05427c1e655e0
BLAKE2b-256 0defe5fd9263c2d7f0a3abd5be177c1d1745acc4b8d3fe8e5d54660e76e6f5cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4aed7186f0f76c66dcb141381c3bf3116e44f4531a86b718e320f8e3e1a3612a
MD5 7c972e31ad0900fd102864a663213e89
BLAKE2b-256 d3d5ed6947d1a0fd1fb8b5c6fac1ab54175a8e175ef9cf4a29cc3507be5355d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 31f4a1e72ed5fb59dc3051178e8a8d30a8d382dd94695756c8c3b5fdf2a49dc7
MD5 458c0dbda0562079709fd3fdd4ba8382
BLAKE2b-256 f4eabb73d89dc6e8aa70903c817d762c167e8ac3e19a76b73fcb35ea56faaa02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2773f0577cc6409638a0ced95f6bf20acf8a3e1331a19193dcdcb984299a24c0
MD5 382457c62b0d677ccf39ff97dc23d492
BLAKE2b-256 8792640b39b7c35a5a3f3be065255cbd0242a4a69791d77a35ddf2546cb25697

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dfbdab014eaaea843e3429e1e5c47ca34c8e01a9cf3c35aa49d6ac76a13183ce
MD5 84549dcf0657f679ee79fce8981fda14
BLAKE2b-256 085a3da6a4596e09baf963374e68be6c5205d00d8c6a2e9870098fe96221734f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 798078304d9cbe2918994cc6df2d04fd4d961603fc27af24a7632ddb3309de0f
MD5 8b032bf09d092e60f5cadf682b9ac216
BLAKE2b-256 7794216a7a4d237fcc4deb6fbbfa0ebc09804eb86c68207013f5b611d52f6041

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401241701813464-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6f8f83b5a96eb8322639adcbe5c8a2446649e5614e1f198865a31a0f2ce78dbb
MD5 b8155ee8213799bba3c673c62d144361
BLAKE2b-256 2aa8087e4c50067d22a2834eada8bc57f694617e1cbfb06e05e210a783e6e967

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