zzz24512653 / CommunityDetection

Implements of community detection algorithms
354 stars 174 forks source link

原来你是中国人,直接打汉字了,为啥我执行你的GN算法 再求club俱乐部的时候 发现你的算法结果不是很好呢? #2

Open sdd1991 opened 7 years ago

sdd1991 commented 7 years ago

这个俱乐部真实划分结果为: 社团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 请问这是怎么回事?

zzz24512653 commented 7 years ago

是这样:我提供的代码里面的输出是打印的modularity最大的社区分割,而作者所说的最好的划分是第一次分开两个社区的那个划分。加上打印输出你就能看到完整的分割过程了,第一次分割开的结果和作者所说的是一致的。 while len(self._G.edges()) != 0: edge = max(nx.edge_betweenness(self._G).items(),key=lambda item:item[1])[0] self._G.remove_edge(edge[0], edge[1]) components = [list(c) for c in list(nx.connected_components(self._G))] **print '------------' for c in components: print c print '------------'

part result:

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 3, 4, 5, 6, 7, 10, 11, 12, 13, 16, 17, 19, 21] [32, 33, 2, 8, 9, 14, 15, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]

wjy3326 commented 4 years ago

问下很多数据集都没有真实划分结果,请问怎么评价算法的好坏呢?

zzz24512653 commented 4 years ago

modularity或者结合业务实际情况进行判断?

wjy3326 notifications@github.com 于2020年7月23日周四 下午12:45写道:

问下很多数据集都没有真实划分结果,请问怎么评价算法的好坏呢?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zzz24512653/CommunityDetection/issues/2#issuecomment-662815987, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPDV62HJW3R7U626EM2I2DR4655RANCNFSM4DSIAWDQ .