View source: R/information_gain.R
| information_gain | R Documentation |
Information gain (also called mutual information) is a measure of the mutual dependence between two variables (see https://en.wikipedia.org/wiki/Mutual_information).
information_gain(x, y)
IG(x, y)
x |
A factor representing a categorical variable. |
y |
A factor representing a categorical variable. |
Information gain estimation based on Sannon entropy for
variables x and y. The result is rounded to
7 decimal places.
information_gain(factor(c(0,1)), factor(c(1,0)))
information_gain(factor(c(0,0,1,1)), factor(c(0,1,1,1)))
information_gain(factor(c(0,0,1,1)), factor(c(0,1,0,1)))
## Not run:
information_gain(c(0,1), c(1,0))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.