What hyperparameters do
Hyperparameters are the knobs that the learning algorithm does not learn from data: regularization strength, tree depth, learning rate, number of estimators. They control capacity and the bias-variance tradeoff. Tuning them is searching the configuration space to maximize CV score.
Three search strategies
- Grid search — exhaustive over a small grid; easy to reason about, expensive when the grid grows.
- Random search — sample from distributions; covers more of the space per unit budget when only a few hyperparameters matter.
- Bayesian / Optuna — model the objective and propose promising configurations; best for expensive evaluations.
The trap of search inflation
If you tune for 100 trials on the same validation set, you are overfitting to that set even if you never train on it. Use nested CV or hold a separate test set untouched. Search budget is also a hyperparameter you choose, not a free resource.