Module 8 · Lesson 1 of 437/56 in the course~22 min
Module lessons (1/4)
Hyperparameters and search
Lesson preview5 hands-on exercises readyMachine Learning: from first principles to practice · Module 8 — Model selection and tuning
Grid and randomised search, and keeping the test set honest.
What you'll learn in this lesson
- Tell parameters from hyperparameters.
- Search a grid of hyperparameters with cross-validation using
GridSearchCV. - Use randomised search when the grid is too big, and keep a test set out of the search.
Overview
Parameters (weights, split thresholds) are learned from the data. Hyperparameters are knobs you set before training: k in kNN, max_depth of a tree, C of an SVM, alpha of Ridge. They change what the model can express, and the defaults are rarely best for your problem.
You have been choosing them by hand. A search automates it: try many combinations, score each with cross-validation, keep the best.
Sections covered in this lesson
- 1The hook: knobs you have to turn yourself
- 2Comparing hyperparameter search strategies
- 3Try it: interactive grid search & overfitting explorer
- 4Progressive examples: grid and randomised tuning
- 5Two rules to stay honest
- 6Practice
Pro Lesson · Module 8 — Model selection and tuning
Unlock "Hyperparameters and search" and the full Machine Learning: from first principles to practice curriculum
Grid and randomised search, and keeping the test set honest.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Machine Learning: from first principles to practice plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.