NMI: Normalized Mutual Information of Community Structure in...

Description Usage Arguments Value Examples

View source: R/NMI.R

Description

Calculates the normalized mutual information (NMI) of two community structures in network analysis.

Usage

1
NMI(X,Y)

Arguments

X

a data frame or matrix whose first column is the node id and the second column is module

Y

a data frame or matrix whose first column is the node id and the second column is module

Value

value

value of NMI

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Suppose X and Y are exactly the same
X<-data.frame(c(1,2,3),c(2,1,1))
Y<-X
# There NMI is 1
NMI(X,Y)

# Suppose X and Y are completely independent
X<-data.frame(c(1,2,3),c(2,1,1))
Y<-data.frame(c(5,6,7),c(2,1,1))
# There NMI is 0
NMI(X,Y)

Example output

$value
[1] 1

$value
[1] 0

NMI documentation built on May 1, 2019, 7:43 p.m.

Related to NMI in NMI...