Skip to contents

Shannon entropy (Geron Eq 5-3, morie.fn grent)

Usage

morie_geron_shannon_entropy(y, base = 2)

Arguments

y

Class label vector.

base

Log base greater than 1.

Value

List with entropy, proportions, classes, counts, max_possible.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_shannon_entropy(V)
#> $entropy
#> [1] 3
#> 
#> $proportions
#> [1] 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125
#> 
#> $classes
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $counts
#> [1] 1 1 1 1 1 1 1 1
#> 
#> $max_possible
#> [1] 3
#> 
#> $base
#> [1] 2
#> 
#> $estimate
#> [1] 3
#> 
#> $n
#> [1] 8
#>