Description Usage Arguments Value See Also
View source: R/ml_mean_target_encoder.R
This function convert input columns to mean target encoding columns, inspired from https://www.kaggle.com/ogrellier/python-target-encoding-for-categorical-features
1 2 3 4 5 6 7 8 9 10 | ml_mean_target_encoder(
mean_target_colnames,
target_colname,
training_data,
test_data = NULL,
fold = NULL,
min_samples_leaf = 0,
smoothing = 1,
impute_missing = T
)
|
mean_target_colnames |
list of column names that needs mean target encoding |
target_colname |
target column name, should be numeric column |
training_data |
dataset we used to build mean targeting table |
test_data |
dataset we used to apply mean target encoding |
fold |
list of fold index for training dataset, suggest to use caret::createFolds |
min_samples_leaf |
minimum quantity per column value we consider needs to be calculate mean. |
smoothing |
used to control rate of transition between the particular column level’s posterior probability and the grand target mean, default is set to 1 to ignore this effect |
impute_missing |
determine if we want to impute missing when new dataste levels could not be found in mapping table, defualt is to impute |
a list that contains datasets that haven been applied mean target encoding and also a mapping table named calculate_columns_mean_table to use for ml_mean_target_apply function ta apply mean targeting encoding on new dataset
ml+mean_target_apply
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.