View source: R/guard_to_recipe.R
| guard_to_recipe | R Documentation |
Maps bioLeak guard preprocessing steps (impute, normalize, filter, fs) to their closest recipes equivalents. Requires the recipes package. Steps that have no direct recipe equivalent are skipped with a warning.
guard_to_recipe(steps, formula, training_data)
steps |
A named list of guard preprocessing steps, e.g.,
|
formula |
A model formula (e.g., |
training_data |
A data.frame used to initialize the recipe. |
Mapping:
impute$method = "median": step_impute_median(all_numeric_predictors())
impute$method = "knn": step_impute_knn(all_predictors(), neighbors = k)
impute$method = "missForest" or "mice": Warning + step_impute_median() fallback
normalize$method = "zscore": step_normalize(all_numeric_predictors())
normalize$method = "robust": Warning + step_normalize() fallback
normalize$method = "none": No step added
filter$var_thresh > 0: step_nzv(all_numeric_predictors())
fs$method = "pca": step_pca(all_numeric_predictors(), num_comp = ncomp)
fs$method = "ttest" or "lasso": Warning, skipped (no recipe equivalent)
A recipes::recipe object with the mapped steps added.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.