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

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.12 macOS 11.0+ ARM64

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.11 macOS 11.0+ ARM64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyAgrum_nightly-1.13.2.9.dev202405251715182293-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.13.2.9.dev202405251715182293-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 caffb69df82cbe64524059cf71a5e5e2dc4b8be166d804010c449728ce8f0859
MD5 e1dc20000bffa33470a243c67c5b7b87
BLAKE2b-256 95d12272e3437fb01aca3bcb8c47b0e10b9856182594026d0df22cfdef6decdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eae72e18ab0022c81eb25f1d1b11c049f0223bd38e849bda23735b5235e1a39f
MD5 fc47f4583263ac5f8f6b5287ccb1ceca
BLAKE2b-256 a02363ab319b51e2db89c2863e469674604e691309bc1803dabbaacd371ce998

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6b3ffc2e7527b0e4f322cd905bb9796525033571e5399c00d4ff610a29b82d70
MD5 bfc9b1e71c5716e9b2c289d68f3e8e85
BLAKE2b-256 2f2d0c7afaaf61b9e37c994edab8ab1dc9ac7aa5fe6a7c5656aeecfc2d5b89bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 41eb0e3557e8175f54831bea348f48c56cbb1ed927bfd46c37b43ba7b46e288c
MD5 88ac25c4b8e398a5bf453bf5edbed620
BLAKE2b-256 76ad0bf8f325f5281828d2b28329b2e786cc04e4cbd0c97fccbd213f4a00a95f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 266c5716d702ea40dfdde64b85e7bf9d95a3ea5ed82f11ad6951c5de54bad8d8
MD5 b25db2b65dcd4beef4396b8ef51fd919
BLAKE2b-256 a88fb3795489d306d14befc13d54b5eb5e830dd8dbca5b0107f3e50b59bf348d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e0b7a2f38ba72be41f32421e197fe22b82f1a338858f92c72876b0b9ffb0164f
MD5 58d2f62d8c0c07a9f1f04adc8c729e75
BLAKE2b-256 5276a4c9bf99b055859beb0a6ea0f983155a6815f21ae0cfb0bc7760538112ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be2196404b7dfa1fd79db0129dde711a7c62f83b13cfb46a5b938b14cad8ac68
MD5 b61ea48581e000276a14e49e841df08e
BLAKE2b-256 2843655d9dd68b5cbb1992cb1bc13572a7d5fb04adbed1fe81b5866bcaf9d5fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9ef6bb15e0215f97da9ec49a5b7b9e8067947e5a3eb2181c23f7fb269a8cc7aa
MD5 146437507961dbd3c3b2f13d8000b944
BLAKE2b-256 d50f33dc619eb8510123ec61e7c2079ae02df5cb4f3e64765a2051baa53e8c9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b43b2e3c727687ca667fb938bfa5680c1fc55f6f0e4d43ae891fcf9db29ecd95
MD5 9308ec3de8b06dec08835d917f4794ae
BLAKE2b-256 7020753e91099dcee443e5cef9cdbb8fd6baa8dc2cf1192246bc749d5d9ac0ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6c80165f6d047c53c893b9c50beb838c34925d90d96607d83f2c405258dc9bd6
MD5 d6e1606abc44397219d3da6c9fc63822
BLAKE2b-256 65b2caed778c4813007683cbd5cd9b0ce95e5efbae60d0a0b066096d0cc10083

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8fd783b804e31942c8b254cd5b477c429d027f54df4260da3d546d5226fad152
MD5 d7329a8fb6d95dad647b06856893d94a
BLAKE2b-256 c5497dac70df736254ea85f7e983d339cf7a15f6d51d77040a6da3c13fca5b5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f70dd0e8c152fd37df5eb724a98ac5036bc44ccd02dbaa1a6d450a47a7e4383
MD5 0dee86d9f6e3018140b515ca9ef3dac2
BLAKE2b-256 7e624b2d3a7d81a58ad8faa3c53c4b00592b5b61d4d2dedffee048afc5b2609f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 078d1e841bea029fe35c55f7ec025e8319100c30f2e58cc9b11801b6e6d474b1
MD5 12778b9c587d127d0dfc8d49ff931e7d
BLAKE2b-256 3602d4ccf0dd81d0e795a9d7e767ad01c31549c6ee2932a3b58f9e6ebf9930a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3f53985ad8a2deeba6f9ed155c3cb255f0d0ea50410d44599b45f35ac93379da
MD5 8859d778c04564d464f0d05593980741
BLAKE2b-256 1865baf02a6d0bd330bdadb291bc0b36fcde71996b1fda5b2acd0307ea4b0325

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5fe28bb1026caf2db15ad9ab399ad797e56b2634a10cc3ef6b9788bc7cfb24fc
MD5 d4df907e1171d8c8d4927fbb1f37a175
BLAKE2b-256 b2d5c39c0ed0fb4c142ed5c3a14c21de417693c088ace4bb7def81d2a0878636

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a84d5a76cd140eea361e65894b41ee918edef49d97729ed3682a4f14f7f21fda
MD5 116b738d7c91b286aa2dc4752e79fbd7
BLAKE2b-256 aaaadb80d8b12c379221c582f2493c8f2a743dc27c86c5bae361fc0bb31d508b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 382c9fb4242c75e61f7353ae5220994c7a0b4c517502663ddda25922f5d8f562
MD5 5fc37ff4d4ec697934554e943329aecc
BLAKE2b-256 0816173a02fff2e493227a54c9fe206b0789049ac76928714d19f6936476e1a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fd9134f0330f1128587f2eb209015109054e6adc8af98ce05bea9318688d2e37
MD5 69fc8097c9fb4e4690b73a6125b7d6b2
BLAKE2b-256 30a24d00b8beafe7e64fc7156bb3c950a02b7a49b97732a208bb0e28088b8c90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9f89711c3dc1ad4a9e98bffb8a876c9100b951237243725642ef6da1e5c04a6b
MD5 bc14c9ba430c87fc854057ed89fae577
BLAKE2b-256 8963219794d44dec11a20e23cc04a48ec9f8a89a47e47c7bf0d75c6c00209bf6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d2a38fd05ada3abd71443a25af2babd66c8cc5097f8177d5a756334dea75c4bb
MD5 6f11a3e4a0199b30d4797392369d6863
BLAKE2b-256 30c54009c694e951b862251f2ef366f14cfbfe6467b4635e3c3b408c794d390e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 886bf88fb3ae892d2ed08b365535a5d96d02db76ee8dbeb11dd0b794194b7550
MD5 3b84d91cd536ec6016a1298578f7f050
BLAKE2b-256 77b1588b0cd7aeb81e9e5d6c378ea70749062b8eac9bf95c468ad7da45bfdff8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eb322d9c2b2b02fd165ca4a9e41d08b691c2b5ba8a7266308054447fa1be8f7f
MD5 10d1149b1f33f228327476e0abdf3fd3
BLAKE2b-256 22479c9eced6e755497dcd67c5f50d6b33758962c6d29117a79b9353f84cde34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 164d64d9fd03af06b63a53c3f5a0f78a5a7aff961fd67a28ca9116a85486995a
MD5 f9c95c032b094572689517f494d8310e
BLAKE2b-256 3c495073fb0d2719143c3f04df31fd1402d150e7df943826668d700f78094766

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a12ca36d5046b76f98f8bbdafbcef08c6e41f3606d9c8261fa2355663c9f52ec
MD5 aa3f641b1bb1bd94c123d01cf327cb49
BLAKE2b-256 558e889120783536b67ebe1771802e177771f6b129fccde8572519c7a8480e19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.2.9.dev202405251715182293-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 651a9de60077467fcffae4be671b31751d2d5c16bb5023ef74e6272f22329237
MD5 b39709b0aa5a69c6382599faa6b84198
BLAKE2b-256 bb9d0734d9a1cf9b70054e4e10ceebd9ccddc88890c398b35c6de4038ae48003

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