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

Uploaded CPython 3.12Windows x86-64

pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp312-cp312-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyAgrum_nightly-1.13.2.9.dev202405261715182293-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.2.9.dev202405261715182293-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp311-cp311-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyAgrum_nightly-1.13.2.9.dev202405261715182293-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.2.9.dev202405261715182293-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10Windows x86-64

pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp310-cp310-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyAgrum_nightly-1.13.2.9.dev202405261715182293-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.2.9.dev202405261715182293-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9Windows x86-64

pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp39-cp39-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pyAgrum_nightly-1.13.2.9.dev202405261715182293-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.2.9.dev202405261715182293-cp38-cp38-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8Windows x86-64

pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp38-cp38-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

pyAgrum_nightly-1.13.2.9.dev202405261715182293-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.2.9.dev202405261715182293-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 59fd90500e66c9b6c417ed6f055333b283c053f3d4de2abc974eff7c38c2195c
MD5 2f304a877b52aac617f83356baa223d7
BLAKE2b-256 b78d1c2dae54a2207d2c08bc41febd3b90186eb10dd6e0e5932aa8475d2a0085

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7b29e0c5f472a5619065295a0c959d02c3e478aef30852061c7fa243070c8eaa
MD5 0bb5d30b11770d07b4949c30829ddd3a
BLAKE2b-256 90a08440f67fa3ac918de7381ca37e3497d03a9727fdd653a88ec8972bc2ae72

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4a77c75855e943a18fe929a05aef4d145366c8d3e53b86ac9c691437612906d4
MD5 d9c3b0f81653d9640a131a8398337f8f
BLAKE2b-256 4f7183c48a21a4cf1b0fa295cfc092c93fd648d921d7709a706e3cd55051d6a4

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d53d05c97f02b9fe7e9e3335a1319c12d53b28079dd92cefd13c9f8ff2c32183
MD5 c2df66d3ff120a0351f45d6dc1ec2dab
BLAKE2b-256 b2c8151bab68feca0121f6526da755eecf1290ab893ac3659e3a3c8eddaac4d5

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1007f5b1472289c3d639ea52aa02dcf32f599b00b1be1faa4266bd4a019bf14c
MD5 d9bbd79d19736d0cf45033b1833852b9
BLAKE2b-256 935f88ce19199eb687724f2b07d5b6ef8f89e111e4f3f3c8ea3e23117e0ae45d

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 febe437865e5ca772230e2a372df3005c0cc729ce2f24874562683e810beed81
MD5 65ed82e9d4eeb957b36e6eabc538af87
BLAKE2b-256 5982ff6a83cc42719ad98567545a36852d0bed9d069a45fb59b9762f9a331d56

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 30e8ef4b8c36bb517f3fe6411447461f218c19e65e81761a0ad153d0b7b6c6c7
MD5 3f0d9eec66ebd21c03a67e7121cb716c
BLAKE2b-256 2400070c25fbfefa55d2192b7443820cf1f2fa427e10750d694e699bb9239a41

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1e96780d504779e9cf45cdd9729b3523916216c5351d587a79128e38a9d5533d
MD5 878e7e6bbe4f417534266bb39c1044d2
BLAKE2b-256 037152415b3b09136fdbc1283873b3039dddb52afb5e46b7b4e03c7405c055f6

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 676c40076eb11e9a099fc06f5d4866fecc385c4698aa4f55087bd8fb5af2cbac
MD5 fc9f50a85149d6ed6eece7938fb7b972
BLAKE2b-256 2a1b64ee0b0c5ba0bca7f608cda0851e5ea83ce748a6d944d30df197d478c4b3

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6ad34660a6f10effab227f026cb36a77e86ea2dfe50842279778fd7393af65aa
MD5 8276f6ffd8ef03ec366cc2fc578f4f24
BLAKE2b-256 a399c3848d1175856f3c42569cb157835a483c2a7f978e6be4de65164898a9bb

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 17e90567ab9f58ddd615701279146e8172ef15ead57bb78b51ba189180ea8a7a
MD5 9ad9cace7916162ba918d34483c285f0
BLAKE2b-256 bdbf5f8f639df1ffd485ade889aaaee739122a403f2585441314ad30d83e998c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4e031cc145d55e01751019fd6483ecd324c86e89fb7965a3b545e039918a128
MD5 28c114284866dec938577b36be54b7a8
BLAKE2b-256 1a08a1bd27032c3ddb6a083c76b39a2ea6d72d8c78d945cf277525c5e9b8e557

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e4c15ca32aee36796109589491cb778c4eb0265a6ff36accca9848700917514f
MD5 fa20b15d89f08df0005b606b314ece4f
BLAKE2b-256 8dd0eabe47560486d9c6d13e30b0fbddcc921641f5e928c899080edada93a3e1

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e3b20d80228e5f8d7fae6114173864383ff0137593b26ebe3dd7a84809690f3e
MD5 213fc17ded5c36d2208045ccec7c13ee
BLAKE2b-256 b34c32920e45fac7698ec9861debc9b7b664aa9ffe62e33e5645f9488dc31624

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6f616274aaeb15d5e2be41b00cc2b0a97bfd4d172d23d89b109d29d57243ca42
MD5 6e1cec43e95c9a43c528829791c7f7e4
BLAKE2b-256 178b57a7fadf6545d2e5a9822d65434f9667ea723e547a1d6be6bb3b89270e03

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c52363b288cb51ad3ea4fe021b4df8c108ba3b3c030b8b22d00dad5cc97e5f54
MD5 4c9bef41c0ed8948990a7ca5a6401c91
BLAKE2b-256 b1e607281fcc4662993952188cc99d4e5487362ead97b2498d485f2bffdafa27

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5642c848619b535a0b781c44895f3ee0bf68062ad73801c984aa5e5cb1ac19e4
MD5 8676761025e8a343f1cc66cc9f7edc4c
BLAKE2b-256 06133e60af252fcdaae6504095b5adf785dc1fa309b5665350924ee07b4dff5a

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 50603d3d6ca8b4e8ae3e834ce438505789c25a9a70d34c252a8a4426ccb14be8
MD5 d5ffdc2ee1ed29d7de9d4db8a7794262
BLAKE2b-256 bc07da6d722e4034fc3afe31c8d9a1e7f025d567d716a66c81ab6ad5a5641db7

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 51dc5d43a8abc330b898205502e4cd4f9b0f48a1a225e0d6eb0cf99e32c097fd
MD5 d34673ae4478277cb21ee2a216ef3e7d
BLAKE2b-256 bc47f3fb709c6b8504834d428d983d60160657dd6ce8e1e28ce0b11a8129735c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d8667f763ae02be36ca95258d3d3116c26facddeb2a80c4d1a372c29d281b51f
MD5 d193bfbee8e75b9da41447355b7c7085
BLAKE2b-256 7603b30440b5425ae0f9141148d347cfa0bdc39b8bcb080e1f3d044255d531a4

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b4c7972ee3542a6a63a1bfdf87af659a536d3a40b4a7cc31c10bba433c845af9
MD5 56cb8a4dc5d1de702ff98a11f2e66129
BLAKE2b-256 0c01673c44b06f7a6d66ee1fc8560650be47218599d5047d7dffd33e26980731

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1e3f57e827907a7b23f76a1854f3923055c2f13d83539168a63b28c288c3d8f2
MD5 6d168a91fb02819e985e35e93245d9d8
BLAKE2b-256 d096b76ebcd098c94c5d5001d10d2c1113802bbe5a21a2a8ab46c6c4a02e7f75

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 aa029e1b2521c9b121ff410c79356a9870c06c16e4ed3668bce3962ff278dbbe
MD5 b2d2557b0bb3360abfb43f6474d94193
BLAKE2b-256 42686573584ee1ae60a085e7851b02a8cd5447d7f01520913cc1098dd7eada8f

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a227bb5afeec90dc91caf5615317cd4a26b54702e2849d7612167371c772159
MD5 8f9fb4096efefadfbf0b456b2b4d27d1
BLAKE2b-256 8ce8081a0dbf097a53001fc982e01831dfc34fddd612d807e7a158c90a72eafa

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405261715182293-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e86c44db035ac0ffe350c0685d270d6ca341b34668aaecac094ef081f2d53780
MD5 4187b45ce7c25b154cfa8967200c5679
BLAKE2b-256 731458bb515f9af830c98c889ec0b3041828a3a34fb61fde1742e55879216a96

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