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

Uploaded CPython 3.12Windows x86-64

pyAgrum-1.13.1-cp312-cp312-manylinux2014_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.12

pyAgrum-1.13.1-cp312-cp312-manylinux2014_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.12

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

Uploaded CPython 3.12macOS 11.0+ ARM64

pyAgrum-1.13.1-cp312-cp312-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

pyAgrum-1.13.1-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pyAgrum-1.13.1-cp311-cp311-manylinux2014_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.11

pyAgrum-1.13.1-cp311-cp311-manylinux2014_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.11

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

Uploaded CPython 3.11macOS 11.0+ ARM64

pyAgrum-1.13.1-cp311-cp311-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

pyAgrum-1.13.1-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10Windows x86-64

pyAgrum-1.13.1-cp310-cp310-manylinux2014_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.10

pyAgrum-1.13.1-cp310-cp310-manylinux2014_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.10

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

Uploaded CPython 3.10macOS 11.0+ ARM64

pyAgrum-1.13.1-cp310-cp310-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pyAgrum-1.13.1-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9Windows x86-64

pyAgrum-1.13.1-cp39-cp39-manylinux2014_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.9

pyAgrum-1.13.1-cp39-cp39-manylinux2014_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.9

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

Uploaded CPython 3.9macOS 11.0+ ARM64

pyAgrum-1.13.1-cp39-cp39-macosx_10_9_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pyAgrum-1.13.1-cp38-cp38-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8Windows x86-64

pyAgrum-1.13.1-cp38-cp38-manylinux2014_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.8

pyAgrum-1.13.1-cp38-cp38-manylinux2014_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.8

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

Uploaded CPython 3.8macOS 11.0+ ARM64

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

File metadata

  • Download URL: pyAgrum-1.13.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyAgrum-1.13.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 92d00a4122dd89e7f84b5a66e67e87b00d893567abebdd96154b3d5340c8c3cb
MD5 154402520942f19a9493304c34d44ce5
BLAKE2b-256 480c9bf02275bf6582ed624b80e5a5a671058b1d4948f410d1e61d06a26e2bf7

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f96ae63b9259781bc151810efaa8de03ff476db969c60cbfe35b835e4bca76d1
MD5 e0df8ea254b0862b28e0c2627533b413
BLAKE2b-256 bfcb9b66206e7d349ce3d3ab581ebf387fb419f33a83e48c3e3d7aff6138fa01

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f07591d2bc2be0e37516421e7051b9f07f354f7fa706070fab4fa92d8661d856
MD5 5496b87ec22f391dcceac9adab705fa2
BLAKE2b-256 d5cd00186a500de817561f2d5683c5d79f63cfaa2eef153586713640c9813128

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2c9c54b68178253db4974249236100453f93ef6a49c5e302211539e4334b079
MD5 dda125e6d9427cf6cf6882e1648a8e14
BLAKE2b-256 360f113a3c90632dd0228e5e93eff962570fc7f85e39efa2aa5642bbc5895058

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 046797eed004aca6e07c5d357e9abfc87c80be9005e4699905533ddce142c6a2
MD5 5a0e3f91cfa00bcff943de6c360560fb
BLAKE2b-256 b511e6a1b2874e4adb32bc88f626f1ec8e85151145b7a5e58775cf4340b564a5

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyAgrum-1.13.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyAgrum-1.13.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 cb5f9d5672b60dd625a723fae0ebc39ad87f33fc3e0e01e47bf928fbff08a91c
MD5 46e8614081e4ca842a1e9cb9e640b901
BLAKE2b-256 4517500fa697ab3a82ba7a7d6eba1597ac3dfa96799203f47b65ea425d7d7033

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9a51eadea45f1f837fa5a1a05ee37b6d2b88bf8b3061b0614673037d58cc2bcd
MD5 551d4f6f48b513b1253b974a6fb1ded4
BLAKE2b-256 fe58cf099a5030fd4107ee3891d60584d35b1369edd088d03b0e4395378d5dba

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b41602859deb0764af82513919d73b1c0e9bd87517be7d6743686be0e0024ca6
MD5 4507ab0b9143b2c5f3111aae393386ff
BLAKE2b-256 b683bcc486b6408bd2df8a746feb0f3da6f37fa75c94c4a51ce88150ca1b5a7a

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f10f116941fd0aa1d2551bb96184a84831edb0083894b6c1b79f9aba624f3632
MD5 68d468a60927ae4fef7f0bf17dd47234
BLAKE2b-256 af98e2a5e369461f8ead43d2194cc89212cfe61f648146a2bbdfefeb05521932

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 887df84ba75654bcdd85e166b6629d833677fb270a6503c45d52d7b5a2abd33f
MD5 c566fcdf1baeb3efa9307f3063ea8e73
BLAKE2b-256 26204508a2222ba5e3246b6e789f0a284cf8c6fe5745c729182df857d4976808

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyAgrum-1.13.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyAgrum-1.13.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 74f3df1c89d882fc0f644ba434e50f1b256da885af11f45b6e6c9d4737d19748
MD5 31dc0f53808e751ed6e59aa761bd3421
BLAKE2b-256 35e12fbc37637d556eb6627f38d45174067826f78136a9ff3b53ed285be74b07

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5d74a0dd3d050b8def68a28c2c0a9a6d9de843844aaa22f3058424eb890e1a93
MD5 0b6eb55fc0b2bddfbfcde25d32e70ac3
BLAKE2b-256 4d62ee9c0ec3e1d7bade1b257d53222712c7439e136439192e3ce3559338bfa5

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 834c77dc619c33c1f6720a1d0936b7e6cbb8b8db6712b889842307585e685864
MD5 42bffeea6c81e97e98fac09af92f49e6
BLAKE2b-256 e49cd81edbcf2304ea925abfcccca01e63e61d5f7e537928ece0e9927b674216

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf625cac0179ab473f9828cf3f7ae295b4153e50eb05df32e275290e19038c8c
MD5 c10ac3fb1a58a4eb44b8e01f03d74d42
BLAKE2b-256 2bea1e10767d536edfeff31d2faf7f147f94836a8dd34b1de29d3618f21b2d2f

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0d2c05961246ef26dae1f65e87faeb56e06fd3de671be8debcdb748b2b10decd
MD5 2eb0fd8492673dcb6434534efa649d1c
BLAKE2b-256 59d6a711a23f5d56296c35c36b1e3e3df3e3758fc0de45a90226224ec2d64400

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyAgrum-1.13.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyAgrum-1.13.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4cea05b0ace2d5a4572bd8cde28e7316c96c3c0c95517f85659f582996a43740
MD5 18b153c4020d6fed707d0af0fb642296
BLAKE2b-256 b18d926c749deb5fab173a6b56480642628e0051be10cec02c551ce50bb0ea56

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 174a61d002c27f2c47c9241bd80df240bf924e7c4065f06a51e55ec0849127ba
MD5 5bb26d0d27fad3bc25ee2639afe012a8
BLAKE2b-256 c2961863c3da5e8ae85d13a8e83189c1b5a7a67e698c87885fe5ed43892dbe54

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0695448f0ab9d78b0a0dc38f6e4411abbc65808fc48808e1dac32d0826ed05b2
MD5 93bff10ad1d557d84e34eb06bebd6a3c
BLAKE2b-256 e53cdc51468dfbf217dba0c84b2a7f6e953427345b964d3ebee286fd875183a4

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a602c9dc9e75c031ae17b37ae06d8ae75aa7c51ee79b96edb2e87fb2f3026bd4
MD5 88d664029f2a5ebc4f0de713ec50d0cc
BLAKE2b-256 0ef87a3240cb70eb2593c0bfe909c9c4fdc84ea8d788f36c11dbf260bd062618

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4098067292e25bb464c2f9d0a090acf7bcec2accbd522209298c5a09411ad0d0
MD5 511ff4f775aab5cbce06b0339ddcffc6
BLAKE2b-256 6caff6d01dbc062c0da06944c79bff9aea00ff1ee69858221d59b258294f5dd2

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pyAgrum-1.13.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyAgrum-1.13.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c5a2fb25ec3269927df994dcea0118e7546de542d6610c4275839dc88e262017
MD5 3537b2912c2458658df604faefa0af96
BLAKE2b-256 5496a90666880cc6384f846e2b6be5e0653b5cf114786580492eea4f6e965107

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b52103d915848314027ab9c6897af2fd676d1eda5a3ecb29ef41c903f144daf
MD5 f43da76e3394928e610e021bf94b6e0a
BLAKE2b-256 05aceaf486312d7da83fa92e513c8283c436680c0e18325acaa9cc256d235d36

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 713f8d3638292494356c496726c42afe7bfe28fc000f18bad3b682c08ab0c898
MD5 e57369abc69007468b7294f375694424
BLAKE2b-256 e97a41d305965fb12dba44fcb72530153fcaa44151b30b7641463bfad2fd466b

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b822882330fff70e7269e4251f9c27416fddff976d4ea1e2a3bf15cb7201c9d
MD5 2b42340710281b446e192e7b36a0a1c9
BLAKE2b-256 080c1e059c6a044e1fe661180b3bcb2bffb29b83650633c8de8b626ec60aa6ac

See more details on using hashes here.

File details

Details for the file pyAgrum-1.13.1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyAgrum-1.13.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e8d476113a3b19fd592c62919e52cd1e8001f75c3b04a5b837d630dc92201f0b
MD5 5ae84b6e371ee6b53c7f3656fc28aa86
BLAKE2b-256 75b7d4322eb8e8a54e3f25220d373385af5dd16d337928fe3d5bc3882fb24b3e

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