Name of Target-Encoded Predictor
Usage
encoded_predictor_name(
predictor = NULL,
encoding_method = "mean",
smoothing = 0,
white_noise = 0,
seed = 1
)
Arguments
- predictor
(required; string) Name of the categorical predictor to encode. Default: NULL
- encoding_method
(required, string) Name of the encoding method. One of: "mean", "rank", or "loo". Default: "mean"
- smoothing
(optional; integer) Groups smaller than this number have their means pulled towards the mean of the response across all cases. Ignored by
target_encoding_rank()
andtarget_encoding_loo()
. Default: 0- white_noise
(optional; numeric vector) Argument of the methods "mean", "rank", and "loo". Maximum white noise to add, expressed as a fraction of the range of the response variable. Range from 0 to 1. Default:
0
.- seed
(optional; integer vector) Random seed to facilitate reproducibility when
white_noise
is not 0. If NULL, the function selects one at random, and the selected seed does not appear in the encoded variable names. Default: 0
See also
Other target_encoding_tools:
add_white_noise()