Learn R Programming

butcher (version 0.3.5)

axe-model_fit: Axing an model_fit.

Description

model_fit objects are created from the parsnip package.

Usage

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

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

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

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

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

Value

Axed model_fit 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.

...

Any additional arguments related to axing.

Examples

Run this code
library(parsnip)
library(rpart)

# Create model and fit
lm_fit <- linear_reg() %>%
  set_engine("lm") %>%
  fit(mpg ~ ., data = mtcars)

out <- butcher(lm_fit, verbose = TRUE)

# Another parsnip model
rpart_fit <- decision_tree(mode = "regression") %>%
  set_engine("rpart") %>%
  fit(mpg ~ ., data = mtcars, minsplit = 5, cp = 0.1)

out <- butcher(rpart_fit, verbose = TRUE)

Run the code above in your browser using DataLab