跳到内容

此函数评估两个社区结构之间的距离。

用法

compare(
  comm1,
  comm2,
  method = c("vi", "nmi", "split.join", "rand", "adjusted.rand")
)

参数

comm1

一个包含社区结构的communities() 对象;或者一个数值向量,即第一个社区结构的成员向量。成员向量应包含每个顶点的社区 ID,社区编号从 1 开始。

comm2

一个包含社区结构的communities() 对象;或者一个数值向量,即第二个社区结构的成员向量,格式与前一个参数相同。

method

字符标量,要使用的比较方法。可能的值:‘vi’ 是 Meila (2003) 的信息变异 (VI) 指标,‘nmi’ 是 Danon 等人 (2005) 提出的归一化互信息度量,‘split.join’ 是 can Dongen (2000) 的分裂-合并距离,‘rand’ 是 Rand (1971) 的 Rand 指数,‘adjusted.rand’ 是 Hubert 和 Arabie (1985) 调整后的 Rand 指数。

一个实数。

参考文献

Meila M: Comparing clusterings by the variation of information. In: Scholkopf B, Warmuth MK (eds.). Learning Theory and Kernel Machines: 16th Annual Conference on Computational Learning Theory and 7th Kernel Workshop, COLT/Kernel 2003, Washington, DC, USA. Lecture Notes in Computer Science, vol. 2777, Springer, 2003. ISBN: 978-3-540-40720-1.

Danon L, Diaz-Guilera A, Duch J, Arenas A: Comparing community structure identification. J Stat Mech P09008, 2005.

van Dongen S: Performance criteria for graph clustering and Markov cluster experiments. Technical Report INS-R0012, National Research Institute for Mathematics and Computer Science in the Netherlands, Amsterdam, May 2000.

Rand WM: Objective criteria for the evaluation of clustering methods. J Am Stat Assoc 66(336):846-850, 1971.

Hubert L and Arabie P: Comparing partitions. Journal of Classification 2:193-218, 1985.

作者

Tamas Nepusz ntamas@gmail.com

示例


g <- make_graph("Zachary")
sg <- cluster_spinglass(g)
le <- cluster_leading_eigen(g)
compare(sg, le, method = "rand")
#> [1] 0.9500891
compare(membership(sg), membership(le))
#> [1] 0.2765712