add_white_noise {collinear} | R Documentation |
Add White Noise to Encoded Predictor
Description
Internal function to add white noise to a encoded predictor to reduce the risk of overfitting when used in a model along with the response.
Usage
add_white_noise(
df = NULL,
response = NULL,
predictor = NULL,
white_noise = 0,
seed = 1
)
Arguments
df |
(required; data frame, tibble, or sf) A data frame with responses and predictors. Default: NULL. |
response |
(optional, character string) Name of a numeric response variable in |
predictor |
(required, string) Name of a target-encoded predictor. Default: NULL |
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: |
seed |
(optional; integer vector) Random seed to facilitate reproducibility when |
Value
data frame
See Also
Other target_encoding_tools:
encoded_predictor_name()