我创建了以下逻辑回归工作流程:
# Set up the recipe
lr_mod <- logistic_reg() %>%
set_engine("glm")
# Set up the recipe
lr_mod_recipe <- recipe(Conversion ~ Jaar + Aantal + Verzekering + Leeftijd + Retentie +
Aantal_proeven + Geslacht + FLG_ADVERTISING + FLG_MAIL +
FLG_PHONE + FLG_EMAIL + Topsegment + Max_Loss + Regio +
Month + Weeks_split + AC,
data = Data_train)
# Create a workflow
lr_mod_workflow <-
workflow() %>%
add_model(lr_mod) %>%
add_recipe(lr_mod_recipe)
# Fit the workflow to the data
lr_fit <-
lr_mod_workflow %>%
fit(data = Data_train)
以下代码确实为我提供了模型的摘要:
lr_fit$fit$fit
但是,这不是可以导出的良好表格格式。如何从我的模型中检索摘要模型,以便我可以很好地格式化为 word 或 excel?