axe-nested_model_fit: Axing a nested_model_fit.

axe-nested_model_fitR Documentation

Axing a nested_model_fit.

Description

nested_model_fit objects are created from the nestedmodels package, which allows parsnip models to be fitted on nested data. Axing a nested_model_fit object involves axing all the inner model_fit objects.

Usage

## S3 method for class 'nested_model_fit'
axe_call(x, verbose = FALSE, ...)

## S3 method for class 'nested_model_fit'
axe_ctrl(x, verbose = FALSE, ...)

## S3 method for class 'nested_model_fit'
axe_data(x, verbose = FALSE, ...)

## S3 method for class 'nested_model_fit'
axe_env(x, verbose = FALSE, ...)

## S3 method for class 'nested_model_fit'
axe_fitted(x, verbose = FALSE, ...)

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.

Value

Axed nested_model_fit object.

See Also

axe-model_fit

Examples



library(nestedmodels)
library(parsnip)

model <- linear_reg() %>%
  set_engine("lm") %>%
  nested()

nested_data <- tidyr::nest(example_nested_data, data = -id)

fit <- fit(model, z ~ x + y + a + b, nested_data)

# Reduce the model size
butcher(fit)


butcher documentation built on Aug. 23, 2023, 9:06 a.m.