All Projects → koaning → Brent

koaning / Brent

Licence: mit
bayesian graphical modelling and a bit of do-calculus for discrete data.

Projects that are alternatives of or similar to Brent

Mlhep2017
MLHEP 2017 slides & seminars
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Musical matrices
A repository for some code about music generating neural networks
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Codes
不可能不会系列
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Oscon Neo4j Recommendations
Jupyter notebook for OSCON 2017 Neo4j recommendations workshop
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Training Gcp
Labs and demos for courses in the Google Cloud Platform Training (https://training.topgate.co.jp).
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Intro To Python
Introduction to Python (2014)
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Cryptocompare Api
Jupyter Notebook with examples of useful CryptoCompare API calls
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Applied Plotting Charting And Data Representation In Python
University of Michigan on Coursera
Stars: ✭ 26 (+0%)
Mutual labels:  jupyter-notebook
Detectiontutorialspacenet
This is a tutorial on training a network to detect buildings with the SpaceNet data.
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Tutorial
Stars: ✭ 26 (+0%)
Mutual labels:  jupyter-notebook
Sentence Aspect Category Detection
Aspect-Based Sentiment Analysis
Stars: ✭ 24 (-7.69%)
Mutual labels:  jupyter-notebook
Network evaluation tools
Python 2.7 package with examples for evaluating a network's ability to group a given node set in network proximity.
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Resources
PyMC3 educational resources
Stars: ✭ 930 (+3476.92%)
Mutual labels:  jupyter-notebook
Threader
Easy Twitter threads with Python
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Futures strategy
Stars: ✭ 26 (+0%)
Mutual labels:  jupyter-notebook
Databases workshop
RCS Intro to Databases workshop materials
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Binary ops
Stars: ✭ 25 (-3.85%)
Mutual labels:  jupyter-notebook
Heat and trees
Using HoloViz to explore relationship between surface temperature and tree density
Stars: ✭ 26 (+0%)
Mutual labels:  jupyter-notebook
Batch Effect Removal Benchmarking
A benchmark of batch-effect correction methods for single-cell RNA sequencing data
Stars: ✭ 26 (+0%)
Mutual labels:  jupyter-notebook
Gen bias gain
A Convenient Generalization of Schlick's Bias and Gain Functions
Stars: ✭ 26 (+0%)
Mutual labels:  jupyter-notebook

Build Status Build status

They're good DAGs: brent.

What it is

Brent is a small, but fun, python library that makes it easy to explore causal graphical modelling and do-calculus on systems with discrete variables. Brent is a tool that can help out when you can write a system like below, but want to write complex queries on it.

Quickstart

You can install brent via pip:

pip install brent

Next we need to have a dataset and create a graph from it. The code below demonstrates how to do this.

from brent import DAG
from brent.common import make_fake_df

dag = (DAG(dataframe=make_fake_df(7))
       .add_edge("e", "a")
       .add_edge("e", "d")
       .add_edge("a", "d")
       .add_edge("b", "d")
       .add_edge("a", "b")
       .add_edge("a", "c")
       .add_edge("b", "c")
       .add_edge("c", "f")
       .add_edge("g", "f"))
dag.plot()

Not only do we get pretty plots, but we also can build an expressive query on top of it.

from brent import Query
q = Query(dag).given(d=1).do(a=0, c=1)
q.plot()

If you're more interested in doing the inference, that's simple too.

# we can also see updated probabilities
q.infer()
q.infer(give_table=True)

Documentation

Liked the quickstart? The documentation (which is generated with pdoc3) can be found here.

Alpha Notice

NOTE! this project is in preview stages. I think I have something fun here and I've written unit tests on what I'm doing but parts are still going under review. Also there are parts of the library currently missing but which are on a roadmap:

  1. conditional indepdence tests
  2. api for counterfactual queries
  3. more unit tests
  4. datasets to start/teach with
  5. clear logging
  6. estimator/transformers for scikit-learn

Developing Locally

After cloning you may install brent in the virtual environment via:

$ pip install -e ".[dev]"

You can generate documentation locally by running:

$ pdoc --html --overwrite --template-dir doc-settings --http 0.0.0.0:12345 brent
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].