Bayesian Hierarchical Community Discovery
Project description
bhcd: Bayesian Hierarchical Community Discovery
An efficient Bayesian nonparametric model for discovering hierarchical community structure in social networks.
Parameter Tuning
There are five parameters (alpha, beta, lambda, delta, gamma) to be tuned, lines within interval (0,1) and satisifies the following constraint.
alpha > beta lambda > delta
Build
Use CMake to build, necessary dependencies are glib and gsl. For Windows, you can use vcpkg to install the dependencies. remove lua support.
# apt install automake libtool libgsl-dev liblua5.1-dev
$ autoreconf -i
$ ./scripts/config release
Usage
Python wrapper. Set an environment variable called BHCD
, pointing to the executable of bhcd. Then
you can run python bhcd.py
to get the hierachical tree.
$ cat >tiny.gml <<EOF
graph [
sparse 0
node [ id 0 label "a" ]
node [ id 1 label "b" ]
node [ id 2 label "c" ]
edge [ source 0 target 1 weight 1 ]
edge [ source 1 target 0 weight 1 ]
]
EOF
$ ./src/bhcd/bhcd -S -p tiny tiny.gml
seed: 2a23b6bb
output prefix: tiny
time: 3.010000e-04s
tree: logprob: -1.92e+00 (0:4,1:2/0:4,1:0) #intern: 2 -1.92e+00:{-1.03e+00:{a , b }, c }
$ ./scripts/bhcd_plot tiny.tree tiny.fit tiny.pdf
-4.82e+00:{-1.66e-01:{a, b}, c}
Then tiny.pdf will have a plot of the clustering.
Paper
Blundell, C., & Teh, Y. W. (2013). Bayesian hierarchical community discovery. In Advances in Neural Information Processing Systems (pp. 1601-1609).
@inproceedings{blundell2013bayesian,
title={Bayesian hierarchical community discovery},
author={Blundell, Charles and Teh, Yee Whye},
booktitle={Advances in Neural Information Processing Systems},
pages={1601--1609},
year={2013}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pybhcd-0.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d75eed0789eb2a914224a4d5d83940dbec0e9ad1ded908aa7c4edfaaf8adc309 |
|
MD5 | e94712ec605bf4cd836e11d3b065b557 |
|
BLAKE2b-256 | dbe296af74a7ec8dc66f5d0d52680eac10a5a49203af62d1304f2dcd73fe3962 |
Hashes for pybhcd-0.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18bf4813e9e62d8439208c06fd8d4264ecb66db011e642b23cf9a2a95e559718 |
|
MD5 | a3e0ebeaf7b5cdc0ac3fa5e81fd6b4da |
|
BLAKE2b-256 | 31f993e72678266243e1e8731d17c5414d36e6d2a341625b0dbaa48943df5c51 |
Hashes for pybhcd-0.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd7ebf1c9795452240d23c747736c28b2bb69f5a7f3320917dbb9719d9a9f3f9 |
|
MD5 | 5a4e71e45a5cec23b8176e91485ac2c4 |
|
BLAKE2b-256 | caa9c25b0401b28495d878e7598d631b2730dbaa8f5dd112581e76199c9cccce |
Hashes for pybhcd-0.1-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dea9617c5e084cb46947aa04aad98fb51e557ca22d9894ca4ed1e02e2934b735 |
|
MD5 | 24a6195da2ad666ce375a54c5e524393 |
|
BLAKE2b-256 | 21603668a316750bbdd1ae46123a86f79a3e6208059499f5a357eb531cb4f728 |
Hashes for pybhcd-0.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6257b76c5e66e05082fd8f50ed075bafb851b8f5112e6305e5c76de72af997a |
|
MD5 | 54d827e0e23317843233c04ab7d39ec9 |
|
BLAKE2b-256 | bdd948272dcac38c9d9606725e60932228b1f87d8a7ca142af21aac4b3a9a686 |
Hashes for pybhcd-0.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f48ff9f3ccf2aa23cc77f25cc360ebca9e9c943dad3c8822c84fc9f5aadd29d9 |
|
MD5 | cdef7ad7e2426d731769c724303420b2 |
|
BLAKE2b-256 | 09716a4f052a48aba9cec903a332bd18a972deef90c649dccadcf14d5336a197 |