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

Uploaded CPython 3.12Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.11Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.10Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.9Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.8Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 945dd6d6ad11230855c429472ce4bddd55a431216b6455afba1ec87b4822114c
MD5 b901a748330e32a4ae12944f193d070a
BLAKE2b-256 8598c5c4019b9aeaabb945fa56895637597931266d7381cae21a720305d5ec5c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5a86b19786d608cda637922d88433f02990b652c3a3515e3ab8976e29571ba58
MD5 c1e85c299f2a86dbdf3b511fbeb1ee27
BLAKE2b-256 94b10c0ac2405f69a6997aa1e38014bca7f3b275b261391bd8699c418b81f203

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c16fe253fddd35e9894b72493335146c279a061852ced2b143a32c5fc1dec9fc
MD5 31a91277b4dcbd8985f7de6cf8ba1ddd
BLAKE2b-256 54735dbb4c023e0a862a36808a5e4ee0df20609f39456a19feaa7d036cc3645f

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dca91d2b0f8fd60d7a98a111e785173dcfc801d135584ae83764f6507f203897
MD5 27614c89c3631054fe82045054b2f4a6
BLAKE2b-256 159a8ee6e755b67f3413d77e0dfa4b7f8e4e62ac352bee6bbf53343da26bf2ce

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9bcab336dceeaf40c50b14931923523dfbde3251b4d1e5d963653be0b66c67f5
MD5 92fd1ac1d951d81cffc50f145b7d6e6f
BLAKE2b-256 f595820dab3a05f86df8f5715977b24688b964c992f247bbb3b4fcd3ce9bcd31

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4cdf4cb728c81124013655b6d82fe909ceef620a70e5c24180a2f6f0be7f495e
MD5 926e5e7c062f6880e5ece21fc8f6e1a2
BLAKE2b-256 d7d9e57f071751ac1867df4a6075c05bfbc36afda3a43d916947135080766c1a

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41fcd03549ac4a6295faee8c671afb5b68834f089c026275504206d830e3df37
MD5 9252009d541330720b39cff7984f963e
BLAKE2b-256 c8e5a6d39f19d295b5c17e5e3977f6188878cffa6cdf4914434a93cf6f5a7bc5

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8754b7e78c78f63f2d4c2d7c821668f4c16639b8a87596345af1e39c0954b778
MD5 8a666b47c6f8428628978505f96eb604
BLAKE2b-256 ed9fdf45655c490531e44bd02b79d820f3c46407ba1fffd7e28d1489ed46e112

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5c45a8fa6479a502bef2efade32f6b54e1e4d9f69ddf83170bf5c6141d2daa8a
MD5 4bdbff77161dd597fb4f5833751a69a4
BLAKE2b-256 324f5d6eee47a6e526218af9ead66b72181aa49ce6f3f9f16bc347f9a84b2180

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d55c37c2d113a807ccb3fdaf9b5d5954b37595fa80f262618216bafe5e3ae276
MD5 09b261f43884ab755f9ab35c00dde382
BLAKE2b-256 a7acdf114f548d244e5ae102606e4eab68caf1804cc8d8b3de649da9f1970a55

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2d035e2d5185299c0376e6244ab342b664705a994a600ca7f29a88a6c14dab73
MD5 70884eb239a1c3f8997621b32faf2c51
BLAKE2b-256 7a3800b5ba3cf29695eb2f3bcf157c105ba60ad7306494f8e7864f22900cc528

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c353adfd953fec55b8b41738ed4526baee4628dbb30555a45c290b0dd4e247e9
MD5 20ed4fa3fbf2518e48d456f2e6bb9c7e
BLAKE2b-256 56d718e955fe6a3755add4fa023e16322109371e02833cb5218ddea835036995

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c2866e6badbaf63c2917f338978e147d5144af46529f423e90d43721885be160
MD5 e652782dea5f52f03458754d72a7aabe
BLAKE2b-256 b61ccf1594be12eae25c7a81d1967caaaf2155ded76b320df74f05d848b001b3

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bedf04dd68d6198393c98d21ea439a9591465214965e82d40d851bc126310486
MD5 7f37569dd9d20e1e1ed88525bd69f24e
BLAKE2b-256 d0b2b7f8ef234bde0d50a78dfe3ca3e3be9fbf7f0e94e26b1ce6adef751635a6

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c7e0afa1087910d94a9e5c346c6693418360f4b49efd386cc96d1ab3a1691ff2
MD5 e9cd5e0f5e3e32e8b29e71cffd359be1
BLAKE2b-256 5b8ff1131407d3cc90754d9756b6a7e50c2cccf2110c3c6c26bfc0374d09bae1

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 31f58069f08fea76dfc388401ad8bec58a3a89fc29ae3676c3caff9bef7f9b59
MD5 8d760e569349086b9ee70082a0741296
BLAKE2b-256 7b08703c9ca8e6b0b7dde9c6b20f058e371ef477d8106a2465bf827f08691e31

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a8eaa1661425a63e050e94190fe8dd649918c4aa35e6ac57b600d82b2e8ecfed
MD5 720362326a69e69a033aa98d72163fc7
BLAKE2b-256 db544f94b2783eb03dd21efd9f84d7a721e4756bc25afc9ef9e63c17ceb0fac5

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a5883b76f3dca2b1f55277013e20fd8df8508917d3295d40cf0bfa659051501c
MD5 22a88349b87fd4904b5ba2651f11df20
BLAKE2b-256 35a0a8bedf0b8b047e223f0576ad4cd3c10ab48d651c9c231e6dc2fd3215f4d2

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a9410281cdcf700dc09a7e0d00b6505e5f4d622db935596bd1e013283b3ef468
MD5 601e9e1b21b2de14bd1318d1597aa6bf
BLAKE2b-256 00af128ab98e0feb535b48e0a158c7345dca39b3561b2241167968c6d3d26800

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 53bc11a2ecbb29d05d088cc7d8c6a9b6612e25288fe277c6238107eb03a7f1ec
MD5 fe43bd2e90a78666846530bbc0ecbf2e
BLAKE2b-256 e472cde28528fd800e9f0210b6e4c4a5f23c869c47661c6a5fc4943569b77de0

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 64c48d96f30679b59c420ee3d461fbfc41b58f87fb82b38a3796762d99cc4fa4
MD5 103034321b1dafe99d27fdbf08a2c37e
BLAKE2b-256 3cb500e13f85be7e9cf50f1c204383f206b238e8b718d1b2207af65f3e0abe45

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18991e5430ce85b686ad54df4d6a8fcf89b0878b25ce527020028cefe4c342b1
MD5 12165db5f2873503efde1b38704a8282
BLAKE2b-256 194f322cb6f7464fe5b7677160a58c2f3d70d6307ac2c548799139bec51b3ae9

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5e5d665f265e48148106fdca072f4c5e8b98138779006f14f8c2c8a683828454
MD5 b455f95d87ff9dfa41157f04a8e04873
BLAKE2b-256 d0b68394f98716a6539fbf0d8d74ed317aabb66f66b2b23bcb5da64fb58f0e44

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c673d91fd17e83b9b1f49fc44608320ea1656c4120b7090799d9642a97e0284d
MD5 12e9238ab01585683927882fe5b0caff
BLAKE2b-256 1337e30c00a66f0bf54ce4831ae9a2add67dba4d6425b3018818d153b034b037

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202402061701813464-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c31058b8458e3152562e061c1e69772480401b048aaea9653ce7e5f6c9d8fa66
MD5 e03bb58745807cbc368af0ac6f395da3
BLAKE2b-256 f2031e20e3a1aa149b0703387cbc05abb10f081a3184912e1def2d2bfa6a4efe

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