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.0.9.dev202404171712167003-cp312-cp312-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.12 Windows x86-64

pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp312-cp312-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404171712167003-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.0.9.dev202404171712167003-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11 Windows x86-64

pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp311-cp311-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404171712167003-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.0.9.dev202404171712167003-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp310-cp310-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404171712167003-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.0.9.dev202404171712167003-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp39-cp39-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404171712167003-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.0.9.dev202404171712167003-cp38-cp38-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8 Windows x86-64

pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp38-cp38-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404171712167003-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.0.9.dev202404171712167003-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3fa91ab916eab39a921bfa9d8ea889422f5d36fab1397fa99467170295188010
MD5 8c0be70764b4cecf5e0b30fe4d2d8d3b
BLAKE2b-256 5af95cbc245afb5b15b1b708cab012bbf65a839cc3149bc8652e3b482ebb411f

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0202925abd25de7b77ab94df7678722111a6b00cfe57ef1e3cb3a6a4ea882ab6
MD5 29e0f1a2fc003c86af846e45acda54eb
BLAKE2b-256 7834fa910abf38dcb152e83d269bf3cccfbcafceba71703d11b8b4302b3a059e

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c9306e35d7d0b72433e8797338806e835161038c8621717d4a7acbe666bd7bb2
MD5 7062d543cfa58709c6cfbbea75c3f1a7
BLAKE2b-256 e7ef8975a194e980313f3e36e5487903b941dc0f67cdfb10d0d87a3d29de7e24

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b80c9a8496f0bd577e4d2aa04f2db991f2dfee80fea823bbb81485a980f6e89b
MD5 b2911af4944ef82dee228e75d0e5d28f
BLAKE2b-256 11ac162ad66f47c848c1f436f64b0bf542dae53eeb183fbd61bf1be8d48ef303

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 50e53a8bfbfb1c672b7f7d4d1cbc96fc15fb46f5ac58df07d6a991eb0f77faed
MD5 71997fdecbd2eec4ad62fb795de5e748
BLAKE2b-256 f40c73b9f37f533a08697a884bd6ab43c54cc5c42c129b6b2dc07f627ba9f122

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 06ca327cab3a12f2df3dbd039b25895b73320408448a2b958543288c033680e3
MD5 681d04a253975ce66c8a982d59e8066d
BLAKE2b-256 800d8252b525df861f7493bd2ff0b9ab063ea4cb21665501da1765408e9e1017

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eab037fdaf3d8865b8cfff5ab2235d1bf625a783a48c1a6bb1f3b0ceb9868819
MD5 83823688c2404f58f18211a3ad129125
BLAKE2b-256 a36718e5c0f526dd702e11a7e2f44e946cf019b684800cec2b7c339f21cc5f6e

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 580010595d353e578561a46856308ee6d77725f2c5ca98f7e84488a3760cdd02
MD5 adf4c4d543cb063a1cfdbdd6e45e580d
BLAKE2b-256 4e0de8b75c3495b0ce6ab1ba8e0cdf79f496d13022f68e80437f046dcdb2f13c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 27350a58fa459fce4db2087ac39093392ec95396eec8a07a271935171635b982
MD5 78428d7839c4afa5b171711a4495d8f6
BLAKE2b-256 5d388ee63690f556e598087966f2a58572d7ca0185956ccb23fc0cfbd1af95d5

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7c484a545b072dc51bb4122d833b473c9b3fa4283c59ecea9f09d86ba57073e9
MD5 75f2b17b668ceb0a23bc764ec24e4c24
BLAKE2b-256 4851a0cf25f777fece690324a4a7ee5aafd44b17c5bd0cdb6301ec76f8601c3d

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7ee6d595bc6f7da0579d0e92640e849d44a64d1f0a7b96ab30bdc55ce09d4a26
MD5 b993ec7f60c54c827474adbae0ad2d1d
BLAKE2b-256 a96464b48cab1c8897406f5a2191138e6fcf5ee458758b59ebeef669f14b6b04

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 319ed7c3d44233225f06fd0261a3da1d7c41500aa56bae818b6bb560885d19d5
MD5 2d0a8c07466c2beeb92ae121f9a60a47
BLAKE2b-256 305e9b8a46e917d446cb4bb0d7989c1715d31576c37c40a08f33452357475833

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b24a33481564b814d8f68afc8101e1a3ca7c8b08ed382d12571e6c5f2e7f1599
MD5 8fa6fe7470fe8554548a6a8277032d52
BLAKE2b-256 b18c2e543cb29ce3c42777aba906e39836e2da522d235ce612e1977cfe15cc5b

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec7fe3700a916dc8e25b228f630e3a3f3eaf2cc7850c847b55edce4e7ff2797b
MD5 572a2f2ffca6f5c5e66391b5ed37e4ac
BLAKE2b-256 bfbb6ce623c6a229824be10c2a5a06fe5d1c435f25c1c93e42990f3b7706f045

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 386cec3af3a424b7224a5c6c4dcc080abba8c424522c8ffa9bcd4cf212be3651
MD5 8e383ecbefa66a423a916a3f40b6c602
BLAKE2b-256 0b3d1393528411103dacd5e6f36e1156ff0493e3f923670be72349a94c3cbfec

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9135d7ca809a184b0fee88d0fe128840f36079009fa9c57c8b654471dd9745e0
MD5 e0554da817cd33daa42fe66854c98230
BLAKE2b-256 89ae4bc7162d1d6f2d84be56c739566b7921eae6df2dae85b8feb8336bb58485

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b7fe094afb7d756e3e09175dcfa1b452603ac4ed489ceb1142adffff97a0152b
MD5 c796e3574c32d0a4202554d255de5997
BLAKE2b-256 cf69aa56b164ba96848368caea7afea25093400d1dc63c0d96cf2daa2a915e2b

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c2a6bbf3e8b3b3592e95a4eb2b3643c2be8f6744fa4468b4f307296ebfd8da61
MD5 af332f6892badcb14714a2b93dc89290
BLAKE2b-256 756c7e12b497d7fe3ab3cb02f568ba6604d48deae386eca171d8bf232a349296

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 49c8d68171433865f2976439f68e75904ef06340c0476f97fb716e12ae84d53e
MD5 7694fad068a2509224427464c49c14fe
BLAKE2b-256 0f3c0c2a3f14b3a034dad0abe4a8e83e6ba12cdc5d20047797852ed322117259

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0ebe57363a28c50e46c2ada2e86f47c46fd10c855c456047fe773e85233eeccd
MD5 c13cc33c6af9e39a072bf45d5e9dab85
BLAKE2b-256 c95564acbf3c88d66ccbee22d62781cafd92ed5a182b4ce9faa161fba094a930

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 be080a2b12541e653ae90d5b60ef1f14dc038c85ecb227cc9086c094eda9f15b
MD5 c61c0a5ce3f40b4baff0a72eb007a833
BLAKE2b-256 50d96095a47535c1820855556b1505acc4dba53e2b523ac27fff55e76ffc7cef

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5948f310ab3b4ef36702a9d4648f1dba16d1ea9a1e36918c97fc418ebcac35f
MD5 39032a6eca0091466c0d6d42b013333e
BLAKE2b-256 535f76fc613e6f8f193ec918e1f24b0a324c122a11b1cad7b5aa47a25b5b25f1

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b2f7cc4755b4cea22efec6e60c1993249cb2ae17228bdc1348b03e8bf66dffb7
MD5 77474eb2c0664153737d20a742e9e106
BLAKE2b-256 35e3f78514caeed51444fa1c55bc32cd6246c2ff1d92fb83c66799dee6cb939c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7a494f952f35b2cb104d0d5a85393a65d491eddfbc18b25433e649a4f3bb8df1
MD5 17e096245a88662a6906551484349e7c
BLAKE2b-256 d0cdd068e121b07a45870b925f6d2a5f24d0d8269b112335704a5670c46f4098

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404171712167003-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b4fe78d4b9be1f962d5a32437b7611b27d1d9f9eefc4fcfc9816086532e86849
MD5 5fdf21aa1a07cb622607b5ef29493696
BLAKE2b-256 09e1b5a0ede659d4e2268208c5948c918f9a9864b441122f7b32d1dee382f438

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