Learn R Programming

stacks (version 1.0.0)

axe_model_stack: Axing a model_stack.

Description

Axing a model_stack.

Remove the call.

Remove controls used for training.

Remove the training data.

Remove environments.

Remove fitted values.

Usage

# 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, ...)

Value

Axed model_stack object.

Arguments

x

A model object

verbose

Print information each time an axe method is executed. Notes how much memory is released and what functions are disabled. Default is FALSE.

...

Additional arguments. Currently ignored.

Examples

Run this code
if (FALSE) { # rlang::is_installed("ranger") & rlang::is_installed("kernlab")

# \donttest{

# 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)
axe_ctrl(st)
axe_data(st)
axe_fitted(st)
axe_env(st)

# or do it all at once!
butchered_st <- butcher(st, verbose = TRUE)

format(object.size(st))
format(object.size(butchered_st))

# }
}

Run the code above in your browser using DataLab