extract_inner_model: Get the inner model of a nested model object

View source: R/nested.R

extract_inner_modelR Documentation

Get the inner model of a nested model object

Description

Extract the inner model of a nested_model object, or a workflow containing a nested model.

Usage

extract_inner_model(x, ...)

## Default S3 method:
extract_inner_model(x, ...)

## S3 method for class 'nested_model'
extract_inner_model(x, ...)

## S3 method for class 'workflow'
extract_inner_model(x, ...)

## S3 method for class 'model_spec'
extract_inner_model(x, ...)

Arguments

x

A model spec or workflow.

...

Not used.

Value

A model_spec object

Examples


library(parsnip)

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

extract_inner_model(model)


nestedmodels documentation built on Sept. 30, 2023, 5:06 p.m.