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

Uploaded CPython 3.12 Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403261711221216-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.dev202403261711221216-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.dev202403261711221216-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11 Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403261711221216-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.dev202403261711221216-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.dev202403261711221216-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403261711221216-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.dev202403261711221216-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.dev202403261711221216-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403261711221216-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.dev202403261711221216-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.dev202403261711221216-cp38-cp38-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8 Windows x86-64

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 47a2277808b8a62bcf26b3b15fcf798e492595a0f0a393308e221bd5f63182e6
MD5 fe060ebb303d418f0c1ffd5f39258cfb
BLAKE2b-256 f7fca99c55925931c279b59a1300a915395b3e45783ac1ca783027fcc9dc5c84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1cb2abc7df43e4dfcfdbb0bbb9797c731f019f3094988b86c2f05e07097639f3
MD5 8d66303efff96dec7087047c8f6f5e16
BLAKE2b-256 66548de4e8f96ca6ec6210df1b72d79315c28ed8e92d3a85900e10c88e7d0305

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ec7d54a09f0dee20598f142488ebacf51f44bb357ff210cfa1f9d384b2c108c7
MD5 ead961c14c3ddbdac468ac35c57d5533
BLAKE2b-256 5d3d974c0e4ff86d54e909dd46de24b3ae80d9f20cd880f6b130aaa8b4c44349

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f2364c1f38616342d9f444148b1843774790fcb390e0fc39755885a99d4456ad
MD5 5576b9c637779e78854eb3730dcc28b3
BLAKE2b-256 988edeca890dcd78eab529c8e46d9d0f882c17554e3089a44b8390a99fe7152d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b8c7468a4aeab7b89d13a5b1aec6f11a269726d14db7e65b1f40b531e70cddda
MD5 3d03e4018af5856f55ff6836483c4a41
BLAKE2b-256 a5012b1324b47a82f87cb681a0f4eaeeee67b3865b8e833e153266d3e1bd6f40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9a8217a0c2e22a736cded89a691eaad3409a8bf03f86f2b1b6401f31ab6cc8fa
MD5 ebbcec9c434ca3655f6c5f9e09a19548
BLAKE2b-256 a323feed719e19af04215eda6d35e6c0646efe10f40db343db01fcd5a70ea7e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4596ed34c148e2bfcb8c29a861c991f39618107ebf6c862e9ad2ff80bc4cdf4a
MD5 aab8900c219de7890f228fdecc8692c6
BLAKE2b-256 3fa62a3a4fe1146c41d813b9ca029fdfd9b06aa07a40a6b5556c013fab6f4ff1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9f77309e8d1fbfe12430275695a78e2111afcb3fe4d79d5deb874ccecf35f508
MD5 18d5c324945ce5109225a8641edd79b1
BLAKE2b-256 e10dd146023864a8fde12cced486e623f2f30118bd3849db63076818e502be40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7403ed4901e7129551e67542924866ef9cc9ece7f887ccf7ce54824b1608ad18
MD5 74872e654f75669a34ef7b8247b480a1
BLAKE2b-256 45e7a8fde3028b48c9119cd28e99172d819faeeed434c09751926be1423f73f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ff8d7051727e1a622a9d3a5a0de616d84245a980e542cb0ca6ff384147d2cc56
MD5 4b19ef4a342e51644d43a0a40f70f2be
BLAKE2b-256 e5a99eb69f49a80b300c79cb2e58c9c90b59a7e4c89a9736a61d33bb4da726fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f2ec90552def4546e0e7c92dc5c5bd8fae3af7f487c755378397fea206311877
MD5 22de7c6b804fffbba5e47d8ea828e7d4
BLAKE2b-256 42344f06a810eea63b5fe4a2a81780cea5caa4cc3d81582d5e19647042f3043e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 559a1040d5ab0aa019a25ed93dbb571b39bff39f7c121ebb73ddc1b383510e71
MD5 3b6e97c8e6e98678f68a7bd97d5d92f6
BLAKE2b-256 e83b1332322ccf876cea71ca108f90f43fbd4f9265ac4a758bc35a0ac5eca408

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8e97b2b4e197b3817f92885f2977ddc52ce7399d52c8e61a008c11b4998963ec
MD5 7e1d229e2887b6146358ce5d2fe81f04
BLAKE2b-256 1484c1add3c8bdca423df9563223ac7f935e6f0706fb7f03f50b4f7a0868c620

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 229eac08ecefc7b97dcf61e1a1dfcd535fff83435c93f213985e7616a801f53c
MD5 81446302070485d4ac8a77fe9fc5e4c6
BLAKE2b-256 b26b53800bb2588bf202eee9252de3c145834ec493d5b72621ba18b5ec19e5e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 648b3ada2043f4f6c0f74bba3bb94e2113386c70224b2ac6f72fc0c83e43cfe6
MD5 7357e6dea3160de1b6e43dbbce114f26
BLAKE2b-256 b614e3064fed4a798df7ad381e243c37a864983480fe10a3af344bfef3a596ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 3e8c5dc604e36a0b82d08af57a5cc5ba586472cd61ea4c4397ae66f881aa0754
MD5 07f9d5c3325e7de0d343b4bb9720f843
BLAKE2b-256 25a6f7690134339d0ed3212a2ae35f9e7aaa372fb8b1041c65f2f4e7cc4189f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bf35a68d19613ac7ee5a731ee4a48de51f92bdb392a677d1d9eaaf21aa7b7f20
MD5 035e96e77c36bff9d496cb286b6bd9b5
BLAKE2b-256 68345f0722d5154f82c2d7bfdbada8da48b53951e7ab8e2213ce11b4caff5344

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3f74264202f68ec8cc1b0b02f124e5c53a8efcf12698a72202f4f1cdd496f20c
MD5 a550e9b086a8318118a13f79b3261bd3
BLAKE2b-256 8524f93b329de3c44a6d6bbca1cf3f77c80a141daee74eb32254a481e53006ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a16620780ad8b2f7afe2ed644df0284b6baea4eefe02ece1bb703fa3d02059aa
MD5 cc8ef5a507df259eb392e65885411062
BLAKE2b-256 515935a27c664478acb13288c8990c224cd73063b6e00e00127d529609a071a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a9bdcf619f16c946ab78a0a2c50176601e509cc5f32da6ecb7adb57c893b70b8
MD5 fa71615f71ddd7a96fdda6c168058de0
BLAKE2b-256 5e0e5d61120ed4625234b2308ad39ec0e4e03194bf91991a16d2727cd142ef36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 1f968fac8a4c33beaf2d4ddc55572bbcc1477b889cdca1feb3d311dcc6c34b88
MD5 3304b75b3bf34f7d507ed8fe2944c240
BLAKE2b-256 2cc7bf8a79bedb619fbca7e9181815adef79cbdaa55ee55e750115b5ee08cbf9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6f5f1afb66b8c0a66bcc2d571f29658f64cf1ab8950dca43aea6a9a9b89b1a48
MD5 2bd03ef522e8abd5be7347c15ddc2c0f
BLAKE2b-256 0d0dc3d8f5ec434e8f6b62a3841d94e26e481d18d5e3d451dba01cfcfb0b0289

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 692ba3e3b9ddbb29ab49971fe277f6f91ec28273d08b505b72f637d386f4fed3
MD5 5ab0ffe248641a8a82068fb9cc553b86
BLAKE2b-256 bfc6c4d6cebbf79b0a6ee6fa60e366dbeb78781ce6a32eb648b6beec571782e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 19b475445cf8fa532fc32e86a115eca8c78f5c9c79f46ddda5c1c9b6ab655fe1
MD5 b9548b532db594c694278a3dc894d067
BLAKE2b-256 fb622e771b749416ef9ade901d830f421204cdb0a0d1856d919f93e268acf41f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403261711221216-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ca29f6c2f012a0375735ccee5f93be6dd48da5e17e930e910ca3594f72aab7d4
MD5 16f1ed111e47887fbed1615bfd656600
BLAKE2b-256 8efc6d08498ab1ca39af0e3be9c7d0c7719e418fafe24597d3cbaec7df0e347b

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