Modeling with tidymodels in R: An Interactive Course
tidymodels is the modern, consistent way to build models in R: one grammar that carries you from raw columns to a tuned, compared, trustworthy model. This seven-lesson interactive course teaches the whole pipeline from the ground up, one package at a time, with live models you drive in the browser.
Fitting a model in R used to mean learning a different argument order and a different prediction call for every algorithm. tidymodels replaces that with a single, predictable workflow: a recipe to prepare your data, parsnip to declare the model, workflows to bundle them, rsample to resample honestly, yardstick to score, and tune to search for the settings that work best.
Most tutorials stop at "here is how to call one function." This course builds the mental model behind the framework, so when you face new data you know which piece to reach for and why. The thread running through it is a single, leak-free pipeline you can trust on data the model has never seen.
Each lesson is a guided, interactive experience: you run live R in the browser, answer checkpoints, and write code as you go.
The seven lessons
Lesson 1: Preprocess with recipes
Raw columns are rarely model-ready: scales differ, categories are text, values go missing. Build a recipe that declares the fixes, learn the numbers from your training set with prep(), and apply them to any data with bake(). The core idea is preprocessing that learns only on training data, so no information leaks from the test set.
Start Lesson 1: Preprocess with recipes
Lesson 2: Define Models with parsnip
One syntax for every algorithm. Declare a model with parsnip, set its engine and mode, and switch from linear regression to random forest to boosting without relearning a new interface each time.
Start Lesson 2: Define models with parsnip
Lesson 3: Bundle Steps with workflows
Stop carrying a recipe and a model around as two separate objects. A workflow joins them into one thing you fit once and predict from once, so preprocessing and modeling can never drift out of sync.
Start Lesson 3: Bundle steps with workflows
Lesson 4: Resample with rsample
A single train/test split gives you one noisy estimate of performance. Use rsample to build cross-validation folds and bootstraps, so your score reflects how the model behaves across many splits, not just a lucky one.
Start Lesson 4: Resample with rsample
Lesson 5: Measure with yardstick
Pick the metric that matches the decision. Use yardstick to compute RMSE, accuracy, ROC AUC and the rest consistently, and read what each one is really telling you about the model.
Start Lesson 5: Measure with yardstick
Lesson 6: Tune with the tune package
Most models have a few settings you cannot read off the data. Mark them with tune(), search a grid of candidates over your resamples, and let the results choose the values instead of guessing.
Start Lesson 6: Tune with the tune package
Lesson 7: Compare Many Models with workflowsets
Rarely is one recipe-and-model the obvious winner. Use workflowsets to fit many combinations at once, rank them on the same resamples, and choose with evidence instead of habit.
Start Lesson 7: Compare many models with workflowsets
Who this is for
You are comfortable running R and the |> pipe, and you know what a training and test set are. Having met a few models (linear regression, a tree, a random forest) helps you focus on the workflow rather than the algorithms, but the course explains each idea as it arrives. You do not need any prior tidymodels experience.
What you will be able to do
- Build a
recipethat learns preprocessing on training data only and applies it to new data without leakage - Declare any model with
parsnipand bundle it with its recipe into a singleworkflow - Resample with
rsampleand score withyardstickto estimate performance honestly - Tune the settings that matter and compare many models on equal footing with
workflowsets
Ready? Begin with Lesson 1.