View source: R/generate_from_factor.R
compute_probability_ratio | R Documentation |
Probability ratio is an aggregation function that can be used for
build_target_encoding
. Probability ratio is the P(most freq element) / (1 - P(most frq element)).
compute_probability_ratio(x)
x |
A |
To be more generic, the library compute P(most freq element) inplace of traditional formula P(1)/P(0)
P(most freq element) / (1 - P(most frq element))
# Build example list
example_list <- c(1, 1, 1, 2, 2, 3)
# Compute probability ratio
compute_probability_ratio(example_list)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.