http://www.ludowaltman.nl/slm/
黑色字体的第二段末尾说,三种 Louvain 实现都支持 分辨率 参数,用来决定检测到社区的粒度:
All algorithms implemented in the Modularity Optimizer support the use of a resolution parameter to determine the granularity level at which communities are detected.
手写 Louvain 算法时,这个 分辨率 参数怎么体现呢?
是 deltaQ 小于某个值时迭代终止?
该网页提供的代码是java版本的:
http://www.ludowaltman.nl/slm/modularity_optimizer_source.zip
有用硬着头皮看看吧。。。
- How to use “resolution” when applying louvaon algorithm for community detection?
- Louvain clustering: resolution parameter #3184
可能这一篇 [文章](Laplacian Dynamics and Multiscale Modular) 提到 分辨率的实现?
Another paper Laplacian Dynamics and Multiscale Modular
Structure in Networks that is referenced by the implementation of the python-louvain library refers to this as time.
https://github.com/igraph/rigraph/issues/239
观众: 原算法作者的java代码支持 分辨率,希望R版本的 igraph 也支持: http://www.ludowaltman.nl/slm/
igraph 作者: R包Seurat已经通过Rcpp支持了。
观众: 不行,我就要,防止代码扩散嘛
作者: Rigraph 打算在支持 Leiden 算法时添加分辨率参数。
最后,有人提交了一个C版本的PR: (commented on 2 Jun 2020)
https://github.com/jmonlong/Hippocamplus/blob/config/R/rigraph_gammalouvain/community.c
2. 其他短小的python 实现 (1) 实现1: 没有 resolution 参数
https://blog.csdn.net/qq_16543881/article/details/122825957
这个有问题,小数据集看着还行;
但是对于 3000 个顶点的 pbmc 3k 真实数据集,直接输出了和点数一样的社区数,肯定哪里不对。
修正版: Louvain_5.py
ref: https://zhuanlan.zhihu.com/p/522751212



