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

Uploaded CPython 3.12Windows x86-64

pyAgrum_nightly-1.13.1.dev202404221713370971-cp312-cp312-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyAgrum_nightly-1.13.1.dev202404221713370971-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.1.dev202404221713370971-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pyAgrum_nightly-1.13.1.dev202404221713370971-cp311-cp311-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyAgrum_nightly-1.13.1.dev202404221713370971-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.1.dev202404221713370971-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10Windows x86-64

pyAgrum_nightly-1.13.1.dev202404221713370971-cp310-cp310-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyAgrum_nightly-1.13.1.dev202404221713370971-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.1.dev202404221713370971-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9Windows x86-64

pyAgrum_nightly-1.13.1.dev202404221713370971-cp39-cp39-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pyAgrum_nightly-1.13.1.dev202404221713370971-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.1.dev202404221713370971-cp38-cp38-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8Windows x86-64

pyAgrum_nightly-1.13.1.dev202404221713370971-cp38-cp38-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

pyAgrum_nightly-1.13.1.dev202404221713370971-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.1.dev202404221713370971-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 45d61931f05e0bc9cb81fa59d0cb60d579abdcd038470c46e2eb20f632a16d3e
MD5 0fecc300f64427b0f66e89f198da6c5f
BLAKE2b-256 902dc69e899e54915559f1da7bdcd327ceca410918e1418d7fa6799fce4da837

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6e2e28223e2fcd1aa74ef0c25ac9f61cbd3831d5d12e6c56ebaf0e985f229b17
MD5 c3796f3d170cfae5b5c5a95ce09a28a2
BLAKE2b-256 64838a0a11bf86f86179c2184ba887feeae2973bd84d2d46838b30eedad015f3

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6db153be365b9830aa6ff7b37dd40403bcf06a3e9625897d03915bfb0fc58c33
MD5 7d687d899ff5ccf68caf9b14853da188
BLAKE2b-256 b392daedd42f02755d8cf355468b7ef1c836d3052ced280e8823a5817d7dc3b3

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c2b5c55833c66b72135c52aa3ed685e3babb8c77c76f39bc568ac95dbeb3336c
MD5 ea6ed88dadb869fb2690a5ca712ae586
BLAKE2b-256 09e59d4a3cd31a16216b5d464174940766903fd8cdef668c427cb4b73034038f

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e9c4aeff19710e46932f69de260b77d2fa3ea6d6b6300fcc917d7b8818ee7cac
MD5 a35730c15ca06b4350928793054d875a
BLAKE2b-256 a99c6ec7c2e5a81458f1dbc98d1ac5086428718fbc5a4a890ff0ce302bfef5d2

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e8a97967e2748e59df7637be8fb0c28a0c053510b789d8c2aef4039627e00c5f
MD5 871dfd5f3b1051eaa0325004c4645779
BLAKE2b-256 d4b3120db9577e303a3cbb221b68cd3c2355316c22d8acbad6bf7226ff5692b6

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3cfcfd8dc1f17f64696477a934f0936858c96a0fe0b13c85eec933a12cbd6398
MD5 86f54e0f757a57826a9cc99263661809
BLAKE2b-256 d6b05259748d66cd79f8239e304b52c57d70515f3aac161f2dc2881ebe457043

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9314e66d2fefd1693814e81b4398a5612564dcb0d9c915b053944065fdebce61
MD5 18948b68b29fe0a7c29cfd3324eb293b
BLAKE2b-256 f93dda0013e617baf17c0db114dee54117350243ebb2827f90eaf633068431ae

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 37a1709ef7b900f768a447a78f9dfb0cfdfc181b6293b30ef56dd03f2fa846e2
MD5 c9df9ce703deb2762123bea029215cff
BLAKE2b-256 ca7cced30705b2e343057eacf3dad4775f4bb273cc57fd7d05dd24d251cae4fe

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a52e1aa8340a984d20d1c492da796f7b6fb7db70880ba0a69082f0b3966d36d3
MD5 de370703d5402558904dcd409d7c6243
BLAKE2b-256 497c8e4bbbca075bf22c79a710bead596bd811a8472e4dbf28371d3518c97228

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e92f60ea07551307822d1c507b973d0d148e72577dc710d32c3813b4b5677074
MD5 653345047f0f53a751ae858f666ebdcc
BLAKE2b-256 5010a3828c0f3cad9c2ed321cc46c32a825454eae8d2b24524af7f58703f7a2c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a81c7d0d79a18adce3a3672ee0dc0178e86ad9fb94301034ecac97a06186c2c4
MD5 c9cdfaabc942072b017c18148a983be8
BLAKE2b-256 06c59cc5484abf9cc57a345d3358dced82700dd80c6f921c84a767227b7a5991

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e6f5c294b6433a9834b35e08c13f19593b486c3bc7eaaf8151f327af5f07f697
MD5 c674ce317d517058c0edd4aaa4b7445a
BLAKE2b-256 695bb33632d99bb37aaea0c26f84d7788fc6fc744fbfb3e5deeafeaa7f7dffed

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 43bf0161168b5f6edf2a25646a040801e96b4c3433f1441ca2cf16628fb56d65
MD5 6d096e6736df627ceef0f9f62085d041
BLAKE2b-256 65aa748e7e8081a68d8eb589356250f947cbcf9b00f6edc2be5bb602515ab467

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 931b9e76ab10b7198849a23ebb88b8ffae4663e49bf991a3cf727759a6379698
MD5 739cd902f45cef4fcfa163bd6bd42839
BLAKE2b-256 a44ebb8a7a0133bad3af00ccd057df31ea601be468bcad7baea6df72e000efdd

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 54a0aa5f1b797915a4e81200bc95166349d06d6823bc0e30dc4a08494579bb59
MD5 db24b74a9de71e882ab0d0be9a20f6e5
BLAKE2b-256 6d12512873bedc9868977c3e6cdb4f9c0dfafac1477672e0b350880ce3ad9a3e

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 157f59ccff63b413361936ead0380991c5279fd2de6d72702557eb7a60993ce4
MD5 8ff2a49c5753c7e28411f44b4da196bc
BLAKE2b-256 3daa3f56ff107b579b038d2be7c0bd7c5e515d0620ea43ed9911c52233d0a791

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 66a7b79fccba7f36a77d58a0377823792d1414169f47906fd9b005f40140f824
MD5 2cb6ca31c241939d2f83920afdd78457
BLAKE2b-256 ab0972d141f8dd37a24e666d6d62cbaf5403c55d55a16594262d228eac472ce3

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f3a947e9df75127565bb576ceb5ccc08ded526589700a00206bd85c0f97be704
MD5 5374f8c7cc31ebf4df65bddb51781dd5
BLAKE2b-256 7fcf705397f6bc6f4a12e9078d95311cc2c455f7d5055a3a102454fb528e2e8e

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d67f3134a3db242b38c3eaa0915a2f1a6b2f9540eda1ad034dec3355cd1842fc
MD5 ffa338a9b194a5831503e14e4148bdf5
BLAKE2b-256 34be8043f0c442440cfd424ea306beef9263010ec14a2168ef9b287ac71a33ba

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 fb3037e7ef212ebb79cfc793617c0b267669f92955d77a79ad58d580a7c9cdbf
MD5 e2b14310f68e8f556185ffcdca2a8804
BLAKE2b-256 88be1eb037f5eeead397bf81385e1f3074854768830a625f86ce9120fc993462

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2d159004dfa76815a1ecbc13890a9f53a02cbfb458a411b6a9ded7aa58f36859
MD5 432391623db1cdf3fc412c698fa8d093
BLAKE2b-256 255e11410cc7918584f35cc8d0fb9653c66025d132166862fe158fe61f3ea8d5

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 38d4bf3730e1e9a25102f8d661b12ce4999889586106c77fd742000b2c0d2eb6
MD5 4ae0378f77b2cc3144bde54943ace06f
BLAKE2b-256 5aa13a68105513027cc31d960002fc5fe7411f4943703989e7cdc8a4d871ae51

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 73da07eb951bfed279d10b60275d22b5fd713667ec3d5deaa3b6b49195684372
MD5 487449b25d0f52cadfc037ab81671601
BLAKE2b-256 d2d61fbfa678cf563679c17c0e09326cf09e4de1c034b2ff9e87a326c8c27579

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.13.1.dev202404221713370971-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404221713370971-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1e53f83ecbfa3fc57f4d8f0417540f0bd08106e069fc254ab0268fb8bffe754d
MD5 7a0fdea3e2e3c4d7760b35d97e3b3a08
BLAKE2b-256 06551a365feabb99fe15f6e73a11c57d6e31e9290d05f0c37cc845779572d8a3

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