Skip to main content

Causal Graphical Models

Project description

Causal Graphical Models

CGM Tests PyPi Publish PyPi Version PyPI - Status PyPI - Format License: MIT Checked with mypy Python Version GitHub last commit

A python library for building causal graphical models, closely following Daphne Koller's Coursera course on Probabilistic Graphical Models, and her 2009 book Probabilistic Graphical Models: Principles and Techniques. The source for this project is available here.

Installation

NumPy is the only dependency. Python version must be >= 3.7.

pip install cgm

Usage

import cgm

# Define all nodes
A = cgm.CG_Node('A', num_states=3)
B = cgm.CG_Node('B', 3)
C = cgm.CG_Node('C', 3)
D = cgm.CG_Node('D', 3)
# Specify all parents of nodes
cgm.CPD([B, A])
cgm.CPD([B, C])
cgm.CPD([D, A, B])
# Create causal graph
graph = cgm.CG([A, B, C, D])
print(graph)
# A ← []
# B ← [C]
# C ← []
# D ← [A, B]

Documentation

kyleellefsen.github.io/cgm

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cgm-0.0.10.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

cgm-0.0.10-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file cgm-0.0.10.tar.gz.

File metadata

  • Download URL: cgm-0.0.10.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for cgm-0.0.10.tar.gz
Algorithm Hash digest
SHA256 cb1c485106522e0d66d451f14fa14730b8f293b8279dac9cba87017756c6fa83
MD5 14a55f94452c3c8313c0835ae99aabf1
BLAKE2b-256 8725206e76aaed9a2d0a249491a545ae708d56e77e92c309642dc05024ac2cd2

See more details on using hashes here.

File details

Details for the file cgm-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: cgm-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for cgm-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 cf5359709154219545ec9181d32ca4a0843c400a96419bbaf41690100ddbc55d
MD5 3cff2e61ffb18102e76478818ae8046b
BLAKE2b-256 d2c677304bc38dd46e70791da303b75018d107c012f7bda783c47039f604593d

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