Giter VIP home page Giter VIP logo

felixleopoldo / trilearn Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 5.0 1.64 MB

Bayesian structure learning and classification in decomposable graphical models.

Home Page: https://trilearn.readthedocs.io

License: Apache License 2.0

Makefile 0.06% Python 99.90% Dockerfile 0.05%
decomposable-graphs decomposable-graphical-models bayesian-statistics markov-networks sequential-monte-carlo log-linear-model covariance-selection gaussian-graphical-models predictive-modeling classification

trilearn's Introduction

GitHub PyPI Libraries.io dependency status for latest release

Bayesian inference in decomposable graphical models using sequential Monte Carlo methods

This library contains Bayesian inference in decomposable (triangulated) graphical models based on sequential Monte Carlo methods. Currently supported functionalities include:

  • Bayesian structure learning for discrete log-linear and Gaussian data.

  • Estimation of the number of decomopsable graphs with a given number of nodes.

  • Predictive classification using Bayesian model averaging (BMA).

  • Random generation of junction trees (the Christmas tree algorithm).

Installation

If graphviz is not installed, you can install it from brew / aptitude / pacman for example

$ brew install graphviz

On Ubuntu you might need to run

sudo apt-get install python-dev graphviz libgraphviz-dev pkg-config

Then run

$ pip install trilearn

It is also possible to pull trilearn as a docker image by

$ docker pull onceltuca/trilearn

Running the tests

$ make test

Usage

See the Jupyter notebooks for examples of usage.

Scripts

Continuous data

To approximate the underlying decomposable graph posterior given the dataset sample_data/data_ar1-5.csv run

$ pgibbs_ggm_sample -N 50 -M 1000 -f sample_data/data_ar1-5.csv -o results_ggm

this will produce a file containing the Markov chain generated by the particle Gibbs algorithm. In order to analyze the chain run

$ analyze_graph_tajectories -i results_ggm -o results_ggm/plots

this will produce a bunch of files in the current directory to be analyzed.

Discrete data

The data set examples/data/czech_autoworkers.csv contains six binary variables. To generate a particle Gibbs trajectory of decomposable graphs type

$ pgibbs_loglinear_sample -N 50 -M 300 -f sample_data/czech_autoworkers.csv  -o results_loglin

and

$ analyze_graph_tajectories -i results_loglin -o results_loglin/plots

this will produce a number of files in the current directory.

Estimate the number of decomposable graphs

To estimate the number of decomposable graphs with up to 15 nodes run for example

$ count_chordal_graphs -p 15 -N 20000

Built With

Authors

  • Felix L. Rios just send me an e-mail in case of any questions, felix.leopoldo.rios at gmail com

References

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details

Acknowledgments

  • Jim Holmstrom

trilearn's People

Contributors

felixleopoldo avatar melmasri avatar rocafuerte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

trilearn's Issues

Just in time canceling

Make trilearn handle eg SIGINT by writing the trajectory sampled so far. This property can be used in benchpress.

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.