nlpub / chinese-whispers

An implementation of Chinese Whispers in Python.
https://chinese-whispers.readthedocs.io
MIT License
58 stars 13 forks source link

Question about the algorithm #34

Closed faalatawi closed 2 years ago

faalatawi commented 2 years ago

Hello,

I have a question about the Chinese Whisper (CW) algorithm. How does it differ from the Label Propagation Algorithm (LPA)? which is implemented by NetworkX.

When should I use CW? and when LPA?

I'm working on a paper about community detection. and I appreciate the help.

dustalov commented 2 years ago

Hi, this is roughly the same algorithm independently discovered by different people from different areas of study. You can inspect the code to notice very similar computation steps.

The key difference between Chinese Whispers and other algorithms is the possibility of specifying the label weighting approach in node neighborhoods. It allows adjusting the way the dominant class is selected.

In top weighting, CW is equivalent to LPA. Our experience in studying language graphs shows that linear (lin) and logarithmic (log) weighting approaches fit these kinds of data better. Indeed, one has to tune this hyper-parameter on the specific dataset.

faalatawi commented 2 years ago

Thank you so much for the answer