1 - Introduction

Introduction to tidymodels


Wi-Fi network name

Posit Conf 2023

Wi-Fi password


Workshop policies

  • Please do not photograph people wearing red lanyards

  • There are gender-neutral bathrooms located are among the Grand Suite Bathrooms

  • There are two meditation/prayer rooms: Grand Suite 2A and 2B

  • A lactation room is located in Grand Suite 1

  • The meditation/prayer and lactation rooms are open
    Sun - Tue 7:30am - 7:00pm, Wed 8:00am - 6:00pm

Workshop policies

  • Please review the code of conduct and COVID policies, which apply to all workshops: https://posit.co/code-of-conduct/.

  • CoC site has info on how to report a problem (in person, email, phone)

Who are you?

  • You can use the magrittr %>% or base R |> pipe

  • You are familiar with functions from dplyr, tidyr, ggplot2

  • You have exposure to basic statistical concepts

  • You do not need intermediate or expert familiarity with modeling or ML

Who are tidymodels?

  • Simon Couch
  • Hannah Frick
  • Emil Hvitfeldt
  • Max Kuhn

Silvia CanelΓ³n is TAing today!

Many thanks to Davis Vaughan, Julia Silge, David Robinson, Julie Jung, Alison Hill, and DesirΓ©e De Leon for their role in creating these materials!

Asking for help

πŸŸͺ β€œI’m stuck and need help!”

🟩 β€œI finished the exercise”


Plan for this workshop

  • Your data budget
  • What makes a model
  • Evaluating models
  • Tuning models

Introduce yourself to your neighbors πŸ‘‹

Log in to Posit Cloud (free):

Check the workshop channel on Discord for the link!

What is machine learning?

What is machine learning?

What is machine learning?

Your turn

How are statistics and machine learning related?

How are they similar? Different?


What is tidymodels?

#> ── Attaching packages ──────────────────────────── tidymodels 1.1.1 ──
#> βœ” broom        1.0.5     βœ” rsample      1.2.0
#> βœ” dials        1.2.0     βœ” tibble       3.2.1
#> βœ” dplyr        1.1.3     βœ” tidyr        1.3.0
#> βœ” infer        1.0.5     βœ” tune         1.1.2
#> βœ” modeldata    1.2.0     βœ” workflows    1.1.3
#> βœ” parsnip      1.1.1     βœ” workflowsets 1.0.1
#> βœ” purrr        1.0.2     βœ” yardstick    1.2.0
#> βœ” recipes      1.0.8
#> ── Conflicts ─────────────────────────────── tidymodels_conflicts() ──
#> βœ– purrr::discard() masks scales::discard()
#> βœ– dplyr::filter()  masks stats::filter()
#> βœ– dplyr::lag()     masks stats::lag()
#> βœ– recipes::step()  masks stats::step()
#> β€’ Use tidymodels_prefer() to resolve common conflicts.

The whole game

  • Roadmap for today
  • Minimal version of predictive modeling process
  • Feature engineering and tuning as iterative extensions

The whole game

The whole game

The whole game

The whole game

The whole game

The whole game

The whole game

Let’s install some packages

If you are using your own laptop instead of Posit Cloud:

# Install the packages for the workshop
pkgs <- 
  c("bonsai", "doParallel", "embed", "finetune", "lightgbm", "lme4",
    "plumber", "probably", "ranger", "rpart", "rpart.plot", "rules",
    "splines2", "stacks", "text2vec", "textrecipes", "tidymodels", 
    "vetiver", "remotes")


Or log in to Posit Cloud

Link in our Discord channel!

Our versions

R version 4.2.2 (2022-10-31), Quarto (1.4.104)

package version
bonsai 0.2.1
broom 1.0.5
dials 1.2.0
doParallel 1.0.17
dplyr 1.1.3
embed 1.1.2
finetune 1.1.0
ggplot2 3.4.3
lightgbm 3.3.5
package version
lme4 1.1-34
modeldata 1.2.0
parsnip 1.1.1
plumber 1.2.1
probably 1.0.2
purrr 1.0.2
ranger 0.15.1
recipes 1.0.8
package version
rpart 4.1.19
rpart.plot 3.1.1
rsample 1.2.0
rules 1.0.2
scales 1.2.1
splines2 0.5.1
stacks 1.0.2
text2vec 0.6.3
textrecipes 1.0.4
package version
tibble 3.2.1
tidymodels 1.1.1
tidyr 1.3.0
tune 1.1.2
vetiver 0.2.4
workflows 1.1.3
workflowsets 1.0.1
yardstick 1.2.0