
Preference Order Argument in collinear()
Source:R/preference_order_collinear.R
preference_order_collinear.RdInternal function to manage the argument preference_order in collinear().
Usage
preference_order_collinear(
df = NULL,
response = NULL,
predictors = NULL,
preference_order = NULL,
f = NULL,
quiet = FALSE
)Arguments
- df
(required; data frame, tibble, or sf) A data frame with responses and predictors. Default: NULL.
- response
(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.- predictors
(optional; character vector) Names of the predictors to select from
df. If omitted, all numeric columns indfare used instead. If argumentresponseis not provided, non-numeric variables are ignored. Default: NULL- preference_order
(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
responseis not NULL, callspreference_order()for internal computation.character vector: predictor names in a custom preference order.
data frame: output of
preference_order()fromresponseof length one.named list: output of
preference_order()fromresponseof length two or more.NULL: disabled.
. Default: "auto"
- f
(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(): ifresponseis binomial.f_r2_pearson(): ifresponseandpredictorsare numeric.f_v(): ifresponseandpredictorsare categorical.f_v_rf_categorical(): ifresponseis categorical andpredictorsare numeric or mixed .f_r2_rf(): in all other cases.
Default: NULL
- quiet
(optional; logical) If FALSE, messages generated during the execution of the function are printed to the console Default: FALSE
See also
Other preference_order_tools:
f_auto(),
f_auto_rules(),
f_functions()