Learn R Programming

workflows (version 0.2.0)

workflows-internals: Internal workflow functions

Description

.fit_pre() and .fit_model() are internal workflow functions for partially fitting a workflow object. They are only exported for usage by the tuning package, tune, and the general user should never need to worry about them.

Usage

.fit_pre(workflow, data)

.fit_model(workflow, control)

Arguments

workflow

A workflow

For .fit_pre(), this should be a fresh workflow.

For .fit_model(), this should be a workflow that has already been trained through .fit_pre().

data

A data frame of predictors and outcomes to use when fitting the workflow

control

Examples

Run this code
# NOT RUN {
library(parsnip)
library(recipes)
library(magrittr)

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

unfit_wf <- workflow() %>%
  add_model(model) %>%
  add_formula(mpg ~ cyl + log(disp))

partially_fit_wf <- .fit_pre(unfit_wf, mtcars)
fit_workflow <- .fit_model(partially_fit_wf, control_workflow())
# }

Run the code above in your browser using DataLab