File: compare.Rd

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (94 lines) | stat: -rw-r--r-- 3,291 bytes parent folder | download
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/community.R
\name{compare}
\alias{compare}
\alias{compare.communities}
\alias{compare.membership}
\title{Compares community structures using various metrics}
\usage{
compare(
  comm1,
  comm2,
  method = c("vi", "nmi", "split.join", "rand", "adjusted.rand")
)
}
\arguments{
\item{comm1}{A \code{\link[=communities]{communities()}} object containing a community
structure; or a numeric vector, the membership vector of the first community
structure. The membership vector should contain the community id of each
vertex, the numbering of the communities starts with one.}

\item{comm2}{A \code{\link[=communities]{communities()}} object containing a community
structure; or a numeric vector, the membership vector of the second
community structure, in the same format as for the previous argument.}

\item{method}{Character scalar, the comparison method to use. Possible
values: \sQuote{vi} is the variation of information (VI) metric of Meila
(2003), \sQuote{nmi} is the normalized mutual information measure proposed
by Danon et al. (2005), \sQuote{split.join} is the split-join distance of
can Dongen (2000), \sQuote{rand} is the Rand index of Rand (1971),
\sQuote{adjusted.rand} is the adjusted Rand index by Hubert and Arabie
(1985).}
}
\value{
A real number.
}
\description{
This function assesses the distance between two community structures.
}
\examples{

g <- make_graph("Zachary")
sg <- cluster_spinglass(g)
le <- cluster_leading_eigen(g)
compare(sg, le, method = "rand")
compare(membership(sg), membership(le))

}
\references{
Meila M: Comparing clusterings by the variation of information.
In: Scholkopf B, Warmuth MK (eds.). \emph{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. \emph{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.
\emph{J Am Stat Assoc} 66(336):846-850, 1971.

Hubert L and Arabie P: Comparing partitions. \emph{Journal of
Classification} 2:193-218, 1985.
}
\seealso{
Community detection
\code{\link{as_membership}()},
\code{\link{cluster_edge_betweenness}()},
\code{\link{cluster_fast_greedy}()},
\code{\link{cluster_fluid_communities}()},
\code{\link{cluster_infomap}()},
\code{\link{cluster_label_prop}()},
\code{\link{cluster_leading_eigen}()},
\code{\link{cluster_leiden}()},
\code{\link{cluster_louvain}()},
\code{\link{cluster_optimal}()},
\code{\link{cluster_spinglass}()},
\code{\link{cluster_walktrap}()},
\code{\link{groups}()},
\code{\link{make_clusters}()},
\code{\link{membership}()},
\code{\link{modularity.igraph}()},
\code{\link{plot_dendrogram}()},
\code{\link{split_join_distance}()},
\code{\link{voronoi_cells}()}
}
\author{
Tamas Nepusz \email{ntamas@gmail.com}
}
\concept{community}
\keyword{graphs}