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

Uploaded CPython 3.12Windows x86-64

pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp312-cp312-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404061712167003-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.0.9.dev202404061712167003-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp311-cp311-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404061712167003-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.0.9.dev202404061712167003-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10Windows x86-64

pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp310-cp310-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404061712167003-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.0.9.dev202404061712167003-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9Windows x86-64

pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp39-cp39-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404061712167003-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.0.9.dev202404061712167003-cp38-cp38-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8Windows x86-64

pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp38-cp38-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

pyAgrum_nightly-1.13.0.9.dev202404061712167003-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.0.9.dev202404061712167003-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1cc6e71560b3c6df90bc37a93f8b42e1937abf244ed39f7643296928a2e93b1d
MD5 ab23b9d81212f3bc573d487fe60d0dd2
BLAKE2b-256 f3bf9b8cd46422574502e7eb0045eb225611fcf8e5eaadad6d94416b75bda721

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 109361c5e1f19f68c3e682460cb61ac3476ad534045df304f382af1569b3e35a
MD5 c83119a0190c1275fc0cec9b39598af1
BLAKE2b-256 ab552c98efeb8dd7337154eb9763b4fc2dfa7ccf06420c97d99ab24b312f8b74

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 13832349eb4d8059841a1107e4e809fdec62620097ac42783f7ed4d4f7f5d1e3
MD5 52d3f7290377e9cd7d4474e5f855f3b3
BLAKE2b-256 a8cf82be4b084ba8eba8f549d2b748ca734618202ca86621590377fd8087cacd

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 260a4ad4d5f1c5420fde10cbd5b34fd3fae31131fe80afa19b79e795acbb8bcc
MD5 1d16c946e8a9e8401604393b5fdf2a41
BLAKE2b-256 4314dc17fa6cc7ef67ccf902562592ef3ccf0806ecd8f9a059535bbfbe324792

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7aa5abed3a2d20316d62c869cf2c48ba5c0fc4ab2b9373a0819ff03c9757a504
MD5 12843b0c63c8ff7a561c13480079120d
BLAKE2b-256 a308c7eea77836e1644c7965a0511cb41c5f009d7b27a7cbeb035f7519d8feeb

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 abf200d22767abc7ffa95f79a2cb8896e5f4566ef4e5fed86d50bb4ad7864213
MD5 fcb590481d7081fce3389bd48d10035f
BLAKE2b-256 35e4e7024e222b1244431af65efaee97df8729bf390fb4b0aebf896549dff8a5

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c6301931c18555abfc52f3e41ba00098ccd763d63fd1a849cccaa7d6ea113ba
MD5 d1d3b5e8a76291c8aa37c61b6694fb84
BLAKE2b-256 e0de0f247f845b6c3c7bad734fc408dbc4544179f55653d83a5ec334789a2e2d

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f48972923753f46433f17047b16663fbf60e8969ac021b1eaed9a179f55a2027
MD5 14a89f7b617c9bf09bf993062364ebcb
BLAKE2b-256 733a99a9a0091766619fa89b37d466d6b62428776e1b8e3fddf5c24c67a1f104

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb2d8e8b31f00397299af4de5dee08cad65988d4698b7e5fe82d8c6ab5cfc027
MD5 5be4c593d1c17ab795b409a0b57d7234
BLAKE2b-256 454de490931d706632a7512b28e9de69e0d72372db7eb58fb8afb89af401e514

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b3d46f199f19747e9a84a1e5856959666f723cdaf4c8c5e4b30f0ce600e6810d
MD5 7e215f2648c9a0065031cbdc03632300
BLAKE2b-256 d703a2ac966a2f5e54eebb16db9e729f0c4f8ecbcdac7cd16cb0b1a0274da873

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7417383dfe2e63a02fdcd7bbe6de6769be2ad283c111dfc1006fb39610e3f2eb
MD5 eedc323a66527b28b1ef4dbbbd8a181d
BLAKE2b-256 e5b47a30a53b27d48500f57ef687be39d0f0b01ebeaf23c1233cd573a93a78b0

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 50c456e2330a3aee77f7f6a504fe871f8244736977c62d5409a8060096e8220a
MD5 9979c8c885f06940651f1bbea2088b1c
BLAKE2b-256 9387630f762796c244d4f41dffbcfb008896eeb6cf908814c5006afecddcbd37

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dca19675e45930027212b136116271753b0397b2ebce01f426b972ba5721a6c1
MD5 059456274309ffe8fdcb441cc2f409fc
BLAKE2b-256 fb4be12529de805b6c596b43624a671977a5db373418c516d56b44ad096f56da

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fedb4249f5f7ae3f583034bd2054b2f9d004cfca4660ea98e2402ca9ea72a258
MD5 dd38451da6f4208afd7d1f6a5ec46485
BLAKE2b-256 9fc312666d6aba7bf7d554a64f6e8d27fa195cd56f4c245fdfffec9942f91c4c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8eac4744d9bfa7c3073f30049eb4ae84609b1201c5d66b0c99b76f5fce1cee34
MD5 3a6b11e18dc0c53d58e55a9c8570240a
BLAKE2b-256 25fc412728c4d34a84ee1f1332e4937041fa026077284f4729da1bc4ece60bb1

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 23d819ce934d26e0f5b3808e2a5cc791b9c2dad962a761e0864b9315e037c5c2
MD5 fe5824ec8a04eb6d6e490772ebaacc39
BLAKE2b-256 df789d243f02555b77cebf7a00d8e62322bfa31d5b5e9d53a4af67f406391e87

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 520fa5edff285c8dd6cc823c95c6018aa688359bfd3cf2b0a0e08297fc90ba60
MD5 55a550dd7d6de274984435b37873c0e6
BLAKE2b-256 571b5f8563792b93d65db303a26b87ad3484bebe8b74aba698c562cc2a845cdd

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7933980fcf3cc2373537e9a971a12e8b5fe9a189679d4eb31ba9cfdabe1d9e52
MD5 aa876aaf243ee11a9b60807bc9bfaafb
BLAKE2b-256 28b6518c4f0d4841490ce6ac8b24e21072cc643ecf3394f945b9563c5265a591

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 efa4aed027fcf9f4534462986e4a7146c7652822034f770c2fee318361fa091e
MD5 66acf8e261d71110f99577e55e4df74d
BLAKE2b-256 2e94afe2ca75b7f5c9cc5a278c069f029c5224eb9ff0607a7a46dc9ec23033fa

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1251723d9694bf9c3b2b52d4cc52f8cef99e50ba0821269ab970acf3e897c2d6
MD5 a7d1da6242d6bb64ba46502da516d91f
BLAKE2b-256 30a79436089c4a06e9533593c66042b803db16a208336abbd904541fb1cb0d30

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d8e827775a9cabdbf6ed158ebc2d311c63d48fcf50aa7efd4ee5f9601f9cceba
MD5 0364acf49c094b04b14d90a3eebc5da0
BLAKE2b-256 a5b776094b7c62bef4da3f8e038ab3280dc357a3771155f42f78a10d576eb2ff

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c9ea4821ce25c575d95b88703107bd12a7f6d274238529f54e0aa5fa6ebcfb63
MD5 0e4e43e989034c17ef4f990fd7f27c10
BLAKE2b-256 8cafdcc933ac97d191fd1bd311dc97f592335c7dac2ea89edda340df2c40a810

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 68a17dda81d5406115072aedc7796fed99096c843bf948a3e094b1a1df1d8665
MD5 b560d9e6745ad2c0d953a37a8798317b
BLAKE2b-256 0f6c4439a295d6003bbe7bbf2c150ec163b0b909f310a1e1875cee34dde491aa

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9f89ab259cf93863f28a3812a53624f24ee973b8138cb3f2785fc8110bf7385b
MD5 6bb6e85185dcb1324c0d7f582236be25
BLAKE2b-256 ab44874303ba9342d8572f5de4f502d1330c3686e8d117678c0901ba1c737de0

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.0.9.dev202404061712167003-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fbfa5bb91056ff4319b66dcfec5ce114a6ba4d79c88ec69af0750d28c5694e9a
MD5 ecaae3fc6506eb4eb8311b38e4704103
BLAKE2b-256 708af32532ced2af127a1121345d02f08bc2433345f11fae4a04b6407b4dec91

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