H: Compute the entropy of a discrete sample

View source: R/tools_misc.R

HR Documentation

Compute the entropy of a discrete sample

Description

Compute the entropy of a discrete sample

Usage

H(cl)

Arguments

cl

vector of discrete labels

Value

the entropy of the sample

Examples

cl <- sample(2, 500, replace = TRUE)
H(cl)

comeetie/greed documentation built on Oct. 10, 2022, 5:37 p.m.