Internal function to manage the argument preference_order in collinear().
preference_order_collinear(
df = NULL,
response = NULL,
predictors = NULL,
preference_order = NULL,
f = NULL,
quiet = FALSE
)character vector or NULL
(required; data frame, tibble, or sf) A data frame with responses and predictors. Default: NULL.
(optional; character string or vector) Name/s of response variable/s in df. Used in target encoding when it names a numeric variable and there are categorical predictors, and to compute preference order. Default: NULL.
(optional; character vector) Names of the predictors to select from df. If omitted, all numeric columns in df are used instead. If argument response is not provided, non-numeric variables are ignored. Default: NULL
(optional; string, character vector, output of preference_order()). Defines a priority order, from first to last, to preserve predictors during the selection process. Accepted inputs are:
"auto" (default): if response is not NULL, calls preference_order() for internal computation.
character vector: predictor names in a custom preference order.
data frame: output of preference_order() from response of length one.
named list: output of preference_order() from response of length two or more.
NULL: disabled.
. Default: "auto"
(optional: function) Function to compute preference order. If "auto" (default) or NULL, the output of f_auto() for the given data is used:
f_auc_rf(): if response is binomial.
f_r2_pearson(): if response and predictors are numeric.
f_v(): if response and predictors are categorical.
f_v_rf_categorical(): if response is categorical and predictors are numeric or mixed .
f_r2_rf(): in all other cases.
Default: NULL
(optional; logical) If FALSE, messages generated during the execution of the function are printed to the console Default: FALSE
Other preference_order_tools:
f_auto(),
f_auto_rules(),
f_functions()