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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12

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

Uploaded CPython 3.12

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.9+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11

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

Uploaded CPython 3.11

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.9+ x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10

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

Uploaded CPython 3.10

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 10.9+ x86-64

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9

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

Uploaded CPython 3.9

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

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.9macOS 10.9+ x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8

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

Uploaded CPython 3.8

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

Uploaded CPython 3.8macOS 11.0+ ARM64

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

File metadata

  • Download URL: pyAgrum-1.12.0-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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f946bbbd8509d130198838c1ff6429eb84253eacf49e5bb8d73cdf022cca23a3
MD5 ae4456a5a6e1405e021902898428f026
BLAKE2b-256 d6d7b53838988dd12a89fa8e40cbd1dfad4a04ab561a193f9355bbc1672b3dd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d0d6473a4007d2c0dcc16bb98d0006414c38fd03e1f74408c217fa2a026a8736
MD5 402b2e4652174c211510d2787a6b6073
BLAKE2b-256 924ceb48d7a05b062572a6618e3fa3aecc70151ee34678d3da5308be7d46bda8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 08f86e48c27d8076b7d17854303237b997838ceebed6295e35f0f6ea7f0ff6be
MD5 2866666b8100b13c317611211dfacd11
BLAKE2b-256 d4e4339617979e2b5190634d99cb3b9acbe71f2205a3cc702c6628af1c24c1f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9409ec981920ab0068cff601639747424e8027201e1d521cb356bfbc2dddae11
MD5 bee354f1722ffd2a1d5b349c7681fee4
BLAKE2b-256 ffb6016ffa2b6f38a9bf302f1b9747686d095624451a2c93950dcbe24024e155

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4fc4ddf1dc7160c4f90baf9c66ea2366583f37ecfab78196add12ebdca8c9741
MD5 6fedf8818899d8ffdcb5a153e05cfe1d
BLAKE2b-256 8021b077c059a7fd8a48c8c5c453edf30b1bea9068cfd17af333abb6a1929609

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyAgrum-1.12.0-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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 db9582f3ca81b10d4179824ee06b29b91bac34e561141e5584ee8045df7207de
MD5 af92040b503cad7b3f800ff9d8d2c87e
BLAKE2b-256 120dfbdad0dfc6c559dc7e93700f80395c9fb1e42c1c8726da05b6b8f7e7b8bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4f59a6700e1a4373e5683eb50e31c47b2d2f3717895c2fe534b3ba1e19caa31
MD5 8207dd0943f7594b53ea6f14e589a6e9
BLAKE2b-256 252b4ab317da62b27ed4f09645fc9cd0e852f30d281352d5265902e814d54e98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 021c8aa58522d5744035ad8101e798f174300240849a3118c43b38dffe7b1ac4
MD5 0a3c82b685d279ce8eeaba6b64f31929
BLAKE2b-256 039b114612b3da5c1dbb8aab12a6b4d44eddc98aeb8e5e2d0bbb4376163f05bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 480477be9532c4af0c0b57cd59f258fa1a783e253daa2d4a06c655cc02471b06
MD5 b0ddc9cabd0b2635652756248e268b60
BLAKE2b-256 a5b0b7b0fc361e3185af207b7ac56a3a06e6fefa923996f0dcdd6573e9ab0897

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7398ee1b405471b0c8f9670de69ac3d3970b4ef76f24c2766aa151807364effb
MD5 596a948f532fd30403da2c32b95ca6cd
BLAKE2b-256 62366a436eaf6442905e1a3ffac2edf1b32571ebae38786f1f04e020668e212d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyAgrum-1.12.0-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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5deeff58cf7195516a008e0f07e3831e4a71c4e9470382dca46686aab3236c37
MD5 729eb32311e7acbac9860189139a2c92
BLAKE2b-256 180c87d6f93ffa3069f12dffdbcb73b1bb90823b80ba14599ae9e73b2362aa76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 03be8745374de0407b082dbb564bad8acf2b36d1576b897e25638ea752d24187
MD5 c4d1f70da419e9246d796d9a9c519d51
BLAKE2b-256 44a38f13860521082a6194367bef5a7cc19d5bdea2e79be0faecc27e6020ecee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 734ee9d3e33a11780335eb3059f32c99a8e44273db5007051ed505a84bce05c7
MD5 6c5b87e0f5fd9c76885c4071b0ad12ed
BLAKE2b-256 582acc2b80e0d108af85155a34ecf90a519d07f3595fa56f62e57e84aef31264

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4c293da97c945945fe3ae735bbe5507b8edd89033c486b2895ee6d257b29abdb
MD5 d7c8a1d1990afd08653cbd109cd50779
BLAKE2b-256 97c6a00b3d9ee6fb38ee94b631021932c610f274d1360d22f8a639a5e10eb774

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a9e8cbfa6e1f6335ed85f5dfc293f39ebb0f9b75928b6d11f7303f7fe2a039c2
MD5 c7ecf951d52418e4851170b37e98afc1
BLAKE2b-256 cffc613bc1d03c1407d75efcc5fa8881fd407f62c853750ff58c7d41aee98986

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyAgrum-1.12.0-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.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d03f91ed2b3dcf3b401878b33671851b3b007db04ec86e853bea8872fc3216be
MD5 4481a29650cc2ed55cb1b2fa29d5d505
BLAKE2b-256 61564c266924bb04c3716eb9650edd03299e8a74edba1b2cc17dda185cdcea8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4d4607ac9e6f7f2509270d4b4732355b5d62f6ad9e8b6ad893adc8671a3a9014
MD5 cdb9d84af5787d00f4f6cef184e44c5e
BLAKE2b-256 bc39a3195a223d33cb836bb1bc5bee251d316471425d6855cbd0730a215ebd74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 46d3c57185634734214c4cb8470551decea5099104d520336daacafe31348777
MD5 b2212a31bfe58f86cd2e536b6f1b4a6f
BLAKE2b-256 c1cf5426db31b62a5096e9c07c610a44575d4404b66af495d950d0ebe6bff04d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 27cf71f19b446f71cac9978ae33908fe948eae4a90daa9465fedcc83a344f459
MD5 da97c275194f799a6102a9b93943aa73
BLAKE2b-256 7b5f1250e182c417dfa64718461e3039a26eb184bab7acd809ab5a5e2a0e6c0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 00921ac1482750729dfee2470729e48c4d07c122433c8bc65b4741ffcf777869
MD5 0bb4dc50a634529f1416eae3cea58c61
BLAKE2b-256 206d3a86c4af73fa9bd19db1bc6be3209c212f74b1eab4fdf3a4dd61876f13ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyAgrum-1.12.0-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.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2a447f52ebdeed96758ecb858e29f207c1b29d905b7be82f9183a509fc6df013
MD5 3ba707c8c1a942c5d14d52c411dcfa27
BLAKE2b-256 b3c5e6ebff65c8947419de59ffe7c5468802a26e42b0d50fdde97b18e33c5a77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5a0789e21684862ab9ede7af5ab0d969b5899bf67f2bb2478ea807f59b925ddf
MD5 77c5de4212f274b5c420604881401de8
BLAKE2b-256 f67c0dda9d7ff4a883ff502377c126f9617aa6881cef5c1e7542923a01dbb403

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d96e63619a27e2b7e193848987dab72588dba86f2d9408c0fe4aff2121dcbf7c
MD5 d7bd55fc4b23139582721aa9aaaadf63
BLAKE2b-256 34880ee54e5776a179185e23e91807ddf68dfc447d27dce1dba584e2fb318148

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 01350f3111d588f21694eb601d02ebd97a88c4518a0a2877c1bc6fe7cbff4020
MD5 eed9db726b6551ecee597eec4ccd7224
BLAKE2b-256 f6901cfb1d266f845c058fc960e6799f8ad2e626565bc2e807df59dade40819e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyAgrum-1.12.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9d096d00b30370206119da70507c98a6f22b4b5cfad2acb48e04fe9539c12d8f
MD5 ad38aeec6ffc7eb553b1144a186fb6e5
BLAKE2b-256 20adca123b00029149c2f324391cb2737bdbd8b4d732032e922a5d3bedcce422

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