Skip to main content

Bayesian predictive classification and structure learning in decomposable graphical models using particle Gibbs.

Project description

# 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 you don't have graphviz on you machine, 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 centralized sample_data/dataset_p15.csv run
```
$ pgibbs_ggm_sample -N 50 -M 1000 -f sample_data/dataset_p15.csv
```
this will produce a file containing the Markov chain generated by the particle Gibbs algorithm.
In order to analyze the chain run
```
$ pgibbs_ggm_analyze -N 50 -M 1000 -f sample_data/dataset_p15.csv
```
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 variables, each taking values in {0,1}.
To estimate the underlying decomposable graph posterior run
```
$ pgibbs_loglinear_sample -N 50 -M 300 -f sample_data/czech_autoworkers.csv
```
and
```
$ pgibbs_loglinear_analyze -N 50 -M 300 -f sample_data/czech_autoworkers.csv
```
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**


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trilearn-0.191-py2-none-any.whl (77.9 kB view details)

Uploaded Python 2

File details

Details for the file trilearn-0.191-py2-none-any.whl.

File metadata

  • Download URL: trilearn-0.191-py2-none-any.whl
  • Upload date:
  • Size: 77.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.2

File hashes

Hashes for trilearn-0.191-py2-none-any.whl
Algorithm Hash digest
SHA256 bfbc80f3aae7b437efcba75ba7e63bd99628a2aed965341c8ee3a3d2dee50464
MD5 f499bee60c5c4ad9eb01b1e006e95b7d
BLAKE2b-256 e7238cf654f0db7428d5ee4e6b48a0cf809cf243d0ed8b5f90881e577b2f532e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page