Specify the Algorithm and Workflow

Learn how to use the parsnip package to specify machine learning algorithms and workflows.

Configuring the algorithm

With the training data prepared, the next step in the tidymodels workflow is to specify the machine learning algorithm. At this workflow stage, hyperparameter values can be set. However, this lesson uses the algorithm’s default hyperparameter values.

Specifying algorithms is accomplished using the parsnip package. The parsnip package supports many algorithms, including decision trees. The following code uses the decision_tree() function to configure the workflow for the algorithm:

Get hands-on with 1200+ tech skills courses.