model_revert | R Documentation |
Reverts back to a specific saved insuRglm model within the setup (modeling) object.
model_revert(setup, to)
setup |
Setup object. Created at the start of the workflow. Usually piped in from previous step. |
to |
Character scalar. Name of the saved model that we wish to revert to. |
Setup object with updated attributes.
model_save
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() %>% model_save('model1') %>% factor_modify(agecat = variate(agecat, type = 'non_prop', mapping = c(1, 2, 3, 4, 5,6))) %>% model_fit() %>% model_revert(to = 'model1') # from now on the two lines above have no effect (but they stay documented)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.