fit_rsample_nested: Fit models using nested split and recipe

Description Usage Arguments Details

View source: R/rsample_utils.R

Description

This function makes it easy to fit a model using a nested split and a recipe object. A nested split is one created with rolling_origin_nested, where each split is nested by a time variable.

Usage

1
2
3
4
5
6
7
fit_rsample_nested(
  split = NULL,
  recipe,
  model_func,
  strings_as_factors = FALSE,
  ...
)

Arguments

split

An rsplit object created with rolling_origin_nested. If recipe is trained with prep(..., retain = TRUE), this argument is not needed and will not be used.

recipe

A trained or untrained recipe object. If not trained, split must be included.

model_func

A model function (ex: lm or glm). Must include arguments formula and data.

strings_as_factors

A logical: should character columns be converted to factors? This affects the preprocessed training set (when retain = TRUE) as well as the results of bake.recipe. Unlike prep(), the default is FALSE.

...

Other arguments passed to model_func.

Details

If ... does not include formula, the formula will be extracted from recipe using formula(recipe).


gacolitti/tidyroll documentation built on Sept. 13, 2020, 8 p.m.