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

Metadata

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 Provenance Actions
cgm-0.0.10.tar.gz 17.9 kB Without provenance Details for cgm-0.0.10.tar.gz

Built distribution (wheel)

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

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

Security for cgm 0.0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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