Machine Learning with R
tidymodels, caret and practical modelling for analysts.
Taught by Niraj Thapa · Analytics Lead
What you'll learn
- Set up R with tidymodels and explain how its packages fit together
- Clean and reshape data with dplyr and tidyr and write preprocessing recipes
- Fit and interpret linear and random forest regression models with parsnip
- Build logistic regression and tree-based classifiers and read their confusion matrices
- Use cross-validation and grid tuning to pick hyperparameters honestly
- Produce a reproducible Quarto report that documents model performance
About this course
This machine learning with R course is for analysts, researchers and students who already use R for data work and want to build predictive models without switching languages. You will learn the tidymodels workflow from the ground up: preparing data with the tidyverse, creating recipes for preprocessing, fitting regression and classification models with parsnip, resampling and tuning with rsample and tune, and reporting results with Quarto. Along the way you will see how the older caret package relates to tidymodels and when you might still meet it. Every lesson works on real tabular datasets that ship with R, so there is nothing to download. You need basic R and a little familiarity with dplyr; no prior machine learning experience is required. By the end you will be able to take a spreadsheet, build an honest model and present its results in a reproducible report.
Course content
7 lessons- 1R for Machine Learning: Setup and MindsetWhy R for modelling, how tidymodels is organised, and your first end-to-end fit.Preview
- 2Preparing Data With the tidyverseImport, clean, reshape and explore tabular data with readr, dplyr, tidyr and ggplot2 before modelling.
- 3The tidymodels Workflow: Recipes and ModelsWrite a preprocessing recipe, specify a model with parsnip, and bundle them into a workflow.
- 4Regression: Predicting NumbersFit, evaluate and interpret linear and random forest regression models with tidymodels.
- 5Classification: Predicting CategoriesLogistic regression and tree-based classifiers, class probabilities, thresholds and the confusion matrix.
- 6Resampling and TuningCross-validation with rsample, hyperparameter grids with tune, and finalising a model without fooling yourself.
- 7Reporting Results With QuartoTurn a modelling project into a reproducible report with narrative, tables and plots, and prepare it for reuse.