当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


R stacks axe_model_stack 砍掉 model_stack。


砍掉model_stack。

删除调用。

删除用于训练的控件。

删除训练数据。

删除环境。

删除拟合值。

用法

# S3 method for model_stack
axe_call(x, verbose = FALSE, ...)

# S3 method for model_stack
axe_ctrl(x, verbose = FALSE, ...)

# S3 method for model_stack
axe_data(x, verbose = FALSE, ...)

# S3 method for model_stack
axe_env(x, verbose = FALSE, ...)

# S3 method for model_stack
axe_fitted(x, verbose = FALSE, ...)

参数

x

模型对象

verbose

每次执行 ax 方法时打印信息。记录释放了多少内存以及禁用了哪些函数。默认为 FALSE

...

附加参数。目前被忽略。

砍掉model_stack对象。

例子


# build a regression model stack
st <-
  stacks() %>%
  add_candidates(reg_res_lr) %>%
  add_candidates(reg_res_sp) %>%
  blend_predictions() %>%
  fit_members()
  
# remove any of the "butcherable"
# elements individually
axe_call(st)
#> ── A stacked ensemble model ─────────────────────────────────────
#> 
#> Print methods for butchered model stacks are disabled.
axe_ctrl(st)
#> ── A stacked ensemble model ─────────────────────────────────────
#> 
#> Print methods for butchered model stacks are disabled.
axe_data(st)
#> ── A stacked ensemble model ─────────────────────────────────────
#> 
#> Print methods for butchered model stacks are disabled.
axe_fitted(st)
#> ── A stacked ensemble model ─────────────────────────────────────
#> 
#> Print methods for butchered model stacks are disabled.
axe_env(st)
#> ── A stacked ensemble model ─────────────────────────────────────
#> 
#> Print methods for butchered model stacks are disabled.

# or do it all at once!
butchered_st <- butcher(st, verbose = TRUE)
#> ✔ Memory released: "158.32 kB"
#> ✖ Disabled: `print()` and `summary()`

format(object.size(st))
#> [1] "2490296 bytes"
format(object.size(butchered_st))
#> [1] "1576824 bytes"
源代码:R/butcher.R

相关用法


注:本文由纯净天空筛选整理自Max Kuhn等大神的英文原创作品 Axing a model_stack.。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。