Skip to content

Examples showing how to use the python implementation of Bayesian hierarchical clustering and Bayesian rose trees algorithms.

License

Notifications You must be signed in to change notification settings

caponetto/bayesian-hierarchical-clustering-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI License: GPL v3

Bayesian Hierarchical Clustering examples in python

This repository contains examples showing how to use the code located at caponetto/bayesian-hierarchical-clustering

How to run the code

  1. Create an anaconda environment using the file environment.yml.

    $ conda env create -f environment.yml

  2. Activate the environment after the installation is completed.

    $ conda activate bayesian-hierarchical-clustering-examples

  3. Run the file example.py.

    $ python example.py

  4. Check out the output images in the results folder.

Note: You can optionally add your own data in the file data.csv but the hyperparameters must be optimized.

What to expect from the example code

A plot of the input data (2D). Suppose we want to find two clusters of data (orange and blue).

Dendrograms obtained from linkage algorithms. Notice that, none of them can tell us the presence of the two clusters.

A binary hierarchy obtained from the Bayesian hierarchical clustering algorithm. Notice that, two clusters have been identified containing the expected data points (leaves).

A non-binary hierarchy obtained from the Bayesian rose trees algorithm. Notice that, two clusters have been identified containing the expected data points (leaves).

Contribute

All contributions are welcome, so don't hesitate to submit a pull request. ;-)

Troubleshooting

If you run into issues with graphviz when running the example, you might need to install it through

sudo apt-get install graphviz

License

This code is released under GPL 3.0 License.

Check LICENSE file for more information.

About

Examples showing how to use the python implementation of Bayesian hierarchical clustering and Bayesian rose trees algorithms.

Topics

Resources

License

Stars

Watchers

Forks

Languages