entropy {integr}R Documentation

Calculates Shannon's entropy

Description

Formula: H(S) = -P_i * \sum log_2 * P_i, where P_i is the probability of the corresponding i-th class

Usage

entropy(df, classAtt)

Arguments

df

A discrete data.frame

classAtt

A class column of the df (string)

Value

The Shannon's entropy of the df, based on the classAtt attribute

Examples

entropy(golf, "Play")

[Package integr version 1.0.0 Index]