knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of supprecipe is to supplement the recipe, especially in feature engineering.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("yzhizai/supprecipe")
This is a basic example which shows you how to solve a common problem:
library(tidymodels) library(supprecipe) ## basic example code data(cells) cells <- select(cells, -case) names(cells)[1] <- 'Label' # when use your own data, make sure the first column is your target label, and named it with 'Label' a.rec <- recipe(Label~., data = cells) %>% step_zv(all_predictors()) %>% step_normalize(all_predictors()) %>% step_anova(all_predictors(), skip = T) %>% step_mrmr(all_predictors(), skip = T) a.mod <- rand_forest() %>% set_engine('randomForest') %>% set_mode('classification') a.wflow <- workflow() %>% add_recipe(a.rec) %>% add_model(a.mod) a.model <- fit(a.wflow, data = cells) predict(a.model, new_data = cells)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.