Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
trappmartin committed Sep 6, 2018
2 parents ff7b123 + e6c0f06 commit 4f43287
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
BayesianNonparametrics.jl
===========
BayesianNonparametrics.jl is a Julia package implementing state-of-the-art Bayesian nonparametric models for medium-sized unsupervised problems. The software package brings Bayesian nonparametrics to non-specialists allowing the widespread use of Bayesian nonparametric models. Emphasis is put on consistency, performance and ease of use allowing easy access to Bayesian nonparametric models inside Julia.
[![Build Status](https://travis-ci.org/OFAI/BayesianNonparametrics.jl.svg?branch=master)](https://travis-ci.org/OFAI/BayesianNonparametrics.jl)
[![Coverage Status](https://coveralls.io/repos/github/OFAI/BayesianNonparametrics.jl/badge.svg?branch=master)](https://coveralls.io/github/OFAI/BayesianNonparametrics.jl?branch=master)

*BayesianNonparametrics* is a Julia package implementing state-of-the-art Bayesian nonparametric models for medium-sized unsupervised problems. The software package brings Bayesian nonparametrics to non-specialists allowing the widespread use of Bayesian nonparametric models. Emphasis is put on consistency, performance and ease of use allowing easy access to Bayesian nonparametric models inside Julia.

BayesianNonparametrics.jl allows you to
*BayesianNonparametrics* allows you to

- explain discrete or continous data using: Dirichlet Process Mixtures or Hierarchical Dirichlet Process Mixtures
- analyse variable dependencies using: Variable Clustering Model
- fit multivariate or univariate distributions for discrete or continous data with conjugate priors
- compute point estimtates of Dirichlet Process Mixtures posterior samples

Requirements
------------
* julia version 0.6
* packages listed in REQUIREMENTS file
#### News
*BayesianNonparametrics* is Julia 0.7 / 1.0 compatible

Installation
------------
You can clone the package into your running julia 0.5 installation using
You can install the package into your running Julia installation using Julia's package manager, i.e.

```julia
Pkg.add("BayesianNonparametrics")
pkg> add BayesianNonparametrics
```

Documentation
Expand All @@ -29,7 +30,7 @@ Documentation is available in Markdown:

Example
-------
The following example illustrates the use of BayesianNonparametrics.jl for clustering of continuous observations using a Dirichlet Process Mixture of Gaussians.
The following example illustrates the use of *BayesianNonparametrics* for clustering of continuous observations using a Dirichlet Process Mixture of Gaussians.

After loading the package:

Expand All @@ -46,7 +47,7 @@ we can generate a 2D synthetic dataset (or use a multivariate continuous dataset
and construct the parameters of our base distribution:

```julia
μ0 = vec(mean(X, 1))
μ0 = vec(mean(X, dims = 1))
κ0 = 5.0
ν0 = 9.0
Σ0 = cov(X)
Expand All @@ -65,7 +66,7 @@ which is in this case a Dirichlet Process Mixture. Each model has to be initiali
modelBuffer = init(X, model, KMeansInitialisation(k = 10))
```

The resulting buffer object can now be used to apply posterior inference on the model given $X$. In the following we apply Gibbs sampling for 500 iterations without burn in or thining:
The resulting buffer object can now be used to apply posterior inference on the model given `X`. In the following we apply Gibbs sampling for 500 iterations without burn in or thining:

```julia
models = train(modelBuffer, DPMHyperparam(), Gibbs(maxiter = 500))
Expand All @@ -74,19 +75,19 @@ models = train(modelBuffer, DPMHyperparam(), Gibbs(maxiter = 500))
You shoud see the progress of the sampling process in the command line. After applying Gibbs sampling, it is possible explore the posterior based on their posterior densities,

```julia
densities = Float64[m.energy for m in models]
densities = map(m -> m.energy, models)
```

number of active components

```julia
activeComponents = Int[sum(m.weights .> 0) for m in models]
activeComponents = map(m -> sum(m.weights .> 0), models)
```

or the groupings of the observations:

```julia
assignments = [m.assignments for m in models]
assignments = map(m -> m.assignments, models)
```

The following animation illustrates posterior samples obtained by a Dirichlet Process Mixture:
Expand All @@ -111,12 +112,10 @@ end
and find the optimal partition which minimizes the lower bound of the variation of information:

```julia
mink = minimum([length(m.weights) for m in models])
maxk = maximum([length(m.weights) for m in models])
mink = minimum(length(m.weights) for m in models)
maxk = maximum(length(m.weights) for m in models)
(peassignments, _) = pointestimate(PSM, method = :average, mink = mink, maxk = maxk)
```

The grouping wich minimizes the lower bound of the variation of information is illustrated in the following image:
![alt text](pointestimate.png "Point Estimate")

[![Build Status](https://travis-ci.org/OFAI/BayesianNonparametrics.jl.svg?branch=master)](https://travis-ci.org/OFAI/BayesianNonparametrics.jl)

0 comments on commit 4f43287

Please sign in to comment.