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

Uploaded CPython 3.12Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp312-cp312-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp312-cp312-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp311-cp311-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.11Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp311-cp311-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp311-cp311-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp310-cp310-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.10Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp310-cp310-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp310-cp310-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp39-cp39-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.9Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp39-cp39-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp39-cp39-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp38-cp38-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.8Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp38-cp38-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 618d4bf308b869837843edc0967bbc1a2c1c5b1f42c1f70ab229b78ae6aedd48
MD5 bcf57bc16535fc4be55a4f7c0528c517
BLAKE2b-256 45b7fc75776f78c59f6075708d14357d193b3ef4f23b2d415b56eeee11aac109

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 832e5e9fd9e3b0027d131801bccb7c497bbc5bd77c68979c62f08aa215674030
MD5 80215eb3b8e32ca32a8b434aa50de5c0
BLAKE2b-256 c10b8b419e3355e6817de6cb10e9a0073fd6814c5923c2253a1803d189460bcf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 465dd12f95c3fd38aa31c5b195707bcb41580ed451557ed9b1de799ad2bfe297
MD5 9991a78d468ab4ac7f5a7aa08f64f1a0
BLAKE2b-256 c827359f84700fdf4b8e9815015bb1b3f661e9aebcd9c0050be16e7dc92f4483

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7076004e9466bb2778e926966dbdd58d1bf252948c86078ceec5af8614862cfa
MD5 a9861322b830dc9420d4dce3407b76c7
BLAKE2b-256 3a8871c8e98b88534069ff51f12cc6367fabe2c70d087f4229763c22d815a1ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8b9ca1d3b14ac7644737ba7acf2cd42f64e95365f26eb381e0eb8d1c2fccb7d6
MD5 82f84f79ed8945a46866f28d013fc2e8
BLAKE2b-256 988f182136f0483ddb8c2533efa8d6a0e64dee121252511477a21b922cc8f58a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bc9aab8d13da7278dab5963b1a9f48fdffb159075b21de8a82237ed2f8bed257
MD5 08d31352dc243d2c2ff0b3d616550eb5
BLAKE2b-256 3c874cb85f8e391960ea8309343e7d29315eefdc1096d3393b274f84bd86eca0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20f874e7f032cdd7f032723731fb00136b687ecf8f13815f625ff5bd2989e1ba
MD5 0963046e0d7c5ebf8417759a6722cf9b
BLAKE2b-256 624ba58c35afa6ec7f18d3a72e4cb314802046801923a1588c04465ceec44d5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 60262b062cca5b2b468ea0173edf991c0f545c940e3fd14585bb9021080d7ad8
MD5 1db2ce3721b48c29e8ec35d8a6b3b316
BLAKE2b-256 3e918a5e15919b700f9eb0edd94a8d6eaa475dc1b2c632974236b289178cd20b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f90819c356ac697a3aaf4f8ff06a89ba0a11eefae5605dbd661029a451fb7f88
MD5 6bf1f6c49bf7241088e4ad15f101bee5
BLAKE2b-256 1941377db6feb5bacc30afcc242f4c4cac27b37c33e8ad09326f2521652b714f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 36bfea79de8bc545b8a2c48b33f10f6bc54f6f5d2e0996fbff99298fbfbd5952
MD5 5cd87799cac68ed0c1ed34c5cf90715b
BLAKE2b-256 577c79743ee8157f593179a7590309462ba1fd3a7a7142184385e94bac4b61cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ca748475fe37d5b83e11742f88f6fd0bec111fbb0968f6059f6f6c20eece04af
MD5 1c17ead6f6625d73d73024d0a16504d1
BLAKE2b-256 c4e30bf56f1546861c55c65387ae7e70b07aaa6afbd41e6d557447aa31149385

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e5249cf4d27e775b96a2e84bc2b2a0328d4d4dffb7833e99e98e4eb6f6cb50d0
MD5 d4d38ed6cc1ed6cba48ab917c2f5cd06
BLAKE2b-256 38058d3b6defbe51a97282439b4d2526d0649ba9c606ab0cf6d83a1369432568

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c98cb4ada749762120fb6be7198d5678fce3f11e4a25028cd4041390db1391d9
MD5 28bd4b73408bf909b15ca9f7716e28f1
BLAKE2b-256 f09ebc13d560f9bab361ffec4e2274dba350823f2cea6095ec0466684e21068a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d2b89221d5880f902707895ec842796203aadb2a06a497f8402c66fcf2a297f3
MD5 826810a307fa7ded623dc5ccba614985
BLAKE2b-256 3ae9503dcd49b81762a6d8b5fa5f739fead56111f5f3cbc0daf51488b69eef9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e1c00acdf892eaca9cfbeff10546b945f175d6b499319d71dea54fa5a6f4a901
MD5 344a690342b163711a31be2585ebc1f2
BLAKE2b-256 5c77128e4682ba4f4f13e175fc0aae7af00283c445e8dac411e7461bf14e22c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1690f5fa7d9cecdc985b9825ccc19c2683e19b52bd4091436f881459548f62fe
MD5 00a89fe02cabeea2080c1f92821241ba
BLAKE2b-256 eb062f94ab5660845f2552f9b48139f7b69f1a949eec07f582a4d68e4c7127c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 daf5f14784cb3c4268ed1bf0b3c34071aca396794d7f7192840e369ef102e134
MD5 80b581dd44d10b386cfab66cd162bfcb
BLAKE2b-256 717c0102468d3a05701b44a11c920d814f4842afd5324441d33351a7d86ef9b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e4dee4b7afe2af426d3654cd0d535d3deef4434e8f0801af49a0705df77868c2
MD5 693dbd4d9527662350f076b526232d7d
BLAKE2b-256 57c7c1443bb24b795db5870ad632dbdb11ba04bd8d762bbb67cc007f6243b601

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b61b86146f713538d655e2c94580d7fea3eb6e9504412dc8a004d653c3c10ac
MD5 d2fba940508d170445f3739d8fceb79d
BLAKE2b-256 1bd6fbc433890f3f0418c99c2d4b8ab8a3a40f9ad84c746809b98256f8fc0477

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3a31dc24815c3d943bcc1a4d647fc661fa6ddd475dde04302fdc8ccabae964c5
MD5 cc962d06a76f0ad99f47d7826ebc6c92
BLAKE2b-256 37bf3f3e44f7226dce1936f2fe3465b406ee0fa61da01863634af494cfadf878

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ebb16bba1ecc9c8521c1744aaabdf44d44c44b995605f0fc93367b2306f5e0d4
MD5 c92f63cd0f377cb623fc550c89f667a4
BLAKE2b-256 6a5a016c68f1cfad5172e71cc52398bc98ddec8b07a3d984443a7e0cdb833f2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 df3849425d41985d1f8a3ebcada563c851c0e6778ce66e3dd79d470fb04c9a3b
MD5 34d586c5f9113f13a7b2eed4354c8ae6
BLAKE2b-256 0c0073995348e0fba8725021d9c1c028dd3b775b3d3c316eba2566454b83f664

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 440357f6b33cd4a6050bfadc2cc196ad0a56777664412c74cb7d0cad1e9261ee
MD5 b0f8c445edbac06f8b953c8c5fcf8fe3
BLAKE2b-256 f36c5389f7a2be331b999a46aa79cb437c480e9c0e9e537db790ca26a6905da0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3733fc0b164926856cc0c436c554ce09892385cd026df5f22377b8c89a331675
MD5 b6f7ec8d819fbe60f1f0a3b7e57cdbaa
BLAKE2b-256 bd7f3eefe1fb89a50d13e94749a8ffccaaac63bda1164d932dc69d8acd855a0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202403141709747362-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5a7ab9df7bd9b55575f5776d285faac23479942a775825d646d06a23c3b2b015
MD5 1738ae8a3136d9f4edd5cb0048e711c0
BLAKE2b-256 0da9e3f9404f43c7462abce7f3e53def97fbb3e71e0c52d5df97b69e586ff140

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