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

Uploaded CPython 3.12Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp312-cp312-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp312-cp312-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

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

Uploaded CPython 3.11Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp311-cp311-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp311-cp311-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

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

Uploaded CPython 3.10Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp310-cp310-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp310-cp310-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

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

Uploaded CPython 3.9Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp39-cp39-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp39-cp39-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

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

Uploaded CPython 3.8Windows x86-64

pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp38-cp38-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp38-cp38-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

File details

Details for the file pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b77f99aa870f93818e088ac0f129d2abfe7c9fafc5d1e3a69d5a3abd4e5e889b
MD5 93a4b144502b565b85990f56b99a7792
BLAKE2b-256 7574e044c53112f432bfeb601127faa8427696c176d9ee8d079efe06b7e7e516

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 457f0178629cef06d53ec254aedb41f3d272a64a5379177ed58bebc2056c7c1e
MD5 319664412dafac234d681d4cb839e8f8
BLAKE2b-256 aa4036b709944ffb7e0566970402f6585b0a20a1fda05b92fa7874d5370e951a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fe34bc3c326cce81f5d5a1cc7c5edeedbb2939014d012efc4f9d4c925ed6f47e
MD5 9ac67eddb2e5a2913bf3ccef40f4a011
BLAKE2b-256 a1967edf24834776ad973746c1e614485b5aad0d869a0a57cb9c975e1128e32b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb25ee1ae632c626366a03f50cbb8d27cdbd7f3533da62aed42588b3afd0de42
MD5 a8df8b184188afaf7f148638fd5d14f4
BLAKE2b-256 47fe9f876e727384bf286481cc48a8fc4c3df7054b02dfae524adcbf2157aa55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4c98f5a178493a724c8782a1a6a793a7cd7044bd9292363f568b47582b63b4d3
MD5 49a7f5c43a02f0b46c8d38e0b60fc798
BLAKE2b-256 9041ad6ccf6716acc4a2e8d2d87aca73a2523f561e8f441f559164be3bc39e36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b044710e4a219b6e5c3240345207058c589172ff8e961544865c6ac98845040a
MD5 7a3aa4bdfd06e38ee3bb69a9cda8d0b0
BLAKE2b-256 8fc67176358851555f5f7c6c404e4a0e63f1d16c670efef83363fc6760f5e672

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4a3326a6bec8053845a0ad2f4bca48a5d7b5584a123b0b9ba5188b92e8ad3164
MD5 a03d756cb275483e7d0ae0c8e2f902f7
BLAKE2b-256 5b4f53fd0bb2d22510ccbd9d6e32d15be162781b33d1908d5617df30ef53459c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e94bce5852c0f8e662a89e547bfb6ebe5f83ec078b4ec3b6a4357a2440b08f72
MD5 e7b061dcbe0f47a6560ad48ec45e86bc
BLAKE2b-256 9100476228e8be3317163710627af6d2108b08b13f8afc59f6a8ead3cfe6e1ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 016fc2a09bc19b210b9a2a9f30daaf4b313ce2a8ec9350b0d26c7146e7bae04d
MD5 d26c5b790cf756427df71e636e934366
BLAKE2b-256 eb3ca34495db4f6ad074a13f420c6828b470aac96bf919c3dcd61f3c01c73c90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 29cfe69f1f892414ca2479434f05166db84ba8a3826210ba0b39d352ccd803fe
MD5 0b3a278317718c0bdfc03afcb5d0b0af
BLAKE2b-256 443e4bc381c0a986489158b6de476e5973b86036965c9c2eb9939f23d1d35209

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c963e2ae4ad47fbbb5be8754150e37eae1827a198105030116dc4f2281fe8efa
MD5 90c1b080c8b6c3d0cf97d5b933999660
BLAKE2b-256 a6629a905bc60511e0b941c5557ff3e8bf561ecac9447d5a471ea895b8cc114b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 75184e6861bfbdc0d38b562aec8e1c3cf68733339067ed3f7799f4dacb3264e3
MD5 c9024347a482e1551b39bf560c9103bf
BLAKE2b-256 3f2644c689f81c86bb7cb43e8967d08883d2d0e4c171e588685ca9c7a17ceb96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 088e9956400c67627c5d50cf51096faf044f2e12f3042e2c615bc44deb82c4a5
MD5 028b3d21c3ea7199d3a69beadf8a8cc0
BLAKE2b-256 ee617fcf9667d2b81341ea4aaa4976f5c4a8fd4aadd3ba85984a3df1450e486b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 352b40106cac50a723c8c17eb8e8644a7892fa1c33d591232bfba721c7103a7a
MD5 0ba233c844dab41263925b966d38d950
BLAKE2b-256 9bcda6dd412b0a4a852849981bea895f738edab839824c894bc1fcf52945f355

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 93097e166677c36bceddce67e61e7b37a167f3bb75bb695b0b9e34933ec0f659
MD5 3b8a5d5a2c5c88aeb81cd0b05d3f4584
BLAKE2b-256 6246ee1d09227132ef8c7ee771c91b71396e27841f11bd6d4d28c0fcab995083

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 aa6a84353cdbaf9dae5ced97f1b80c037547a714f7eb8c30caa37227e50e627f
MD5 ce2fdc09c8074beac723883a69a8688d
BLAKE2b-256 0f5168c0d695e798959d8c4001cc3c065650350a48db436de8e71dc9995aeaf9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ba414323d1e5ab792b7eaf2f1e1bbbb2b2f239809588dea8e97c512d986f768
MD5 1b6999090ddd28726562d0b522af594f
BLAKE2b-256 436cf2db38947a1e66ed1f9450d8313d7074b930f5f5e5d94fa292780fdca8fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4a9d9430f2275788565c627726f2ad227151c29106a0c6ccc9b748a3244f26ae
MD5 d84c03cd2e84a692a0940dba8ef14280
BLAKE2b-256 d30eb516ac49b3c90eee9307c7a1e65365d363ce1d04e58f7ebd529479a0d0bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d666ec4f5f0d9b0f29bad3de6025e5dab0748e578657e485ed25a12db3d0041
MD5 b71e70014807fc57ce7c1f43ef1ede53
BLAKE2b-256 338eb00874279339755ce8ede907712658b620929e53114f7c2476cf94cafb90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7c96dd21be6dc9fec25a6ca9700747d67e75437a40b79f9abb2203958718002e
MD5 b6f6104b185c130067bc8333c33f4ae8
BLAKE2b-256 75bf150d1bdaf77d1e744b2e66a239c88841d2ac4985cab7831b705e1efe4031

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 61f23f95f1c391f148d84192d5a1a3d8430b1ca8223738109571a3055d0353cd
MD5 b74aaad56120e172d44ec7d1196474ac
BLAKE2b-256 7f8851bc7a12a92e6008098e9a20363866f692bf73884f25b4410f37bb0fcd44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40daf6029aa69b99edd0a20f32030a804437df38c7704a37e1476e165b51d385
MD5 c61f8686b2a6325c432294805261c058
BLAKE2b-256 c62633ac9d0d5634784b9bfcd068b97fe32801103f97354b87b73d6856be92de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 61e8863d7e7560529adf360b69addfa542526f87cb47ca271810117f64ed4e79
MD5 c9c6843fd9d21944593ebe9c29118379
BLAKE2b-256 6a040f866af242c60502d1d8b88cd15e3c345d2704e552e10311d717dfae5647

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 744b614256a5c55857c57410e81079dd9b9f80e09d0272337b7470c914e9da30
MD5 76f6c416051c9afea46215bfad589362
BLAKE2b-256 03af0e7d72f473902bafa94cdc546d1278ad5a2d663a5ba2d9816db3701f0e4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum_nightly-1.12.1.9.dev202402281708630418-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7316a7d54e00a7d23c8439ab341718382cafa46723f8df18da084da5aafc7ca4
MD5 3b5c032ec4334bfb3dc2718cc2773926
BLAKE2b-256 ba60f73ee11f6673d00c728218742d3df646253d799bcb987253b507260460fe

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