# Chapter 7. A Model Workflow

In ChapterÂ 6, we discussed the parsnip package, which can be used to define and fit the model. This chapter introduces a new concept called a model workflow. The purpose of this concept (and the corresponding tidymodels `workflow()` object) is to encapsulate the major pieces of the modeling process (discussed in ChapterÂ 1). The workflow is important in two ways. First, using a workflow concept encourages good methodology since it is a single point of entry to the estimation components of a data analysis. Second, it enables the user to better organize projects. These two points are discussed in the following sections.

# Where Does the Model Begin and End?

So far, when we have used the term âthe model,â we have meant a structural equation that relates some predictors to one or more outcomes. Letâs consider again linear regression as an example. The outcome data are denoted as \$y_i\$, where there are $i equals 1 ellipsis n$ samples in the training set. Suppose that there are $p$ predictors $x Subscript i Baseline 1 Baseline comma ellipsis comma x Subscript i p Baseline$ that are used in the model. Linear regression produces the following model equation:

${\stackrel{^}{y}}_{i}={\stackrel{^}{\mathrm{Î²}}}_{0}+{\stackrel{^}{\mathrm{Î²}}}_{1}{x}_{i1}+...+{\stackrel{^}{\mathrm{Î²}}}_{p}{x}_{ip}$

While this is a linear model, it is linear only in the parameters. The predictors could be nonlinear terms (such as the $log left-parenthesis x Subscript i Baseline right-parenthesis$).

###### Warning

The conventional way of thinking about the modeling process is that it only includes the model fit.

For some straightforward data sets, fitting the model itself ...

Get Tidy Modeling with R now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.