compute_weight_of_evidence {dataPreparation} | R Documentation |
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))).
compute_weight_of_evidence(x)
x |
A |
To be more generic, the library compute P(most freq element) inplace of traditional formula ln(P(1)/P(0))
Weight of evidence
# Build example list
example_list <- c(1, 1, 1, 2, 2, 3)
# Compute weight of evidence
compute_weight_of_evidence(example_list)