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

Uploaded CPython 3.12Windows x86-64

pyAgrum_nightly-1.13.1.dev202405041713370971-cp312-cp312-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyAgrum_nightly-1.13.1.dev202405041713370971-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.1.dev202405041713370971-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pyAgrum_nightly-1.13.1.dev202405041713370971-cp311-cp311-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyAgrum_nightly-1.13.1.dev202405041713370971-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.1.dev202405041713370971-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10Windows x86-64

pyAgrum_nightly-1.13.1.dev202405041713370971-cp310-cp310-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyAgrum_nightly-1.13.1.dev202405041713370971-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.1.dev202405041713370971-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9Windows x86-64

pyAgrum_nightly-1.13.1.dev202405041713370971-cp39-cp39-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pyAgrum_nightly-1.13.1.dev202405041713370971-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.1.dev202405041713370971-cp38-cp38-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8Windows x86-64

pyAgrum_nightly-1.13.1.dev202405041713370971-cp38-cp38-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

pyAgrum_nightly-1.13.1.dev202405041713370971-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.1.dev202405041713370971-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c635c6664eacca951397f78dab66697d7e43e8759abffb0a4f028b6267ce8045
MD5 b36c1d98ea0512c3f28aca1f1f724c76
BLAKE2b-256 acc0c992c8edaed773228c5d82ce09148e23f9449ecd3bf453d4840d3efb850b

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ef5d127cd104a7708afc2a1fa00d2648da0944f3bc6ca17e8706bc53c18187db
MD5 2f9322bf9bd54ff9efdb5be99ce1553c
BLAKE2b-256 8eb884ef407c9621fd7b312f5039a7f46b3764271b3cf19ddc35573b1136731b

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3120926568e3f09465ea6a5049e3263d84a6ce690b0fbeb3391792a57ffd7ffe
MD5 8d52eefa7f1ddb54240fbcf7e192d27e
BLAKE2b-256 077ee46092a03cd853a0044b307a65cb1dc5258a1a9e88e33d11dd534ac42ac4

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 77c8ac583b8a7ddbd7b26d329ef09839c6a82a205715ee90386261e68ec7f97b
MD5 458a1a74c31a7f7ab3cc67db6f8dc434
BLAKE2b-256 bf79bdf63c3144ccb092557cee83029c70fb1aa6e683e9ee101e205aadf389cb

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b877f06fe4148214156b0769d8289706355585054332a98a690827b4f3754192
MD5 8ac231c108fcede04f7eab75436d5c89
BLAKE2b-256 e70b5c591b5f6ee902b573e22c6d5a77a367c1f9a300d153ef76146ebda80f4f

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3115d35223c9a0a8d731243bcfe60816eb0e6683dd2c868d3b356ddfbb6556da
MD5 b3c06cc9045c97dfb5738cf373076553
BLAKE2b-256 8c91bf0b760176a5ca4dbd7b146ed004fb988a4951b6b03db3bc8eaaa3af31c9

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2907bc2bd7f37c07da6c8e92075b07d179eacc76c6151602f3e78eb24b51c806
MD5 111e2218fb7c8c358d92b7cc6975d3ea
BLAKE2b-256 103016522cf2a9963afc7c74dc4afc1031ef1786d2d2fa3166f05c1167a21213

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dd87c1da748ea7aaebcbfc986de021acdb6a5a20ea5b3e36251480aeece0a6a6
MD5 2b7973d0c8ada47d99578dc6fdff7589
BLAKE2b-256 0685813c8752e61d9eb3ff080f8da644ef506bdfc068bf4df91f9a339a894262

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4835c01dfbd19ced180617c562474fcf792fc476b0e0757c8dec93e00527ba49
MD5 b48a4aa4024dd1b9e460b95f91a58d9f
BLAKE2b-256 b2aa6dd6d631a5b5b84c35cc74a61e8483cf2bfffc0c8cb8806804c67adce0cf

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5d77cc21eae24d3e2d37b4dc9a4b89fd839e123576fef718abfbc3a0f16c842e
MD5 6d89c9a523f85721c5c9ac809e6a7e8f
BLAKE2b-256 acbb68e1fb7b716683362493c3931817ad52e6b755bef4242914b4507db84bf5

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 44e5b3953b29cd9807acd481ac90f992c6124e563f984181990028a21e6273c2
MD5 9d2a050a7b5a84e7acef9554ff86a070
BLAKE2b-256 cbc4c79c2083258c6f8ab64626781e6b1f44d2b3e32d88d6938c83450eba2b6c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5c5f3bdb252f00d516684e3f7306c2e3823bfcee62ad56d9545fb87358affe38
MD5 c81384f616a268c35cd04f5848c1cca4
BLAKE2b-256 b732ebf325e9a1815fd206ebccc962465e5fc8aaedcc2de80cc4ac55796d6b33

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d3a3cb7b3698cb5236ac9b0321ce4df37700b6e67cbd30981eb40f5f047783f1
MD5 2bd126f4e94de8ca0ceae76d8a6447d2
BLAKE2b-256 65760b23cc1f6e0b33863c718d712c1b2923d487788d01a4571e90b831a49bd0

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1d110acfcc9f19994b0e4a59e71d662ac912153dacd1dd1e9ac04844465a6559
MD5 a73ca65cc5d73630c366226869a34e56
BLAKE2b-256 6d514a243e10fe8845ef31a9607c1b7d62d1060f5315fa2542df3674eceaaa3c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 97a352d79a71594b03ef8d245f4e50b25ad27b6e757bd08eaac511786c6e32b6
MD5 f536478382e2661ac276a351d05da052
BLAKE2b-256 6fabbb45d3b0667b45c1716e455e9db917d35aa48b1f5a49fd9b7b4511c5aa61

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e74824bb96f8b3a8561ead532f614ef6b6c595cb0a5964ebcc9f8f962c0498ca
MD5 05056604ab8d6b435036c11438afe5fb
BLAKE2b-256 c7c8a80b8e5a8e94d0f0af1063720305153ea19e340eef35410e063169bf0855

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bb6bfd2a733e413068905750416a71f7dd618dea55daa0b81c7ae1b53cccb35e
MD5 e780cd05accbf81f5596992129ad8115
BLAKE2b-256 c4a3bb853e9b0f5147d67e33d48fddd44078bcdfc245c0d48e91593e7a83a34c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1505717b4cc1978cbbc8856474c88886d0db58b8ce69960ffd53e44c8ee2af21
MD5 ff7da61980cbdda2017f633f24e9497b
BLAKE2b-256 3e1267c9f2717e04a0e92cfb3d4484b86d7246a3726ad12ee935c5cb2235477b

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 612dd22b66d1fddc23893c3dc32013caeb1ca3448a311963b59c9b496885ddc0
MD5 7ee669b80aa7a12f5334cfd9ad3d8cb9
BLAKE2b-256 777678f83f4430b4faa464de20a2c7b48c5711bc493e6df72cdb7495467667ef

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4609908361524fbf9c4c1a060d03c49b05cfa880f51934d8c40cc1f84eadbbcd
MD5 34311547c29b4041c3cb10b074890106
BLAKE2b-256 7bea222bed8fa6e2288dc4f0162ef26b32396ca6d2190ac1b254e558d3e834e9

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6d23a21f4e87e34b91f9b8b2d5b294324110887c5d36d8a559f9b41386128d27
MD5 ca3f1d445810225838a86a9557d31ae7
BLAKE2b-256 e5dfde16b007e820af57e5cba0874b188f83aa4f9644ee3d020bb25da563c78a

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1f86e9b9ae9b6823518d3f73a0572ff6c6480fb63adffd9a837aa44250af7e1e
MD5 6edf7d63bd2ebe215e28c65595b9ce4a
BLAKE2b-256 a7faee3096d612e98a9f8300f6ee5c871624105e290e2eacd2824bdbf66d114e

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f559d1ab6ae044b170057cea87da8e207ccd5fbdaa534192ea10eda1bf8a8d72
MD5 6cebd94433c81a3cb3bf408e05ea43d6
BLAKE2b-256 b38312102aa45a63fa3fc218c1b77f171ff3de499bb547213b5b94501ee3d219

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c0ac4a0d26adadaf0126baf8a4afd6db367b95f6b5cb097d7c9e876086350169
MD5 db6dcac574826487196cef7b0af9ccc4
BLAKE2b-256 68724af83d6cd2dc3b9c1db73c270549a1507783992660580ff294d85fd565de

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202405041713370971-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202405041713370971-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f4735803dd23fb66f4af95b4383341c9b58b7f219fded126a9e52ccb7877c671
MD5 e695bff55b14bb5a66a89f2270c1b686
BLAKE2b-256 68027a48d753bb2677fe015c71d543bef81bfe77cc13060f29afca7d0c67090b

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