entropy_2: Computes the entropy between two variables

View source: R/information_theory.R

entropy_2R Documentation

Computes the entropy between two variables

Description

It calculates the entropy between two categorical variables using log2. This log2 is mentioned in most of the Claude Shannon bibliography. Input/target can be numeric or character.

Usage

entropy_2(input, target)

Arguments

input

numeric/character vector

target

numeric/character vector

Value

Entropy measured in bits

Examples

## Not run: 
# Measuring entropy between input and target variable
entropy_2(input=data_golf$outlook, target=data_golf$play_golf)

## End(Not run)

pablo14/funModeling documentation built on July 30, 2023, 10:59 a.m.