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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp312-cp312-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp311-cp311-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp310-cp310-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp39-cp39-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp38-cp38-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp38-cp38-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a5fe31abf2a2bc691989510e212032491adfcdf85462c7b255eb6d628cc4bcb4
MD5 c56c2ddbf74f26587014365204d0b297
BLAKE2b-256 34d50b4f5af23523b66781eb37445874976f9d93c38f7299d1c32a401db26d92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67bd2cebb0ff256c21f043663c9e1198dfba4b4181a5fd7cfee5e82f15f8f439
MD5 e250ff4d37bd9dfc59b4270c9ba323f1
BLAKE2b-256 c2dc8bae5743ffed1084f75dd9ae4bb980420662c56c185b4b7b1abfc7f96fe9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 12a7a1312320e356bed45b15f0652b195e756846b37af990cc633622fe9770c2
MD5 f40e5367e6cf63ada09dd6fa75b7a249
BLAKE2b-256 e121ca20581d65d4d4bdbe5bda82e72992db5f59dd7f9e5271a6a10dea7c5134

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 21b6fadc50d124893122266f9d14e36574120c45f95e8cf020968255d9833478
MD5 6e30875f0cd81d7a535d7e2660bb645f
BLAKE2b-256 bc8133ebd7975721acf323501f3c4809b0f3746dd0ea29af9d8fa81b735b29bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 44e163756c66a88f414b0f0648a5e2ce7749ae14b05fe8aa82e22636999a86b7
MD5 6025b8662cb5ccebc54d9c7364a31b4b
BLAKE2b-256 2fcb202b044487d7cc7cbdef2addebe08f958a644d7f49b967c6d9dc1673893c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c8527e2d853ae17fe16e89d388b6ed7177a590c41d04b451a5e31f554f3fa19c
MD5 93bd04b1e55106f99f4e3178683ec63e
BLAKE2b-256 fdb77f740dff52fe846fc2649db32a0f5fcfef112e54a393ea842d601a2c4a29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d7310e8d623c2a7937c68309532b443c1c23ec262f21874b2a00920c90ded441
MD5 6f18a9e23c7e87b598e96d970bb619d5
BLAKE2b-256 72b5206becd6e6fb48ea9b0f89a11761d41ba46d4a39b9b4e4eefb3cb3d03ade

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 253463c798bce833da2f2f3985a99a8b98f45aa19f3523f137c0ef71d4c4ab1f
MD5 19b7fd04de6ffbcbbff8eee8f093109c
BLAKE2b-256 3abeba3b4d788437c5d9d54fc18fbfe496c32b23dc081550c7fdb685d7b0eff1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 58cfd05f7a51b78a73627576876b3cad0d7a0e56de7c21f2e649168517660f79
MD5 fc98efd08c115e73e3a870b021ce8a7b
BLAKE2b-256 3652df3f04dcf16e3fbd9fabd72dc8e3982174562c98aa8f0ab62b9b1eafa005

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 35acae786fb174196a9389cf482bad38c4f048a08efe78565d2a0d0b683b81cc
MD5 7bf30b80bc9b8a675aa884c111720505
BLAKE2b-256 dc99f639716f3e7b2937d94cf561900b3eede1bdb7d1932ea5923a5d1ac26e16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 eb07f0cde752a23bf97b568fd32f7d9a7a2e8f3019236b41fd5451cee9b18a80
MD5 db3e97f4f10663490168ccd2a9517680
BLAKE2b-256 3eda84faf1a197e42d8f75ab375183518f2d378dcc9e0b65adff596ceae857bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7645bf24dd2a9725f8f0f1771e46ab1f47c071fb8157593b55bfeb833fa45e38
MD5 93f2900fe0418fd4a9778da537d2bd8d
BLAKE2b-256 82d4eaacd63ffedf680bddc613e4eac0db4e1dbcde6d62a30e8bc9bd4dfc28c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cdd84f3ffcc4e2468513f20a0872df6a673b8b3691999a1d0d5efedd178a3e7d
MD5 244e03e134876a9b621d293024f7b4da
BLAKE2b-256 c0d6d71fbcfd3ae33ed5296039a77a371a2be71404752612d3a1a9aa4e5c8bdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0dbd94fe0595b4ae0982e654911c334bbfaddc3d576d1e9fe010ffb1ef77f2ea
MD5 e95cca7bd971f4f81e20a93a4b499095
BLAKE2b-256 63489919248d9048697d23c5fb70880b1ecdd3e89dce25df95eda431894f7179

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d6901a9ccd8f0753216b495580d93f5d9eb4f8b80f207300d61588d35fe845b0
MD5 098c30aa11726e6b3824025ab440fdb3
BLAKE2b-256 bb4496209b1c7f589bdc7bfc8b90dc6d18da4acffd7c955b0eb56d924760f0ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 36bf37c1b41e36bfa85fa0b7059d9a731f538c689a6ec21cb252455b6665ff19
MD5 607336d25f3fa7ceb748cf5f3feb32ea
BLAKE2b-256 0f8144b969e2c51205af657e84c1282c95a1dcc7176a43693e1437ef286db5d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 246b91b69d0dbf97ce5dc2847f31f11dd04656051cef542d5230c793bde1454a
MD5 ada110d085c821beefbca923163791bf
BLAKE2b-256 d726ccf314eed6d8dc56d57bedee0d3a23184b9c16e8a2104fa7ef8e257a4b27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 768873b9d27b072a0ceb067e327a75c9b90e7224778cc328479669528616c351
MD5 4d041c3a45136df3d30fd64c2dda4c6d
BLAKE2b-256 29ee80fe63863e2a71939e46db03da44bbeed2db16269e5986d553a2b4ede3c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d9ec8c4fd12fe2fe82fb9bf97917454665ae190beb3a3727b431f5f066530f0
MD5 e65bfe545f5aacda0716f182707cc83b
BLAKE2b-256 f9e60f8b8a5bb9af60ccba831a733bf83d4cd621a932a8b68e329a636f0a6042

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 04e6811d56b1c1e440ae1c4a41881cd0c969d314cd5e622f8655e06fffe30b6a
MD5 fab18e7f5ae572c4dd16b3786e07c3d1
BLAKE2b-256 c76cc3b9f1d93e9f74bc865b31dd90c61220c1f81ae9ecb19b2a43abd01403a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 cadfd2de7ada6f6e32aa21173ce449aa2a5697523b019b9eee906671ac0b709f
MD5 42e3a026a0e54b0d45900874e6fa592a
BLAKE2b-256 ebae2fc97497ae186b39070401160a7082c0e3061338d351e79612de1d255154

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cefbebb08531b90215ca5411602bc89227a4ac36be30be9a8040e3cafb5065ff
MD5 4291d244177173cfcae8e1447a68a3e4
BLAKE2b-256 9d680ce9f8d7a3b1f6ff52f00df433c947dc4f0355219ab2c7ae2595031f1d9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 eb7ac34ba30470934c6440acaa61d68f8311b499c8059a470161ea4c7529fd3e
MD5 bed0456f5444bd6d683de37d7a347028
BLAKE2b-256 ac8e4d6661b97fba40c1bec3ab57f4c0fcf68e867265c34bb30502c63aa98b22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c18204ff5e7484bcadf67bfdfdb8599273af0dd54cd86fa6754e65b3242d9706
MD5 40156e92f21917cd4fd6a8ead9b6cca2
BLAKE2b-256 040c72e8a2480d1446bb145df11317a55652fda28cf63b292077a6ad51b82462

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404101712167003-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 38f15e24a3d5a83e9b5c6d373dccef2bb37470d67368ebbee2b07813d254aeea
MD5 545a7c4f2bd9dc24887164673ad31022
BLAKE2b-256 95e9b35e70c52e6bcda9c33a872c0643d5d240489397e5fc472fc9074b2de1e5

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