Skip to main content

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

Release files for cgm 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cgm 0.0.10
File Size Uploaded
cgm-0.0.10.tar.gz 17.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cgm 0.0.10
File Interpreter ABI Platform
cgm-0.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 37.1 kB

Release files / cgm-0.0.10.tar.gz

Download URL cgm-0.0.10.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cb1c485106522e0d66d451f14fa14730b8f293b8279dac9cba87017756c6fa83
BLAKE2b-256 checksum
How to use checksums
8725206e76aaed9a2d0a249491a545ae708d56e77e92c309642dc05024ac2cd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / cgm-0.0.10-py3-none-any.whl

Download URL cgm-0.0.10-py3-none-any.whl
Size 19.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf5359709154219545ec9181d32ca4a0843c400a96419bbaf41690100ddbc55d
BLAKE2b-256 checksum
How to use checksums
d2c677304bc38dd46e70791da303b75018d107c012f7bda783c47039f604593d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.0.10 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page