Package 'NMI'

Title: Normalized Mutual Information of Community Structure in Network
Description: Calculates the normalized mutual information (NMI) of two community structures in network analysis.
Authors: Tianhao Wu [aut, cre]
Maintainer: Tianhao Wu <[email protected]>
License: GNU General Public License version 2
Version: 2.0
Built: 2024-09-13 07:52:30 UTC
Source: CRAN

Help Index


Normalized Mutual Information of Community Structure in Network

Description

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

Usage

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

# 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)