Skip to main content

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


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 Distributions

pybhcd-0.1-cp37-cp37m-win_amd64.whl (1.3 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

pybhcd-0.1-cp37-cp37m-manylinux2010_x86_64.whl (686.6 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

pybhcd-0.1-cp37-cp37m-macosx_10_14_x86_64.whl (84.4 kB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

pybhcd-0.1-cp37-cp37m-macosx_10_13_x86_64.whl (381.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.13+ x86-64

pybhcd-0.1-cp36-cp36m-win_amd64.whl (1.3 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

pybhcd-0.1-cp36-cp36m-manylinux2010_x86_64.whl (685.2 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

Supported by

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