Learn R Programming

workflows (version 0.1.1)

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)

model <- linear_reg()
model <- set_engine(model, "lm")

base_workflow <- workflow()
base_workflow <- add_model(base_workflow, model)

formula_workflow <- add_formula(base_workflow, mpg ~ cyl + log(disp))

partially_fit_workflow <- .fit_pre(formula_workflow, mtcars)
fit_workflow <- .fit_model(partially_fit_workflow, control_workflow())
# }

Run the code above in your browser using DataLab