Learn R Programming

RJcluster (version 3.2.4)

Mutual_Information: Mutual_Information

Description

Calculates normalized mutual information and adjusted mutual information. The value for both will be a value bewteen 0 and 1 that measures how close the classification between the two clusters is. A value closer to 1 means the labels are more similar across v1 and v2, and a value closer to 0 means the labels are not as similar.

Usage

Mutual_Information(v1, v2)

Arguments

v1

vector containing first classification labels

v2

vector containing second classification labels

Value

Returns mutual information:

nmi NMI value
ami AMI value

Details

See these links for a more formal definition of AMI and NMI.

Examples

Run this code
# NOT RUN {
cluster1 <- sample(1:5, size = 10, replace = TRUE)
cluster2 <- sample(1:2, size = 10, replace = TRUE)
Mutual_Information(cluster1, cluster2)
# }

Run the code above in your browser using DataLab