Description Usage Arguments Details Examples
Create impact encoder, that turns factor variables into integers. Where as the numeric encoder attributes arbitrary integers to the factor levels, the impact encoder produces ordered levels (with respect to the target).
1 | encode_impact(vars = categoricals, target)
|
vars |
Function or formula that returns selected columns from a data.frame. Alternatively, character vector of column names. |
target |
Name of the target variable. |
An approximate description of the algorithm is that the levels of the factors are ordered according to the mean value of the target for each level, but credibility is also taken into account. Under the hood, a model with random effects is used.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.