Learn R Programming

msu (version 0.0.1)

symmetrical_uncertainty: Estimating Symmetrical Uncertainty of two categorical variables.

Description

Symmetrical uncertainty (SU) is the product of a normalization of the information gain (IG) with respect to entropy. SU(X,Y) is a value in the range [0,1], where \(SU(X,Y) = 0\) if X and Y are totally independent and \(SU(X,Y) = 1\) if X and Y are totally dependent.

Usage

symmetrical_uncertainty(x, y)

SU(x, y)

Arguments

x

A factor as the represented categorical variable.

y

A factor as the represented categorical variable.

Value

Symmetrical uncertainty estimation based on Sannon entropy. The result is rounded to 7 decimal places.

See Also

msu

Examples

Run this code
# NOT RUN {
# completely predictable
symmetrical_uncertainty(factor(c(0,1,0,1)), factor(c(0,1,0,1)))
# XOR factor variables
symmetrical_uncertainty(factor(c(0,0,1,1)), factor(c(0,1,1,0)))
symmetrical_uncertainty(factor(c(0,1,0,1)), factor(c(0,1,1,0)))
# }
# NOT RUN {
symmetrical_uncertainty(c(0,1,0,1), c(0,1,1,0))
# }

Run the code above in your browser using DataLab