GithubHelp home page GithubHelp logo

cgm's Introduction

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

cgm's People

Contributors

kyleellefsen avatar

Stargazers

Yezi Chu avatar Coye1023 avatar Daniel Schulz avatar Ethan Hathaway avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.