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

Uploaded CPython 3.12Windows x86-64

pyAgrum-1.12.1-cp312-cp312-manylinux2014_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.12

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

Uploaded CPython 3.12

pyAgrum-1.12.1-cp312-cp312-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyAgrum-1.12.1-cp312-cp312-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

pyAgrum-1.12.1-cp311-cp311-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.11Windows x86-64

pyAgrum-1.12.1-cp311-cp311-manylinux2014_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.11

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

Uploaded CPython 3.11

pyAgrum-1.12.1-cp311-cp311-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyAgrum-1.12.1-cp311-cp311-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

pyAgrum-1.12.1-cp310-cp310-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.10Windows x86-64

pyAgrum-1.12.1-cp310-cp310-manylinux2014_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.10

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

Uploaded CPython 3.10

pyAgrum-1.12.1-cp310-cp310-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyAgrum-1.12.1-cp310-cp310-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pyAgrum-1.12.1-cp39-cp39-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.9Windows x86-64

pyAgrum-1.12.1-cp39-cp39-manylinux2014_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.9

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

Uploaded CPython 3.9

pyAgrum-1.12.1-cp39-cp39-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pyAgrum-1.12.1-cp39-cp39-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pyAgrum-1.12.1-cp38-cp38-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.8Windows x86-64

pyAgrum-1.12.1-cp38-cp38-manylinux2014_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.8

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

Uploaded CPython 3.8

pyAgrum-1.12.1-cp38-cp38-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

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

File metadata

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

File hashes

Hashes for pyAgrum-1.12.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 43e6144c89f84af786901a82b3c98df438da0fea62adf09087f2ce0f7d9343c4
MD5 e21286669ca434265a1ee8b89895132e
BLAKE2b-256 9210c8f6b3122b93f4d7da1fc5e14766ddafa749b9fcb4f5aead16d55cef3aac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a02591c0dd0ca1153e8849d3549a929345d725b7443891bd8125da2cc767177f
MD5 946d6bc0341ebbaa612d2dbf08aa25b6
BLAKE2b-256 aab79a57c9be5d814c30671c75d67d4a78ef3d3b5127cfd9b6935e6bb6d6a937

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b90e17e418649d40bbb2554e4b48457dfb22a43482b5e34ee7307c9a87ac4bb1
MD5 026a9fc56aa25a6aa3d13f7bf89930aa
BLAKE2b-256 8e34712c365bdcf90bef2aba54fd0778c9dfe7246cfbc69905f029a374d49e3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 79ebe3f1a2c2b3651a450aec8528338f7627838b51b97398e236d3c55d62249d
MD5 be0c13b09d28d400bcec927b87bdc32e
BLAKE2b-256 01c4a5d06d52cd6509afb8aaffff43b0f7bdb0c71b78a054171091b226c375f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 dee908f2f11fd4dfc6bd9db9da8d2d148342a002a6131c5792813702d148d2eb
MD5 7185673f5218f0cfe8d8e0ff1b4ed3cd
BLAKE2b-256 a3efb059035ad0a8191f0661772e235497031f3dcf5126826201893e790721a5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyAgrum-1.12.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 66d51eb6b898e575e4e2ed3c2c1d702f360621eb22433eea85dfb06f1f4022a6
MD5 9ef33ea4c569aa7be14319d3eea84ccc
BLAKE2b-256 c6682ec3ef2b164b88fef219be20cd58eea95e1be4a496b283bd51bb381f411d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 231cb0a8602419028b3dc0b8233d93fbd573b34adb7bbb6090ef84e7b8eb380a
MD5 64d19341ca5ed0e02f306bca8a01e015
BLAKE2b-256 b5080669845c93050a3c1b1b951bcf7c6e13afea232fe5d87301f910bfb32bb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 84f7339aadbd02c86c16e32c546062bd46d35f4060d06e5aa99917550141d8e6
MD5 cba3ed4deecdd3b0a1359be051f0a4cb
BLAKE2b-256 283ce9f911c1108aa3a878d3615fd2919e361dbd27f620efa2f59cea59ddda31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e6d98199c58d54a7d715042f86333241d9e7aedfc2d3f6e9d19f893763bbd2ab
MD5 aa5596fff17ea2499186adbe81e03f0e
BLAKE2b-256 adaeb956863c57fdc0f059105734dbdcd9caef0e07c8765390bd0fe37760825f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2df2197ed000b6d8cb3b89a1a919ff5a32030102e51b33678d84d6cbb688baec
MD5 92378d762595ff1962f1baaa3e7362dc
BLAKE2b-256 9a22447dd5cef7b55a151f53a54f5c2ca0497d498a3c1bc9b2d9416069270331

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyAgrum-1.12.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 355bee00bc2ffbe163f3f9901889471a96e53b7cb11fc7eed73d32daab46d6a9
MD5 6605db21f3c579ca498a8072bf29a9a3
BLAKE2b-256 9e34133c9b50bbf12ebaf574a292de85c0930aa06a415997765448a6540373e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ab3654f0294ab5e8a31087f34339f2d202087c273eafc19c8680cc45c5f146ab
MD5 e89522732855632aa0359f9a588a199c
BLAKE2b-256 ac6b1b667a6315426f547770289a59d3ef00f29b79fff56cd364adbf6cc43341

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6bbe14d7f9e169bad3c6299c830b84ec6257af21d379dd44995cdaaf1d167f3c
MD5 17be3ee7adb8e4e4960e56dddd5b6450
BLAKE2b-256 e1615835239c06813e0146a1862d19c31dbd14047e960b022a3a77ab5e0d4f07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 849387ad1b85cbb8e5887a9a0fa7a0049a3d94a43e6cef6dd513f38f7a004809
MD5 5204b5b8e6ceaccb97cc8b34c0fb319d
BLAKE2b-256 001cc21c36c62302045ef24cf31b3ea5f8e847f3c445243483abca25469d404d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 52be98d8fd721335ab97f79422e10cec991bff99b032095aadb0a5b382c7b69b
MD5 4a667f91965b98fad8936c3e729b5f51
BLAKE2b-256 a850979ab1df24c04cb411caf92ac193fece43fba73726b80bb8552b3ae0fc62

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyAgrum-1.12.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b1988c020beed58822961a435b98d00a90bc5826ae441caed0db2f9620f7c227
MD5 6f73e8077cb2efd39ee47842853e71f3
BLAKE2b-256 bf8cb45048b002dfaeb64a04073e69f20ed59c81a4e72350336b1c96180fccfb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a83777346ad6b8013104d6c6a7538ef8ce717549500b1db8a9e28cae85ec4501
MD5 7498a6da8939e717f4f98f6181e11eb3
BLAKE2b-256 77f696e157f65febc312beab1d27dd6f83d970e1cfbd8d155b6be8ef153bcc41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9e034ec1e6b6e7fc916779f530cd7fc8e20b0f95b3b6a03d27031c79124627e9
MD5 eb9d8cc5c7ad62596d043a1e8e553f7b
BLAKE2b-256 5d13617a62fdbca19a13f234f59bd4bd8e198b2e1fa42bf33017136490457c79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 61bed480d572771b77483e99a176b65b3b46ae8ec16f6f4d947a0e19ab4c6384
MD5 50c34f365249085987e0bb0cd9a260a4
BLAKE2b-256 ae028e2dec8ad92e531a7ff7e744d7bc03a77c6bcd3772ae05fbce5c6748a4f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 63f75275788584bd3f1b6c2c392ce51aeebccf8a470c3329f00048f0fe7258b2
MD5 7e58dd1c03bbb22c729791a65c852763
BLAKE2b-256 a899b7867499b473a8abe26bdeba2dec66478dde9bed51cd75d4375242f82aec

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyAgrum-1.12.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6ed7b0c9124fc77f695f30ab3fe72cc052ee74b91b3d5bb86f41c74de1027f5a
MD5 15d281fb948cad0f800b009b87bda6dd
BLAKE2b-256 1e041b833c473f3b5f2823c6388cb568bf60ae887cf6b4dbf9638831253c3d82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3fdc0d2518cfd47d15a4c2fbb9d4943c98be8baa43dc5174dee8af0929c79aac
MD5 7c675e0116d6fef34358c56fc920424d
BLAKE2b-256 fbe62e6a77f407d376a5070ea2f80c2b8b2d553691cbda255a09261083904a0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 229817c8251a71b46ba6e00e8af09878540af2dc05e92ee8752448f7a3553031
MD5 12aecbedf5f83392e535aa5d4ae56176
BLAKE2b-256 bd4d425e83b6ced66612f61cd7a2e3ee757651fbaf7d8cb4d902ba60882def66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f38ef834cb239cfbd9fece0679f652bcaed048e9ea68dd5573f8d86f357d9336
MD5 9b160f602fc589998b7ac92924f158ca
BLAKE2b-256 2db935ca606dbfe689af633cd4a18007a9bceff74ad6fca7777a1d04d5b02c12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9d1893870200f0ee9271c5bf5e626b6abe88ca90b868f1f4d774af3e438af21e
MD5 7d25426ccbc172091cb0d2812f3c5979
BLAKE2b-256 8906425dd877303fcdd45b13f71202320846c3208e72a69e44cca4c989a41d56

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