factor_add | R Documentation |
Adds the predictor to the list of predictors. These will be used in model formula when model_fit
is called.
factor_add(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 added. 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') ) print(setup) # not fitted yet modeling <- setup %>% factor_add(pol_yr) %>% factor_add(agecat) print(modeling)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.