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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8macOS 11.0+ ARM64

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2582525ece7806ef6cc7fec54a992c2dbb04ca61ff8df3e63944dd326612e51f
MD5 6e59fa5d73bb538d83d2f523440479a7
BLAKE2b-256 f575cf748f1a85c703eabf04b208807cac114a3d1fb4c9bfcfaf0f2a69182299

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ccb6e92cf536e26eb06d6fb309b4fa89f4cd55565d4801e9c54373a0749b4c2
MD5 49a477640a4b7bd5991f4928513037e4
BLAKE2b-256 6787f2c33002d649584d324df844f6b5d6153d26b901dda2c9120aa18cec94c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6b011b4b21b3b9223686a3fdc470d5bea39085cb1107e2445230e805ee8c3974
MD5 3a3887448f87683f122b968d3200c19f
BLAKE2b-256 cd074438b7d1bec5948f1f81e35c4cb63882674069c818e42984e5e0db047c3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a03a84d0001ca7fe18e0a3b1f73d1806b5a97d44e349a382535dbd8c01feb429
MD5 fe5caa01faf7860586ed31df0d4a1c45
BLAKE2b-256 56514d0b63e732b42ffa217fd32e42b02b75c8e46046cc92c55b385a5c495265

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 67d288d18bad2aaa561912681e31c7ec7bb6493e88f02fd7084b5cd19764a4e6
MD5 9c3fd865cfa44a81ed7a180f9b3b78bd
BLAKE2b-256 18c08b15ae0fe16be1b2396dc898dc540713286a399a22c746e3e00e13d9a99d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4bd2178e01c6b0c76dcc29e49c07d60b94df22517edd27d329bd451819a38f2d
MD5 acae7d5beafc202e5bdd37ae7eda6eae
BLAKE2b-256 c19bf6e8257eb111ed4523444e5244c7f07fcddd1ae550067d92d7211f8574e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e0c6780b8ac3db23890cf4a7b632744008652e442a7a8fb44d125524d11a90fa
MD5 c59842f3b2e0feec42ca72b71ebfd9f5
BLAKE2b-256 694118f4cd27396908f639697c69f37b47c07ed968d6ce2c750eb17c64dcc4c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 04bc7ddf0cc80441aec3314253af4e668b8a92cdd6b43e0a3b9fc64018f7d9ae
MD5 a4ddcd0b8675223522dc2f45252cd5b4
BLAKE2b-256 55188ba0260cd7452d2af022ec574f243b0ff9789e06424b2818fdcf9da4595a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9c09efed39d75833bd6960d5b4fa28353a3742c4a2ff06e5ba131eb91e3e839f
MD5 a21022ceba37656c443c5f94e982c08c
BLAKE2b-256 4b8ec73e00fbb251cc90e1c2759a4070c575abeb304d239729a649953379d484

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 80a6358cb4c0d07249eeb8730d76d840bce35be13988ffeeb2d1be9a0ff9a989
MD5 e57b824c65a5f30c4a5e3f0cc8feb609
BLAKE2b-256 8c81bbc3d39276f26046042ae7f7c5e4b0a1530be154467f348b39683f462d7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c46738e3954dab791d2384074818389907638c6735ecc96493a434c48a5312c7
MD5 f9df49871122cedac616da096cd7b342
BLAKE2b-256 91ab65109e5332a52800e9efe9b3d1a5d418d5aeda8a75166f449d5dba44b1e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 47b881b2e2874ed3aedf574462e080c3e2cfe970ed11191623e4a40760da4d47
MD5 3cfbe902d898f9b9a81dbe3e6deb5b7c
BLAKE2b-256 11737bf88b54bcd0ef557e6b6767cb1b8aeeacca82eae893555a4801034fd52f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e16eabf22125a2f340c961e95a6007cebc0debb0e4e9771346a9cc3c8b57483b
MD5 5af77853dfa3908c23116e332a5c5bdb
BLAKE2b-256 239af72bf60c9b30ed4e57917b93b94f9c3e818225d2d99b42aebf581b86c909

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 67fa66751a47374863c2dc01d5b5353d29e73666517c69127487fea501ed3446
MD5 b99b467a74830bb4b9c994184e2e44c5
BLAKE2b-256 9efb7cd0fe55fa169bcfcf7f15bddb6d081d77514c4dcb2c4ba9ce14285e3600

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 94ef4dcf9de906209c1d23e55505b5fbfffcd6878f3397ddefaf48de96b16049
MD5 7f41e20f4315753a1485ccb556b4ff54
BLAKE2b-256 8fad66d764bf992e06e9017c2c929e2d7117600e12171ec049ba680054880ee0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9f44357d993553c18b097af53b85414173565efc8cda0fa11db66e38ae381c52
MD5 2d721060000065a718ff93d8f0fd9f6d
BLAKE2b-256 c30aa4ce9a3fc3b0082e78625df1341aca41fea177df033e232c154e7c656db1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 29e08435e3593180bce5178e2898fa5173bad37b1c2ce384452e884e9bf29399
MD5 d489ba5bb03afe4a7007277bd9b3ac8d
BLAKE2b-256 883d8304e3efee1603d8779a3ead6e2fff83ad77953669d42bfb6efa3e83a674

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2ef4c2e3ef48939aa20d416ea62abb0a870d54803788dd0fee08ae38084832af
MD5 5a3252f1c87897ea345477c473332cbc
BLAKE2b-256 2db8e1289ac0b78fb04c05d43c0acaaf0cc011e821a959833eb6712e5661703b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 367b236efcd1f56e4e6d240984122049d8f84b3ef35d0136c4f5deb3fa9cbdfd
MD5 ff349be605755b30a341042cd97c466c
BLAKE2b-256 561815e308a5bb19bdbb4de3bb0720ad133d6889100989d5a9c4430f504e088f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8bcada68b0a57331588965211484c3a28978eebc6002cc2e8c58770387437f3c
MD5 73038549c79bcd05f7b6344b8e1abbe9
BLAKE2b-256 db47073ebffae6200b0410ac28365f8017b7a9d49a975e5e72f2fe9abf48d5d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d45b509d32c6654c2f2aa6c8e2ddbf597777fe92b1b7dedb9d72867454e54cae
MD5 428f392839c039f4a270cb3797ba5ad7
BLAKE2b-256 9c794d2ee572238a4d15a24b3b99746d07fa91063040c7563ecdcadfc9a387c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 de82475639d0692370be9fdd26275066507ce5316e7e46a4db7bbf6a38469360
MD5 ecd0f2e8bf5418a8df93c585e991ac81
BLAKE2b-256 9cd6d375a07e637c7757908505f5a0c4465e9e746bfb46e81a22ca5ff1fddffb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9bd5e7db5466d9f2d7ca56159739ff442a2a61b6b2e8051c3b4dd0a557b92c8f
MD5 35f55914a007ba3b1812be4f967146c6
BLAKE2b-256 27db31bc19faec977d8b2ecfc42d77d44253e6e44d8cfb031026b2ca0cf9c18d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6241270477e9404e7527c8563ece31d8b97d7fa9c31a4a3a20bdf7be3002c020
MD5 19171a1833fd68c257670945e2e59772
BLAKE2b-256 8498e59f2909c70e9f7bd7eb127b05510219f068cf6026b39743c7525dff49f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.13.1.dev202404301713370971-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bffc1008e288b2938ef7fef0b510bf3d9b19f5ccbc43bd0bf23b7394fde71981
MD5 9cd91ab853c4a630452f6f7b5ae93d64
BLAKE2b-256 b263f083865bb65a9557c9411bbdae94f789728aee0990ea5b80fd695ceb1485

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