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

Uploaded CPython 3.12 Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp312-cp312-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202403201709747362-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.12.1.9.dev202403201709747362-cp311-cp311-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.11 Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp311-cp311-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202403201709747362-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.12.1.9.dev202403201709747362-cp310-cp310-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp310-cp310-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202403201709747362-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.12.1.9.dev202403201709747362-cp39-cp39-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp39-cp39-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202403201709747362-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.12.1.9.dev202403201709747362-cp38-cp38-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.8 Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp38-cp38-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202403201709747362-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.12.1.9.dev202403201709747362-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c8dc782d76c055f1226ac52f2ca774def1812ef6daec4b955ba9e10386e5c5b0
MD5 b260705aafe7fc1d06a6b9bc2f132c64
BLAKE2b-256 eb99d89a753ac69fd616717e734173c94cc9f09d91149a97482cfad5750fb7c7

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b072ba17461dea03e7a210e621b72b4bf57683d3c841ad16b22ca3a67cf62e3
MD5 83d257828cc36dccda46f1085414fe28
BLAKE2b-256 e5059d7235f9e4b409e2c5ebe448a95f225192c4ceebf46670e860ad419a3774

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8e8732e47bc467bb7085f49c07040fbc8c2909008b1e4731dac85ae2d77152ee
MD5 2d4f8c5472521f10e3b293a2413a37d1
BLAKE2b-256 26e12f2ea37f09fab854c9f8a987268ba005c05f7e3e9a7ea06867eec4632be8

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ea369f14f9a1394aa0680d7664c2901f1b45b0c4ba2debfcc7ee9f8ddbce5f55
MD5 ec883fb8d96001082ca4c4ebd9ade77d
BLAKE2b-256 3a348a326a7aeb2ddf78e550829bd0ca7752077f4b12dd24b0adf15e8416a061

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5508c7ea90fce09a44a9fc9bef15115c47df0e425cc93e79d3afff49e0f88aeb
MD5 28e6f12a29f67dcd4a415ca0f8c5a8b8
BLAKE2b-256 4e1467bdb7d2daebaf18e1fec67b19f2e2e1955166ead0527ff033bb2a376f99

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e09c1d49791ad0d4a069fe8b2398eced8449f3a780fda3df89c790567ff21fd8
MD5 4760cb6446d5094bbbbdebc61bd6e0c3
BLAKE2b-256 717e1b3db7da4052aad8ef228f01653f9fc3fba6b8a00ea766b24f422e5bf94d

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc9853c4092e2e19f37c590ca892bfcfe7e171d46ca572f8685b9a0156c2be8c
MD5 1952d93764d5c49eef7e10337336025e
BLAKE2b-256 cf29b49921b7919b502ab9e35d76d7ed2e6a4d1df173978820b7220e62cefcc1

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 48b7095e071bccbefd1f0769b3e68a313a17a13d0b48b6f1935d4f332ce62349
MD5 1f7ba4873ac7831218648204ad580645
BLAKE2b-256 bd8d4c71855dfea2ede81054cc3f7f16c03f235e3a9e03087af277cdbc14315b

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cff3ab1bba240e552880ed419d54e8b4f821f4b8edde0c2a62e25a172279457d
MD5 3783927d77e9edb56bbbf0a4fe7c8d8d
BLAKE2b-256 7786f4494618da85a27090c7c5368e52768f22de95188beadb4ead386f81b068

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 988ead9f0f6c4cf0e949786523806d472fdb925f5549e187bd6439451ee77800
MD5 3857b5ee8bcf2d2d5c842e0d4efef02f
BLAKE2b-256 77455e33dc7b04a90da6ab268efb40ad604f4451bbbefcc25ea9ae1235674f9c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 622e8edd4c1e73341ec6d28b2c19abd1c96798a416659b1ce5452c640c5207d1
MD5 a8fa79bb0b92018258ff4ac87c88b8db
BLAKE2b-256 d5ce5c6df2abbd017974d80f8592e5b68bea5ac3d94694cd367b80e90c007047

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 60e203c2060f0ef89a9dfca0067fa407348a3936672dd53070f48982f1930a39
MD5 545a3477d0b3696d0335a756d610e47b
BLAKE2b-256 fe5b522e828b8ebd9129b0afd9311bf3fc9aac32821bb6097622b1fe07dee874

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 51c782170979e2a45296a105ca66d3d3f8a1e4bd6c9cbfb62c42702085cf1595
MD5 f4439892d5a16b51abc59f025765a4ce
BLAKE2b-256 c4685e2f5952836e0650f6dc0945c472083aafd1e49a4dd9e0bc3e9397fb0793

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 80725e748a2df605c98294fb3cfeeaf29024545ff036a2cfbb459c924d8a6098
MD5 021e0cbb476b5d656d57e394b60a1aa0
BLAKE2b-256 6b910b72ef0e67c6626ae13600c00ed23a4f477b2717b18166ac7ea52d7cfb69

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f634691316b3f670b1e0e84529e22534e3308c527d2ea2aa885a531ad581ff09
MD5 36e4566615331e4527b2297e20a73fd7
BLAKE2b-256 703a2d37af34f1748887965d90c0d323ed0ccc0e287593d4a555d33465480f86

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ce0518a643a41c685fb7f73b0bd9a774d001506952d3ab0f0d5bb9cbfe8a6d1a
MD5 478250863535e64a9938b14f7daf7ed8
BLAKE2b-256 a64c170e5f3d038db465dbdfc3c01207d2da75f1866f0f7e476074b0a09b867b

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bf2b9ceb8a920feb4824754c345a4307b5c3248779d4b82c60df8ab18d26c683
MD5 6eb7773d7a09f19fc8769c8d01d48710
BLAKE2b-256 8dc8e6392734cd7e42a254426bfdb7443c868e2be01547d6d1fb6f1a31c7dd4b

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f0e2b2b1d547fde048817f7b55bb66e25cf8802c37c57aaf0fc924fd256bb93c
MD5 04a10266b5582b4d7771cca3f86814c2
BLAKE2b-256 1970be12ec4d8192cebbde0498059c7139d0b1182fa58324318c1d78e5fcc2a0

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 621b7df53c0ed63b0cb1c340db61d31c56c08e3b6c9b9278c3431a6f55c82a17
MD5 48c6ce4cb77ec88c0efd3c121cfce5ac
BLAKE2b-256 43b958c9665c17fc7b5cc0ffd198e0583efa68d10bdbdb056fbc01e76c8920ae

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6f837cd4777a0ebe1e8f4233adb4481d17e0a8d016d12ae2d24fa04a292a24d8
MD5 9cf11b4258d66ebe26916538de209a3f
BLAKE2b-256 cf0badada7ccd296663e56bcc02e90e1e990692dd27f1d46db4e45910f5d6252

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8de69c231d8ca03512925b2d58e5b76a05c96b7a335fa19a73ce37833cb79c30
MD5 3010efa585467d307322e552aefa47c0
BLAKE2b-256 d30db76f78cd21c985311fe5fe07caa75163a89c64838f91b8412ab1c7a46eed

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 109dc3593ce68ea764616c75741f38e4f1f037b6dbf0862ce776077daacf1951
MD5 1483af01138472067394ceb3fdce9643
BLAKE2b-256 d58f5b9ef910a862a2f039abd3e087baab77ff192733521ad4989bf323952f3c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0f905e50198e68e95020a24742ce14af17d2c9309c7f4f599ebe7445e0b611a5
MD5 21a69e4f4af71ea9936076b5c83468ae
BLAKE2b-256 68961a59f6fc3e267114cd2c0b501d5b0692cfa930bd14276c8a02d4f7bb6e09

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0acaf38ebd302b2df1b62c0e4f8ed54f33a010bd6d5b52defbfee3358a48dcaf
MD5 267b5ea59e1bc859412eb792c56d1775
BLAKE2b-256 eaa55d4fef48caad87816e057d2235d0de972cd029f73051e55fcee1e1786b8b

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403201709747362-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6e34b11db918bb1a77efd023e81c13319e8d20287f8f797e9a7fc30d7da0455c
MD5 914f2f76b50000822997f871b36ac26d
BLAKE2b-256 64dd0ed107763bbe10ecf9789e5e0654fe710fbcd5692f36f91e0470a456af82

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