Skip to contents

Extracts the fitted model object from each resample.

This function simplifies the process of extracting fit parameters from a model object created using the parsnip package. It is particularly useful in scenarios where model objects are embedded within resampled results.

Usage

extract_fit(x)

extract_fit(x)

Arguments

x

A model object, typically resulting from a resampling process (e.g., using fit_resamples from the rsample package).

Value

A list of extracted fitted model objects.

Returns the extracted fit parameters from the provided model object.

Examples

if (FALSE) {
  # Assuming 'resample_result' is predefined
  fitted_models <- extract_fit(resample_result)
}
if (FALSE) {
data(iris)
model <- linear_reg() |> set_engine("lm")
resamples <- vfold_cv(iris)
fit_results <- model |> fit_resamples(resamples)
extracted_params <- extract_fit(fit_results)
}