recipeselectors | R Documentation |
recipeselectors provides a collection of additional step objects related to feature selection to be used with the 'recipes' package.
Steven Pawley, dr.stevenpawley@gmail.com
library(parsnip) library(recipes) library(magrittr) # load the example iris dataset data(iris) # define a base model to use for feature importances base_model <- rand_forest(mode = "classification") %>% set_engine("ranger", importance = "permutation") # create a preprocessing recipe rec <- iris %>% recipe(Species ~ .) %>% step_select_vip(all_predictors(), model = base_model, top_p = 2, outcome = "Species") prepped <- prep(rec) # create a model specification clf <- decision_tree(mode = "classification") %>% set_engine("rpart") clf_fitted <- clf %>% fit(Species ~ ., juice(prepped))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.