Examples of preprocess functions that can be used in cross_validate_fn() and validate_fn(). They can either be used directly or be starting points.
The examples use recipes, but you can also use caret::preProcess() or similar functions.
In these examples, the preprocessing will only affect the numeric predictors.
You may prefer to hardcode a formula like "y ~ ." (where y is your dependent variable) as that will allow you to set preprocess_one to TRUE in cross_validate_fn()
and validate_fn() and save time.
preprocess_functions(name)
Arguments
name: Name of preprocessing function as it appears in the following list:
Name
Description
"standardize"
Centers and scales the numeric predictors
"range"
Normalizes the numeric predictors to the 0-1 range
"scale"
Scales the numeric predictors to have a standard deviation of one
"center"
Centers the numeric predictors to have a mean of zero
"warn"
Identity function that throws a warning and a message