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

Uploaded CPython 3.12 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.11 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.8 Windows x86-64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bf452ead90aaeb677d5779e8071aba80aadc6d5fd1214635d609438b86d6a037
MD5 8daf6779ac062465db623b690f73d709
BLAKE2b-256 b03069a6ad200023061fa606cf026e6e44eac079dfaf5eb03bebf7cb830c9711

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b64bdfc4e03d5dd6701d9013f78b70f8626f9803f74b5cc1c7311f0a58eea5ee
MD5 fbb71d190784a9fe8a187d25f346d5c9
BLAKE2b-256 2e57350f644a9d62121bd002bf3b2b1cd2ab5c94beb936efec327d0c19ccc585

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9182577bee6f07b9fd5cadd1a8d524a4968a5b06deeac1b35f3c8638ae36d85a
MD5 d0a17a0eb0e450c16088ff7158a4a3e7
BLAKE2b-256 e15818eba6bca97d41c465f9e00fc59b299383b7b3d21827e8b7c650a285bd6c

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44af40e6aa195ff7b6e29c49697c245a2702ffccc1b0d988ce982b65a5368ed7
MD5 8ddab786542f76856eeb5699e47921bc
BLAKE2b-256 a27894b007ab169e264d4057a3fd836296785769369ecf8372b551345c280bdb

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c87ac6602379c9a5029a3ad9b05f33e87fc96db6e66099befa588f85decbc007
MD5 5716d6b4d0b343dc2a77e7e81c57c8bf
BLAKE2b-256 82bc7b26e1f7436e535897963d12256b82bfdc13f0e147f20b1e0daf849d4803

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ee1922573b5fbe64bdbc4ecbc6f1079b8c0dae5968f521a4baa3cb161f9347db
MD5 1085067a745b1e845e6d95bedaafc403
BLAKE2b-256 55627af48b789b58a60ed409605220c0520d8ca0d3051a68ba04fba8697d8c6e

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fee7a69ba90503f8862dd88fe5fa02aa76540ed9f4b1cad5209b330531912c4c
MD5 1f1a84aaf7f7494d0d2734c809fd9956
BLAKE2b-256 8ae3a9cd0aaaa8abf74d45704eb7f486d60c244454eda4faaf786c58100f68b8

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 46e9851b7231a5ff596958ec3a0aaeccb66b8e02b51aa928de5a9e9f1da59c6b
MD5 18aa6bf778f1a13ab16bfdf89be047e1
BLAKE2b-256 17aaa69574286e0d73f931ffba72cfa8c15f0a837f9a1261716c48685f6d5348

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c151de47eb49bc673bb9cf1a88e02c3ca1bf75ae236a8c5910d2543dfaef9597
MD5 640945af1260723abc1fdec6d7602fb1
BLAKE2b-256 c4e69054f819892f2424d537b7a3972d5cf534927d23aa44bffd162b8ba5892d

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 aeebcc52f109a69dc55df7da58136d37320aa9e74556560968847e24241ff4cd
MD5 b599093e31f36da435807a914a1e0f16
BLAKE2b-256 eb16891bfaa7c5d4765dca18661be1df977b27ddf8d418868ca15a37e88efda4

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 26321c5f3aeb11b5c11a9f0365662cf8b39580175d559c67835d9d6550d75717
MD5 2bcea8b09c43b9b8ac382aaf5694730e
BLAKE2b-256 06351947ea208dff3b9657043672341680b0b9632ff12952d52aae19683b4d24

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 176e4e92cd8f9e761d9fb26a25f0fd056285f556afcabb046525d29772231ec8
MD5 e30d2609706728fdf8df20fa2ab300eb
BLAKE2b-256 c7a308b5608e367e0ee50d5690139d619f994d7ef58ebd58f38e78ab79e51689

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 19831c3a605025bd4ce38b3a995fd31e5198244fa5151d8c08360bf520200f91
MD5 703aa649efd85d6c024cd6089ff2e414
BLAKE2b-256 1a37a90de94e7c7f40ff31da7a02d11eb2ad6c259dee27b9122040c8c19612f5

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2cdaaf678e80f3e3318cdebf12f140e21edbc0a30b7226408112c95b4cd13781
MD5 0e04eae320c7e9c2f69ca0b764388a90
BLAKE2b-256 bafb281692b1f5aa98137d6886794aef135ad7d175b50ae1fcfb9123e8f03ad1

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c0787eac131f615952f30540e6953b2f08c11b4995d94c86dcc9df877a4e5274
MD5 2dc4c85e58ef6fb26cf4f6047f817210
BLAKE2b-256 764e0f9d7d1c7363e46ccb9a449d872092948bddb230c85813803122fd655f08

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9048e17e319e6ca9039f16c1d11682cc1a63473d500933e3f4634dbad8ada8d7
MD5 05193ea55211161c2db3cb3cde1c2dd4
BLAKE2b-256 397e0bf92c2e4de31023a9187c4207092d9c95739a97facf7516a65cebdbc9e1

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5cf27eb86f5e3a944118581b1dfbb52a5693c35b5c066dae915726a819b3a2ad
MD5 d630c0ba435877bd6a6725cb0bc72f4f
BLAKE2b-256 d8a388c82a8567b93c712a818ac2b82c49361a2589282120fb61f5392fdba1ed

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 547bbf732a5905bfb82012b5ec8417cf2f392755d447e60998d5dac10e8412b8
MD5 040ccf067ecc703d622d152a1729321a
BLAKE2b-256 9bab0dcbb9bf1db4b107cce20dc4247e53582bc1312dbfd8d879742cb54c515d

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 726b97260853a33899e31761735d76f508c06bc29a2c4b1d4b6ac71e4657665d
MD5 76ba81b8771f1249b741988ad7073dbd
BLAKE2b-256 316c62c44b0b0ee26a92f64726753395cfa8b2be0b978f1f12bdb621e6e449ae

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 42b1759da993f71e47850800c7f0151965ef14b0b0a19f3cc9c844315e2db12d
MD5 7f1941a0123865d0a019f1cfbbfebec5
BLAKE2b-256 f07630c7458344432a487e05b6fd2ea930e068ef4c1ca0d6821c577f9fd9161d

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 fa8adbf04aaaebd63b545360ab10bd7d4e07f6ea0406e889d52a642118640cf3
MD5 fdcf9c74998a711ddb5334858640988e
BLAKE2b-256 f08a10d11fe5fdf65714eb5dce41ac4e10ac127218784edbebac51bb28dc2ef3

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 76ee65e9ded74ca4cdcaee7d0e7402adadfa0f7ac17581992d9bfc5026e9bbc9
MD5 b6019d1a8ccde49844957dddf399541d
BLAKE2b-256 9319a4d53f8bca2929735f5dd688b34fd9ad63831a830050d9b1e8b273529107

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e8baa8b7f0af13506158e641eaadedb92af549b8ac1e3d1625eb638a07bbf354
MD5 2d88e2d9e45f6942370f3faf6793bcb2
BLAKE2b-256 4d93134d2c21d3a9fbbd4bb2083c2cc0d6474cc48415209ca576970ae2c20953

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bdcf8067dba756a0d4880d57725edf2fbc46713361c36fe637be426a26eb0f96
MD5 99a361876a629d0ae797455d98b19952
BLAKE2b-256 a8dd0702d79734f024ac4889aaf65ab9b35bc4d63fe23867f215aa2aaebcd291

See more details on using hashes here.

File details

Details for the file pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.11.0.9.dev202401191701813464-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a641d10501c5cd561ce214dee60a8d11ff59108e6f7e16f029d718c63ecf35f3
MD5 84bf32e622b26e867959c10390b96ff4
BLAKE2b-256 f7e15f5188089302f67769d262ecd1a474cbad62f4448d0ea0434ba9c08505b7

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