model_export: Export the current insuRglm model

View source: R/model_export.R

model_exportR Documentation

Export the current insuRglm model

Description

Exports the current model into xlsx file. The excel spreadsheet will contain the charts, as well as relativities and weights for each predictor included in the current (last) model.

Usage

model_export(setup, xlsx_file, overwrite = FALSE)

Arguments

setup

Setup object. Created at the start of the workflow. Usually piped in from previous step.

xlsx_file

Character scalar. Path and name of the file to store the exported model.

overwrite

Boolean scalar. Whether to overwrite an existing file.

Value

NULL, this function has only side effects.

Examples

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()

modeling %>%
  model_export('export_test.xlsx', overwrite = TRUE)


realgabon/insuRglm documentation built on Jan. 2, 2023, 2:51 a.m.