Metadata-Version: 2.1
Name: trilearn
Version: 0.196
Summary: Bayesian predictive classification and structure learning in decomposable graphical models using particle Gibbs.
Home-page: https://github.com/felixleopoldo/trilearn
Author: Felix Rios
Author-email: felix.leopoldo.rios@gmail.com
License: Apache 2.0
Download-URL: https://github.com/felixleopoldo/trilearn/archive/0.196.tar.gz
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
Requires-Python: >=3.0
Requires-Dist: seaborn (>=0.7.0)
Requires-Dist: pandas (>=0.20.3)
Requires-Dist: numpy (>=1.13.0)
Requires-Dist: matplotlib (>=2.0.0)
Requires-Dist: ipywidgets (>=7.0.0)
Requires-Dist: scipy (>=0.18.0)
Requires-Dist: networkx (>=2.0)
Requires-Dist: scikit-learn (>=0.18.0)
Requires-Dist: tqdm (>=4.18.0)
Requires-Dist: pygraphviz (>=1.2.0)
Requires-Dist: nose (>=1.0.0)

# Particle Gibbs for Bayesian classification and structure learning in decomposable graphical models
A graphical predictive classifier and a particle Gibbs sampler for Bayesian structure learning in discrete log-linear and Gaussian decomposable graphical models.

### Installation

If graphviz is not installed, you can install it from brew / aptitude / pacman for example
```
$ brew install graphviz
```
Then run
```
$ pip install trilearn
```

### Running the tests

```
$ make test
```

## 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
```
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
```
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
```
and
```
$ analyze_graph_tajectories
```
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

* [NetworkX](https://networkx.github.io/documentation/stable/index.html)
* [NumPy](https://docs.scipy.org/doc/)
* [Scipy](https://docs.scipy.org/doc/)
* [Pandas](http://pandas.pydata.org/pandas-docs/stable/)
* [Seaborn](https://seaborn.pydata.org/api.html)
## Authors

* **Felix Rios**

## References
* [Jimmy Olsson, Tetyana Pavlenko, Felix L. Rios, Sequential sampling of junction trees for decomposable graphs,
 ArXiv 2018](https://arxiv.org/abs/1806.00584)
* [Jimmy Olsson, Tetyana Pavlenko, Felix L. Rios, Bayesian inference in decomposable graphical models using sequential Monte Carlo methods, ArXiv 2018](https://arxiv.org/abs/1805.12571)
* [Tetyana Pavlenko, Felix L. Rios, Graphical posterior predictive classifier: Bayesian model averaging with particle Gibbs, ArXiv 2018](https://arxiv.org/abs/1707.06792)

## License

This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details

## Acknowledgments

* **Jim Holmstrom**


