zzz24512653 / communitydetection Goto Github PK
View Code? Open in Web Editor NEWImplements of community detection algorithms
Implements of community detection algorithms
def cal_EQ(cover,G):
例如 此处的 cover是什么, G应该是nx的图我晓得
以下是你自己在这个文档里写的 paper来源以及 G的格式, 可是cover的格式尚未给出。
paper:<>
G:vertex-neighbors {vertex:list(neighbors)}
问下,我用了louvain算法,每次用data数据集测试,结果都不一样,是不是这个算法本身不够稳定呀?那个GN算法,您说时间复杂度很高,是不是工程应用上不太合适啊,比如节点很多的情况?那k-团渗透算法可以用于工程领域上吗?就是哪些算法可以用在工程领域,又比较稳定的呢?谢谢啦!
还想问下,GN算法可以并行吗,就是如果想在工程中应用的话,可以用map reduce加快处理速度吗?
Traceback (most recent call last):
File "", line 1, in
runfile('C:/Users/HP/Desktop/CommunityDetection-master/algorithm/GN.py', wdir='C:/Users/HP/Desktop/CommunityDetection-master/algorithm')
File "C:\Users\HP\Anaconda3\envs\network\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
execfile(filename, namespace)
File "C:\Users\HP\Anaconda3\envs\network\lib\site-packages\spyder\utils\site\sitecustomize.py", line 86, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)
File "C:/Users/HP/Desktop/CommunityDetection-master/algorithm/GN.py", line 38, in
algorithm.execute()
File "C:/Users/HP/Desktop/CommunityDetection-master/algorithm/GN.py", line 26, in execute
cur_Q = cal_Q(components, self._G_cloned)
File "../util\modularity.py", line 9, in cal_Q
t += len(G.neighbors(node))
TypeError: object of type 'dictionary-keyiterator' has no len()
请问一下,这个要怎么解决
for example how can i run louvain algorithm with nmi evaluation ??
thank you for your support
在LPA.py里excute方法 第56行 for i in range(self._n): 和 can_stop里 的for i in range(self._n): 是假设节点id都是顺序排列的,如果是打散的就会报no item key, 应改为for i in G.node: 比较通用
你好,我想问一下club.txt是什么数据集?可以解释一下数据的含义吗?麻烦了
你好,请问运行LFM算法,报错“'Graph' object has no attribute 'node'”,是什么问题呀?
def cal_EQ(cover,G):
vertex_community = defaultdict(lambda:set())
您好,请问cover 和G 分别指的是什么,数据格式是什么形式的。
It will throw ValueError when calling LPA.get_max_neighbor_label()
with isolated vertex
Hi, I implemented the LPA algorithm and the Louvain algorithm and compared the result with igraph. I found that they are different. For example, as for LPA, the igraph will get about 3040 communities, but my own code will get about 4050 communities. As for Louvain, the igraph will get 13 communities, but my code will get 55 communities. Actually, the results from my code are very similar to the igraph, only in about 7 communities, my code will divide the whole community to 3 or 4 communities, so as to lead the number of communities is different to the igraph.
Could you explain why it occurs the scale problem?
在算法的get_hubs_outliers(self, communities)函数中:neighbor_community.add(node_community[neighbor])
如果node_community中并没有neighbor,这个地方就会报错。并且算法本身也并不能保证不出现这种情况(我在我的数据集上运行的时候遇到了这个问题)
你好,你算法里面的louvain实现graphx跑起来太费内存了,这样的数据结构不适合大图计算啊
For some reason, your code in the 2nd stage doesn't fold the communities correctly. I've tested with the data from the "Louvain" paper (Figure 1), by the end of the first iteration of first stage, I got six separated communities, which were {1,2,4}, {0,3,5,7}, {6}, {8,15},{9,12,14}, {10,11,13}. However, for certain vertex, let's say "7" from the group of {0,3,5,7} was computed "deltaQ" with vertex "3" instead of {6} in the second stage.
But the final result was correct.
我真的不会map/reduce,哎,所以大哥做了并行化的Louvain嘛,我这边大概上百万个节点,小机器跑不出来呀
line 69 in Louvain.scala
"val q = (k_v_in - tot * k_v / m)"
is this missing 0.5 factor? I think this line should be "val q = k_v_in - tot * k_v / (2*m)"
博主你好,我用你的代码跑出的结果,和community_louvain.best_partition 分区结果不一样,但没理解是哪里不一样,你之前有发现这个问题吗。谢谢
这个俱乐部真实划分结果为:
社团1:0 1 2 3 4 5 6 7 10 11 12 13 16 17 19 21
社团2:8 9 14 15 18 20 22 23 24 25 26 27 28 29 30 31 32 33
使用GN算法划分的结果为:
社团1: 0 1 3 4 5 6 7 10 11 12 13 16 17 19 21
社团2: 2 8 9 14 15 18 20 22 23 24 25 26 27 28 29 30 31 32 33
也就是说 真正的GN算法仅仅分错一个节点
但是你的算法:
社团1:0, 1, 3, 7, 11, 12, 13, 17, 19, 21
社团2:2, 24, 25, 27, 28, 31
社团3:16, 10, 4, 5, 6
社团4: 32, 33, 8, 14, 15, 18, 20, 22, 23, 26, 29, 30
社团5: 9
请问这是怎么回事?
In util file ,there is not graph_helper!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.