View source: R/factor_remove.R
| factor_remove | R Documentation |
Removes the predictor from the list of predictors. These will be used in model formula when model_fit is called.
factor_remove(setup, var_symbol)
setup |
Setup object. Created at the start of the workflow. Usually piped in from previous step. |
var_symbol |
Unquoted symbol. Predictor to be removed. Must be present in the modeling dataset. |
Setup object with updated attributes.
require(dplyr) # for the pipe operator
data('sev_train')
setup <- setup(
data_train = sev_train,
target = 'sev',
weight = 'numclaims',
family = 'gamma',
keep_cols = c('pol_nbr', 'exposure', 'premium')
)
modeling <- setup %>%
factor_add(pol_yr) %>%
factor_add(agecat) %>%
model_fit() %>%
factor_remove(agecat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.