Skip to content

Resample Fails with Parnsip Fit Model that uses Inline Functions #7

@mdancho84

Description

@mdancho84

Full Example: https://github.com/wtmoreland3/reprex/blob/3915d45d424135d8ca27c8c607ffc9da70aa89bf/modeltime_resample_error

Models that have inline functions fail. Example:

model_fit_lm <- linear_reg() %>%
    set_engine("lm") %>%
    fit(
        value ~ as.numeric(date) + month(date, label = TRUE), 
        data = training(splits)
    )

Causes this error:

## > model_tbl_tuned_resamples <- submodels_tbl %>%
## +     slice(c(5)) %>%
## +     modeltime_fit_resamples(
## +         resamples = resamples_tscv,
## +         control   = control_resamples(verbose = TRUE, allow_par = TRUE)
## +     )
## -- Fitting Resamples --------------------------------------------
## 
## * Model ID: 5 LM
## Error: No in-line functions should be used here; use steps to define baking actions.
## 0.03 sec elapsed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions