Welcome

These are the materials for the Practical Machine Learning with tidymodels workshop. Learn how to successfully develop Machine Learning using R. tidymodels is a complete framework that implements modeling best practices using tidyverse principles. The tidymodels framework is a collection of packages for modeling and machine learning using tidyverse principles.

Led by Max Kuhn and Emil Hvitfeldt, this workshop will teach you core tidymodels packages to preprocess data, specify and train models, and optimize the tuning parameter. You’ll learn tidymodels syntax as well as the process of predictive modeling for tabular data. Time permitting, you’ll be introduced to basic pre-processing with recipes.

Is this workshop for me?

This workshop is for you if you:

  • are comfortable using tidyverse packages to read data into R, transform and reshape data, and make a variety of graphs, and
  • have some experience with modeling, such as linear regression, logistic regression, or tree-based models.

While the workshop will teach some terminology and modeling philosophy, it is primarily focused on showing users how to effectively develop, iterate, and validate a machine learning model.

Preparation

Please join the workshop with a computer that has the following installed (all available for free):

# Install the packages for the workshop
pkgs <-
  c(
    "almanac",
    "betacal",
    "bonsai",
    "brulee",
    "C50",
    "Cubist",
    "desirability2",
    "dimRed",
    "embed",
    "extrasteps",
    "finetune",
    "forested",
    "igraph",
    "important",
    "irlba",
    "kknn",
    "lightgbm",
    "lme4",
    "mirai",
    "parallelly",
    "plumber",
    "probably",
    "ranger",
    "RANN",
    "rpart",
    "rpart.plot",
    "RSpectra",
    "rules",
    "splines2",
    "stacks",
    "text2vec",
    "textrecipes",
    "tidymodels",
    "uwot",
    "vetiver"
  )

install.packages(pkgs)

Also, you should make sure that you have installed the newest version of a few packages. To check this, you can run the following code snippet. It will also prompt you to install the required versions if they are not already installed.

rlang::check_installed("tidymodels", version = "1.4.1")
rlang::check_installed("embed", version = "1.2.0")

If you’re a Windows user and encounter an error message during installation noting a missing Rtools installation, install Rtools using the installer linked here.

Slides

These slides are designed to use with live teaching and are published for workshop participants’ convenience. They are not meant as standalone learning materials. For that, we recommend tidymodels.org and Tidy Modeling with R.

Extra content (time permitting)

There’s also a page for slide annotations; these are extra notes for selected slides.

Code

Quarto files for working along are available on GitHub. (Don’t worry if you haven’t used Quarto before; it will feel familiar to R Markdown users.)

Past workshops

English

Spanish

Acknowledgments

This website, including the slides, is made with Quarto. Please submit an issue on the GitHub repo for this workshop if you find something that could be fixed or improved.

Reuse and licensing

Unless otherwise noted (i.e. not an original creation and reused from another source), these educational materials are licensed under Creative Commons Attribution CC BY-SA 4.0.