
Hyperparameter Tuning (91 Pages)
You can already ask an AI to write you a hyperparameter search. The problem is knowing why a search range that stops one decade short quietly hides the best setting, why the validation score that picked the winner overstates how well it will really perform, or why a grid can spend half its budget on a setting that never had a chance. None of that is visible from model.fit(). This is the course that gives you that judgment.
Five parts, one algorithm, no gaps:
· Part 1 — Intro. Why the settings a model cannot learn for itself decide how well it predicts, why random draws beat a tidy grid when only a few settings really matter, and how Bayesian optimization, successive halving and Hyperband each spend a limited budget more wisely. The intuition before the notation.
· Part 2 — By Hand. A complete worked example: five training runs and three validation runs of a stopping-distance model, two hyperparameters (polynomial degree and ridge penalty), and four full iterations of random search, twelve trials in all — every random draw, ridge fit, prediction and validation error shown. Nothing waved away, nothing left “as an exercise.” You watch the best error fall from 0.486 to 0.213 and prove the method to yourself.
· Part 3 — In Excel. The same example built out in a spreadsheet you can open and poke at, one trial per row and one iteration per block, so you see exactly which configurations win and why — and watch twenty iterations of convergence unfold as you change the seed, the search range or the degree threshold.
· Part 4 — In Python. A clean, executable, verified reference implementation that checks its own answer against a brute-force sweep of 80,002 configurations and against grid search with the same 60-trial budget — the known-good version you can check any other code against.
· Part 5 — With AI. A tested prompt that directs an AI assistant to carry this same algorithm to your problem, plus the understanding to catch it when it’s wrong.
By the end you won’t just have working code. You’ll have followed the algorithm from first principles through a hand calculation, a spreadsheet, and production Python — so when you point an AI at your own model, you’ll know how to set a search range on the right scale, keep the test data out of the search, and tell when the answer is right.