Hyperparameter Tuning

Hyperparameters against learned parameters; grid, random and Bayesian search; the budget; and the rule that nothing is ever tuned on the test set.

Hyperparameters
▶ lab

Parameters are learned from the data. Hyperparameters are chosen before training, judged on validation, and belong in the experiment record — because they decide what the learning is allowed to do.

Q · Which knobs does the training procedure not set for itself, who sets them, on what evidence, and where does that decision get written down?
Grid Search and Random Search
▶ lab

Grid search is exhaustive and exponential. Random search covers each important setting better per trial, because most settings turn out not to matter. Neither is allowed anywhere near the test set.

Q · Given a budget of trials and a validation set, how should the trials be placed — and what does the best trial's score actually estimate?
Bayesian Optimisation, Successive Halving and Early Termination

When a trial costs hours, spend the trials sequentially: model the objective from the trials so far, choose the next one to balance exploration and exploitation, and kill trials that are clearly losing before they finish.

Q · When each trial is expensive, how does the search use what it has already learned to place the next trial — and to stop a trial that is not going to win?
The Tuning Budget

A search costs compute, time and validation-set credibility, and returns less with every trial. Tune the learning rate first, stop when the curve flattens, and remember that a fixed leak or a better feature usually beats any amount of tuning.

Q · How much should a hyperparameter search cost, what should it spend its first trials on, and when is the next trial worth less than the next feature?
AutoML Hides the Search

AutoML runs a search over pipelines and hyperparameters against a validation metric and hands you the winner. What it hides is the search space, the preprocessing leakage it may have committed inside the loop, the validation set it has now overfitted, and the serving cost of the pipeline it chose.

Q · When a tool searches over models and preprocessing for you, what did it search over, what did it leak, what did it overfit, and what will it cost to serve — and when is it fine not to ask?