arzwa / BayesianHClust

Bayesian hierarchical clustering (~Heller & Ghahramani)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implementation of the Bayesian Hierarchical clustering method of Heller & Ghahramani Currently with focus on Dirichlet-Categorical/Dirichlet-Multinomial conjugate models, but the implementation should be general enough to admit other models.

Heller, K. A., & Ghahramani, Z. (2005, August). 
Bayesian hierarchical clustering. 
In Proceedings of the 22nd international conference on Machine learning (pp. 297-304).

Note this is software written for my own research purposes, it is still experimental and needs more tests!

Example

using BayesianHClust, Distributions, Plots
ps = rand(Dirichlet(3, 0.5), 3)
Xs = map(p->rand(Multinomial(50, Array(p)), 5), eachcol(ps))
X  = permutedims(hcat(Xs...))  
    
clustalg = BHClust(.1, x->dirichlet_cat_logpdf(x, 1.), (x,y)->x .+ y)
tree = bhclust(X, clustalg)
plot(tree)

About

Bayesian hierarchical clustering (~Heller & Ghahramani)


Languages

Language:Julia 100.0%