Hyperparameter Tuning in R
Tune random forests, gradient boosting machines, SVMs and neural nets in R with grid search, random search, adaptive resampling and AutoML.
Hyperparameter tuning in R is the search for the model settings that give the most accurate predictions, since a supervised learning model run with its defaults may not be the best version of itself. You work with the caret, mlr and h2o packages, tuning random forests, gradient boosting machines, support vector machines and neural nets through grid search, random search, adaptive resampling and automatic machine learning (AutoML).
What You Will Achieve
- Tell model parameters apart from hyperparameters, using the coefficients of a linear model as the reference point
- Set up a Cartesian grid, a random search or adaptive resampling through caret’s train() function
- Define tuning controls and aggregated measures in mlr, then plot and judge how each setting performed
- Run grid and random search with stopping criteria in h2o and rank candidate models on an AutoML leaderboard
Program Overview
Hyperparameter Basics and caret Defaults
What separates hyperparameters from model parameters, why tuning them pays off, and how caret already tunes a model with its default settings.
- Model parameters vs. hyperparameters
- Coefficients in linear models
- Resampling schemes in caret
- Manual tuning of stochastic gradient boosting
Grid, Random and Adaptive Search in caret
Faster alternatives to an exhaustive grid, ending with a method that focuses the search on values close to the best settings.
- Cartesian grid search
- Grid vs. random search
- Adaptive resampling
- Plotting tuning output
Tuning and Evaluation with mlr and h2o
Two more packages with their own tuning functions: mlr for defining and evaluating searches, and h2o for preparing data, training models and running AutoML.
- Grid and random search in mlr and h2o
- Evaluating tuning results and advanced controls in mlr
- Stopping criteria for random search
- AutoML, leaderboard scoring and model extraction
Certificate Awarded (Paid)
Complete the course to earn it.
Job Outlook
Tuning supervised models in R is part of machine learning and data science work wherever random forests, gradient boosting machines, support vector machines or neural nets are trained to make predictions.
Good for: R users who already train supervised models and want a methodical way to squeeze more accuracy out of them across three tuning toolkits.
Keep in mind: The three packages are taught one after another, so the later chapters repeat grid and random search in new syntax before adding their own extras.
Bottom line: A focused tour of tuning in R that sets caret, mlr and h2o side by side on the same search methods and closes with AutoML.
Frequently Asked Questions
How does the course introduce hyperparameters?
The opening chapter contrasts model parameters with hyperparameters, using the coefficients of a linear model, then recaps machine learning with caret and shows that caret's default setup already tunes a model's hyperparameters.
What is adaptive resampling?
Adaptive resampling tunes the parameter grid by focusing the search on values near the optimal settings. The caret chapter presents it, alongside random search, as a faster and more efficient approach than a full Cartesian grid.
How are tuning results checked and plotted?
In caret you plot the output of a grid search. In mlr you evaluate tuning results, define aggregated measures and plot model performance across settings, and in h2o you extract models and evaluate their performance.
What is AutoML in h2o?
AutoML is an h2o interface that trains and tunes many models through a single function. The final chapter uses it, scores the resulting leaderboard and pulls out models to evaluate their performance.
Please log in to report a problem with this page.


There are no reviews yet.