當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


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.。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。