compute_weight_of_evidence {dataPreparation}R Documentation

Compute weight of evidence

Description

Weight of evidence is an aggregation function that can be used for build_target_encoding. Weight of evidence is the ln(P(most freq element) / (1 - P(most frq element))).

Usage

compute_weight_of_evidence(x)

Arguments

x

A list of categorical elements

Details

To be more generic, the library compute P(most freq element) inplace of traditional formula ln(P(1)/P(0))

Value

Weight of evidence

Examples

# Build example list
example_list <- c(1, 1, 1, 2, 2, 3)

# Compute weight of evidence
compute_weight_of_evidence(example_list)

[Package dataPreparation version 1.1.1 Index]