Machine Learning β€Ί Trees and Ensembles β€Ί Day 166

Day 166: Hyperparameter Tuning

Day 166 of 365 β€” Hyperparameter Tuning

Master the theory and practical engineering of Hyperparameter Tuning: why hyperparameters control model capacity while parameters fit the data, why Random Search mathematically dominates Grid Search due to low effective dimensionality, how Bayesian Optimization uses Gaussian Process surrogates and Expected Improvement (EI) to balance exploration and exploitation, how multi-fidelity pruning (Hyperband / Successive Halving) cuts compute by 80%, and how to tune tree ensembles systematically.

Course
Machine Learning
Category
Trees and Ensembles
Reading time
β‰ˆ 50 min
Practical time
β‰ˆ 60 min
Lesson duration
1h 50m
Last verified
2026-08-29

Hands-on lab for this lesson

Lab files on GitHub: https://github.com/ai-roadmap-365/ai-roadmap-365.github.io/tree/main/labs/sections/machine-learning/day-166-hyperparameter-tuning

  1. Get the hands-on files. Clone the labs repository once (you can reuse this clone for every lesson). This works on macOS, Linux, and Windows (PowerShell or WSL):
    git clone https://github.com/ai-roadmap-365/ai-roadmap-365.github.io.git
    cd ai-roadmap-365.github.io
  2. Open this lesson's lab. Move into the directory for this specific day. Every lab lives at the same predictable path β€” section / subsection / week / day:
    cd labs/sections/machine-learning/day-166-hyperparameter-tuning
  3. Read the lab guide. Open `README.md` in that directory. It lists the exact commands, what each does, the expected output, and how to check your work β€” read it before running anything.
  4. Run it and check your work. Follow the README's "How to run" section: run the example first to see the finished result, then complete the numbered exercises in `starter/`, then run the tests. The tests pass (exit 0) only when your work is correct.
    bash tests/run_tests.sh   # or the test command named in the lab README

You can also open the lab as a local page (works offline, shows the file tree and expected output).

Learning objectives

By the end of this lesson you will be able to:

Prerequisites

Why this matters

In Days 162 through 165, we explored tree-based models: Decision Trees, Random Forests, Gradient Boosting, and modern histogram engines (XGBoost/LightGBM).

Every one of these algorithms is governed by a constellation of configuration settings: learning_rate, n_estimators, max_depth, max_leaf_nodes, min_samples_split, subsample, colsample_bytree, reg_alpha, and reg_lambda.

These knobs are hyperparameters. Unlike internal model parameters (such as tree split thresholds or linear regression weights) which are optimized automatically by the training algorithm, hyperparameters must be configured before training begins.

Setting hyperparameters carelessly produces disastrous outcomes:

How do we systematically find the optimal set of hyperparameters without burning thousands of CPU hours?

This lesson uncovers the science of hyperparameter optimization: why Random Search mathematically dominates Grid Search due to the low effective dimensionality phenomenon, how Bayesian Optimization uses Gaussian Process surrogates and Expected Improvement (EI) to balance exploration and exploitation, and how multi-fidelity pruning (Hyperband) cuts search budgets by 80%.


The idea in plain language

Imagine you are drilling for oil across a vast 100-square-mile desert:


Historical background

For decades, hyperparameter tuning was treated as an unprincipled β€œdark art” consisting of manual trial-and-error or brute-force Cartesian Grid Search.

In 2012, James Bergstra and Yoshua Bengio published their seminal paper Random Search for Hyper-Parameter Optimization in the Journal of Machine Learning Research. They proved mathematically and empirically that across standard machine learning benchmarks, Random Search discovers models that are as good or better than Grid Search in a fraction of the computation time.

Concurrently in 2012, Jasper Snoek, Hugo Larochelle, and Ryan Adams published Practical Bayesian Optimization of Machine Learning Algorithms, demonstrating that modeling tuning runs as Gaussian Processes with Expected Improvement finds better hyperparameters than human experts.

In 2018, Lisha Li and Kevin Jamieson introduced Hyperband, merging multi-armed bandit theory with Successive Halving to dynamically allocate compute resources.

In 2019, Preferred Networks released Optuna, which popularized Tree-structured Parzen Estimators (TPE) and automated trial pruning, establishing the modern standard for hyperparameter engineering.


What it is β€” and what it is not

To tune machine learning models with scientific discipline, let us distinguish parameters from hyperparameters:

What it IS:

What it is NOT:


Why it was created and what problems it solves

Hyperparameter tuning solves five major bottlenecks in machine learning engineering:

  1. Escapes the Combinatorial Explosion of Grid Search: Replaces O(k^P) exponential complexity with fixed-budget probabilistic sampling.
  2. Exploits Low Effective Dimensionality: Concentrates compute on the 1 or 2 hyperparameters that actually impact performance on a specific dataset.
  3. Automates Exploration vs Exploitation: Bayesian optimization mathematically balances searching unexplored regions (high uncertainty) with refining known high-performing areas.
  4. Prevents Compute Waste via Early Stopping & Pruning: Kills poor hyperparameter configurations after 10 iterations rather than running all 500 rounds.
  5. Enforces Rigorous Cross-Validation: Standardizes parameter evaluation on out-of-fold validation splits to prevent validation memorization.

How it works

Let us formulate the mathematics of Grid Search, Random Search, Bayesian Optimization, and acquisition functions.

1. The Hyperparameter Optimization Problem

Let theta in Theta be a hyperparameter vector in a P-dimensional configuration space Theta = Theta_1 times Theta_2 times ... times Theta_P.

Let A be a learning algorithm that trains on dataset D_{train} with configuration theta, producing a fitted model f_{A, theta}.

Our objective is to find theta^* that minimizes generalization loss L on validation data D_{val}:

theta^* = argmin_{theta in Theta} L( f_{A, theta}(D_{train}), D_{val} )

Because evaluating L(theta) requires a full training and cross-validation run (which can take seconds to hours), L(theta) is a costly black-box function with no closed-form gradient.


2. Grid Search vs Random Search (The Low Effective Dimensionality Theorem)

Suppose we have P = 2 hyperparameters, theta = (theta_1, theta_2), but only theta_1 (e.g. learning_rate) significantly affects model accuracy, while theta_2 (e.g. random_seed) is uninformative.

If we test k = 3 values per parameter, we evaluate k^2 = 9 total configurations:

Even though we ran 9 expensive training jobs, we only explored 3 distinct values of the critical parameter theta_1.

If we run N = 9 random trials by sampling theta_1 ~ Uniform(a, b) and theta_2 ~ Uniform(c, d):

Result (Bergstra & Bengio, 2012): Random search provides 9 / 3 = 3x higher resolution along the important dimension for the exact same computational budget. In high dimensions (P = 10), the efficiency advantage of Random Search over Grid Search is exponential.


3. Bayesian Optimization and Sequential Model-Based Optimization (SMBO)

Bayesian Optimization treats hyperparameter tuning as a sequential decision problem:

  1. Historical Dataset: H_t = { (theta_1, y_1), (theta_2, y_2), ..., (theta_t, y_t) } of past configurations and their cross-validation scores.
  2. Surrogate Model: A probabilistic regression model (typically a Gaussian Process or Tree-structured Parzen Estimator) that fits H_t to predict:
    • Expected score (Mean): mu(theta)
    • Epistemic uncertainty (Standard Deviation): sigma(theta)
  3. Acquisition Function: A cheap mathematical function alpha(theta) that scores candidate points based on mu(theta) and sigma(theta).
  4. Next Point Selection: Solve theta_{t+1} = argmax_{theta in Theta} alpha(theta) (cheaply optimized via numerical methods).
  5. Evaluate & Update: Train the true model with theta_{t+1}, record y_{t+1}, append to H_{t+1}, and repeat.

4. The Expected Improvement (EI) Acquisition Function

For a maximization objective (e.g. classification accuracy), let y^+ = max_{i=1}^t y_i be the best score observed so far.

The improvement of a new candidate theta is:

I(theta) = max(0, f(theta) - y^+ - xi)

Where xi >= 0 is an exploration parameter.

Under a Gaussian Process surrogate f(theta) ~ N(mu(theta), sigma^2(theta)), the Expected Improvement has an exact closed-form analytical expression:

EI(theta) = E[ I(theta) ] = (mu(theta) - y^+ - xi) * Phi(Z) + sigma(theta) * phi(Z) if sigma(theta) > 0 EI(theta) = 0 if sigma(theta) == 0

Where:

Let us dissect the two terms of Expected Improvement:

  1. Exploitation Term (mu - y^+ - xi) * Phi(Z): High when the surrogate predicts a high average score mu(theta).
  2. Exploration Term sigma(theta) * phi(Z): High when the surrogate has high uncertainty sigma(theta) (unexplored regions of hyperparameter space).

5. Multi-Fidelity Pruning: Successive Halving and Hyperband

Why train 500 trees if a bad configuration (e.g. learning_rate = 10.0) diverges after 10 trees?

Round 0: Start 64 configurations βž” Train for 10 iterations βž” Evaluate validation loss.
Round 1: Keep top 32 configurations βž” Train for 20 iterations.
Round 2: Keep top 16 configurations βž” Train for 40 iterations.
Round 3: Keep top 8 configurations  βž” Train for 80 iterations.
Round 4: Keep top 4 configurations  βž” Train for 160 iterations.
Round 5: Top 2 configurations       βž” Train for 320 iterations.

Successive Halving discards the worst-performing 50% of candidates at each milestone, focusing compute exclusively on promising configurations. Hyperband wraps Successive Halving across varying initial exploration budgets.


An everyday analogy

Think of hyperparameter tuning as tuning a high-performance race car:

  1. Model Parameters (The Driver’s Steering): The steering wheel and pedals respond dynamically to the road conditions during the race (fitting the data).
  2. Hyperparameters (The Mechanical Setup): Gear ratios, tire compound, wing downforce angle, and suspension stiffness are configured in the garage before the race starts.
  3. Grid Search (The Inflexible Mechanic): The mechanic tests every possible tire with every possible wing angle on a spreadsheet. By the time they finish 1,000 tests, the race season is over.
  4. Random Search (The Dynamic Tester): The mechanic tests diverse combinations across the full RPM band, quickly discovering that downforce is the single critical factor for this track.
  5. Bayesian Optimization (The Telemetry AI): The telemetry system analyzes lap times from previous runs, predicts the optimal downforce/gear combination, and dials in the championship setup in 10 test laps.

Examples in practice

Let us visualize the spatial exploration efficiency of Grid vs Random vs Bayesian Search:

Comparison diagram contrasting Grid Search (rigid grid), Random Search (uniform scatter), and Bayesian Optimization (guided cluster near optimum).

The diagram illustrates how Random Search covers more unique parameter values, while Bayesian Optimization clusters trials around the global optimum.

Below is the cyclical flow of Sequential Model-Based Optimization (SMBO):

Animated flow chart illustrating the cyclical loop between evaluating trials, updating Gaussian Process surrogate, computing Expected Improvement, and picking next candidate.

Let us examine real Python code performing Randomized Search with cross-validation on a Random Forest:

import numpy as np
from scipy.stats import randint, uniform
from sklearn.datasets import load_breast_cancer
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import RandomizedSearchCV, StratifiedKFold
from sklearn.metrics import accuracy_score, classification_report

# 1. Load Data
cancer = load_breast_cancer()
X, y = cancer.data, cancer.target

# 2. Define Continuous and Discrete Parameter Distributions
param_distributions = {
    "n_estimators": randint(50, 300),
    "max_depth": randint(3, 12),
    "min_samples_split": randint(2, 10),
    "min_samples_leaf": randint(1, 6),
    "max_features": ["sqrt", "log2", None]
}

# 3. Configure Randomized Search with 5-Fold Stratified CV
cv = StratifiedKFold(n_splits=5, shuffle=True, random_state=42)

random_search = RandomizedSearchCV(
    estimator=RandomForestClassifier(random_state=42),
    param_distributions=param_distributions,
    n_iter=30, # 30 random configurations (vastly faster than 5^5 = 3125 grid)
    scoring="accuracy",
    cv=cv,
    n_jobs=-1,
    random_state=42
)

random_search.fit(X, y)

# 4. Inspect Results
print("=== Hyperparameter Tuning Benchmark ===")
print(f"Best 5-Fold CV Score: {random_search.best_score_ * 100:.2f}%")
print("Best Hyperparameters Found:")
for k, v in random_search.best_params_.items():
    print(f"β€’ {k:20s}: {v}")

Implications: security, privacy, performance, scalability, and cost

DimensionCharacteristicPractical Implication
Search Space BudgetExponential scaling with parameter count.In high dimensions (P > 8), exhaustive Grid Search is strictly forbidden in production; use Random Search or Optuna.
Optimization LeakageValidation set overfitting.Running 10,000 trials on a small validation set selects a model that overfit validation noise. Always keep an untouched final test set.
Compute Cost & ParallelismEmbarrassingly parallel trials.Random Search trials are 100% independent and scale linearly across distributed clusters (Ray Tune / Dask).
Denial of Service RisksUser-controlled grid configurations.Web APIs accepting tuning requests must limit n_iter and memory limits to prevent server resource starvation.

Alternatives: free, open source, and commercial

Tool / FrameworkMethodologyLicense / CostBest Used For
scikit-learn (RandomizedSearchCV)Uniform distribution samplingFree, BSD Open SourceBaseline tuning directly within scikit-learn workflows.
OptunaTree-structured Parzen Estimator (TPE) + PruningFree, MIT Open SourceState-of-the-art Python Bayesian optimization and automated trial pruning.
Ray TuneDistributed Hyperband / ASHAFree, Apache 2.0Multi-node, multi-GPU distributed hyperparameter search at scale.
Weights & Biases SweepsCloud-managed Bayesian tuningFree tier / CommercialExperiment tracking and hyperparameter sweeps with web dashboard.

CharacteristicGrid SearchRandom SearchBayesian Optimization (SMBO)
Search LogicExhaustive Cartesian gridIndependent random samplingProbabilistic surrogate + Expected Improvement
Sample EfficiencyVery Low (O(k^P))High (Covers all axes)Ultra-High (Focuses near optimum)
ParallelizabilityEmbarrassingly parallelEmbarrassingly parallelSequential (or batched async)
Setup ComplexityTrivialTrivialRequires surrogate configuration
Continuous SpacesRequires manual discretizationNatural samplingNatural continuous modeling

When to use it β€” and when not to

When to USE Systematic Hyperparameter Tuning:

When NOT to use Heavy Hyperparameter Tuning:


Knowledge check

  1. Parameter vs Hyperparameter: Parameters are fitted by training data; hyperparameters control algorithm capacity.
  2. Low Effective Dimensionality: Random search evaluates more distinct values of the important parameters than Grid Search.
  3. Bayesian Optimization: Combines a surrogate model (mu, sigma) with an acquisition function (Expected Improvement).
  4. Optimization Leakage: Excessive tuning on a validation set overfits validation noise; hold out an untouched test set.

Hands-on exercise

In this hands-on exercise, you will implement analytical Expected Improvement (EI) and evaluate parameter combinations on a synthetic objective.

import numpy as np
from scipy.stats import norm

# Step 1: Implement Expected Improvement
def expected_improvement(mu, sigma, current_best, xi=0.01):
    ei = np.zeros_like(mu)
    valid = sigma > 1e-9
    improvement = mu[valid] - current_best - xi
    Z = improvement / sigma[valid]
    ei[valid] = improvement * norm.cdf(Z) + sigma[valid] * norm.pdf(Z)
    return ei

# Step 2: Compare 3 Candidate Points from a Surrogate Model
# Current Best Score = 0.85
current_best = 0.85

# Candidate A: High mean, low uncertainty (Exploitation)
# Candidate B: Moderate mean, high uncertainty (Exploration)
# Candidate C: Low mean, low uncertainty (Sub-optimal)
candidates_mu = np.array([0.88, 0.83, 0.70])
candidates_sigma = np.array([0.02, 0.12, 0.01])

ei_scores = expected_improvement(candidates_mu, candidates_sigma, current_best, xi=0.01)

print("=== Bayesian Optimization Candidate Selection ===")
for name, mu, sig, ei in zip(["A (Exploit)", "B (Explore)", "C (Sub-optimal)"], candidates_mu, candidates_sigma, ei_scores):
    print(f"Candidate {name:15s}: Mean={mu:.2f}, Sigma={sig:.2f} βž” Expected Improvement = {ei:.5f}")

best_candidate = np.argmax(ei_scores)
print(f"\nNext Point Selected to Evaluate: Candidate {best_candidate} (Index {best_candidate})")

Expected output

=== Bayesian Optimization Candidate Selection ===
Candidate A (Exploit)    : Mean=0.88, Sigma=0.02 βž” Expected Improvement = 0.02052
Candidate B (Explore)    : Mean=0.83, Sigma=0.12 βž” Expected Improvement = 0.02868
Candidate C (Sub-optimal): Mean=0.70, Sigma=0.01 βž” Expected Improvement = 0.00000

Next Point Selected to Evaluate: Candidate 1 (Index 1)

Validate your work

  1. Confirm that Candidate B (Explore) receives a higher EI score than Candidate A due to high epistemic uncertainty sigma = 0.12.
  2. Confirm that Candidate C receives an EI of 0.00000.
  3. Run RandomizedSearchCV on a Random Forest and verify that 5-fold CV accuracy improves over the un-tuned default.

Troubleshooting

Common mistakes

  1. Running Grid Search on Continuous Parameters: Use log-uniform distributions (loguniform(1e-4, 1e-1)) with Random Search instead.
  2. Evaluating Tuning on the Test Set: Strictly separate train/validation folds from the final test holdout.

Practice assignment

  1. Implement Upper Confidence Bound (UCB) Acquisition Function: Write compute_ucb(mu, sigma, kappa=2.0) where UCB = mu + kappa * sigma. Compare the candidate selected by UCB vs Expected Improvement.
  2. Implement Hyperparameter Successive Halving: Write a Python loop that trains 16 Random Forest models for 10 trees, evaluates validation accuracy, keeps the top 8 models, trains them to 20 trees, and repeats until 1 champion model remains.

Extension challenge

Build a Mini-Optuna Bayesian Optimizer from Scratch:

  1. Implement a 1D Gaussian Process Regressor with an RBF kernel from first principles in NumPy.
  2. Optimize a non-convex black-box function f(x) = sin(3x) + 0.5x using the Bayesian Optimization loop with Expected Improvement for 15 iterations.
  3. Plot the true function, the GP surrogate posterior mean and 95% confidence bounds, and the acquisition function at each step.

Quiz

Q1. What is the fundamental difference between a model parameter and a hyperparameter?

  1. Parameters (e.g. tree split thresholds, linear weights w) are learned automatically from training data; hyperparameters (e.g. max_depth, learning_rate, n_estimators) are configured before training to control capacity and regularization
  2. Parameters are for classification; hyperparameters are for regression
  3. Parameters are integers; hyperparameters are floating-point numbers
  4. There is no difference
Show answer

Answer: A. Parameters (e.g. tree split thresholds, linear weights w) are learned automatically from training data; hyperparameters (e.g. max_depth, learning_rate, n_estimators) are configured before training to control capacity and regularization

Parameters are internal to the model and optimized directly by the training algorithm. Hyperparameters are external knobs set by the engineer to guide optimization and regularize model capacity.

Q2. Why does Random Search mathematically outperform Grid Search for the same total number of trials (Bergstra & Bengio, 2012)?

  1. Because most machine learning problems have "low effective dimensionality": only 1 or 2 hyperparameters truly drive performance. Grid search wastes trials testing repeated values along uninformative axes, while Random Search tests N distinct values for every single parameter
  2. Because Random Search uses GPU acceleration
  3. Because Random Search always finds the global minimum
  4. Because Grid Search cannot evaluate integer parameters
Show answer

Answer: A. Because most machine learning problems have "low effective dimensionality": only 1 or 2 hyperparameters truly drive performance. Grid search wastes trials testing repeated values along uninformative axes, while Random Search tests N distinct values for every single parameter

If only learning_rate matters and max_depth is secondary, a 9-trial grid search tests only 3 distinct learning rates. A 9-trial random search tests 9 distinct learning rates, providing 3x better coverage of the critical dimension.

Q3. What are the two core components of a Bayesian Optimization system?

  1. A Surrogate Model (e.g. Gaussian Process or Tree-structured Parzen Estimator) that models the objective function and uncertainty, and an Acquisition Function (e.g. Expected Improvement) that guides where to sample next
  2. A linear regression model and a random number generator
  3. A neural network and a confusion matrix
  4. A clustering algorithm and a decision tree
Show answer

Answer: A. A Surrogate Model (e.g. Gaussian Process or Tree-structured Parzen Estimator) that models the objective function and uncertainty, and an Acquisition Function (e.g. Expected Improvement) that guides where to sample next

Bayesian optimization uses a probabilistic surrogate model to estimate mean performance mu(x) and uncertainty sigma(x), and an acquisition function to balance exploration (high uncertainty) vs exploitation (high mean).

Q4. In the Expected Improvement (EI) acquisition function, what does the parameter xi >= 0 control?

  1. The trade-off between exploration and exploitation: larger xi favors exploration of high-uncertainty regions, while xi = 0 favors exploiting near the current best observation
  2. The learning rate of the booster
  3. The number of cross-validation folds
  4. The random seed
Show answer

Answer: A. The trade-off between exploration and exploitation: larger xi favors exploration of high-uncertainty regions, while xi = 0 favors exploiting near the current best observation

The parameter xi specifies the minimum improvement over the current best score required to be considered attractive, shifting search priority towards high-variance unexplored parameter space.

Q5. What is Successive Halving (and its extension Hyperband)?

  1. A multi-fidelity bandit algorithm that starts many candidate configurations on small resource budgets (e.g. 10 epochs or 1,000 samples), evaluates them, and promotes only the top 50% to progressively larger budgets
  2. A method that cuts feature count in half
  3. A binary search over learning rates
  4. A tree pruning algorithm
Show answer

Answer: A. A multi-fidelity bandit algorithm that starts many candidate configurations on small resource budgets (e.g. 10 epochs or 1,000 samples), evaluates them, and promotes only the top 50% to progressively larger budgets

Successive Halving evaluates dozens of configurations cheaply on small subsets/epochs, quickly killing poor parameter combinations and allocating full compute budgets only to top performers.

Q6. What is the recommended tuning hierarchy for Gradient Boosted Trees (XGBoost / LightGBM)?

  1. 1. Fix learning_rate (e.g. 0.1) and find optimal n_estimators via early stopping; 2. Tune tree structure (max_depth / max_leaf_nodes, min_child_samples); 3. Tune stochastic sampling (subsample, colsample_bytree); 4. Tune regularization (reg_alpha, reg_lambda); 5. Lower learning_rate (0.01) and retrain
  2. 1. Tune random_state; 2. Tune thread count; 3. Run grid search
  3. 1. Tune lambda; 2. Set max_depth=50
  4. 1. Tune batch size; 2. Train for 1 epoch
Show answer

Answer: A. 1. Fix learning_rate (e.g. 0.1) and find optimal n_estimators via early stopping; 2. Tune tree structure (max_depth / max_leaf_nodes, min_child_samples); 3. Tune stochastic sampling (subsample, colsample_bytree); 4. Tune regularization (reg_alpha, reg_lambda); 5. Lower learning_rate (0.01) and retrain

Systematic tuning starts by locking in tree capacity and early stopping at a moderate learning rate, tuning structural and sampling regularizers, and finally reducing learning rate with increased trees for a final accuracy boost.

Q7. What is "Optimization Leakage" (overfitting the validation set during hyperparameter tuning)?

  1. When thousands of hyperparameter configurations are evaluated on a small validation set, the search eventually picks a configuration that memorized the validation noise rather than learning generalizable patterns
  2. When test labels leak into the training set
  3. When missing values are imputed before scaling
  4. When features are correlated
Show answer

Answer: A. When thousands of hyperparameter configurations are evaluated on a small validation set, the search eventually picks a configuration that memorized the validation noise rather than learning generalizable patterns

Just as model parameters can overfit the training set, hyperparameter search algorithms can overfit the validation set if too many configurations are tested without a completely isolated holdout test set.

Q8. Why is it dangerous to tune hyperparameters using only training set accuracy?

  1. The search will always select the most complex, unconstrained model (e.g. max_depth=None, min_samples_split=2, n_estimators=10000), resulting in 100% training accuracy but catastrophic test-set overfitting
  2. Training accuracy cannot be computed for decision trees
  3. Grid search crashes if cross-validation is disabled
  4. Hyperparameters only affect test accuracy
Show answer

Answer: A. The search will always select the most complex, unconstrained model (e.g. max_depth=None, min_samples_split=2, n_estimators=10000), resulting in 100% training accuracy but catastrophic test-set overfitting

Training accuracy monotonically favors maximum complexity. Hyperparameters MUST be evaluated on held-out cross-validation folds to measure true generalization.

Glossary

Hyperparameter
A configuration external to the model whose value is set before the learning process begins, dictating model capacity, optimization dynamics, and regularization.
Grid Search
An exhaustive hyperparameter optimization strategy that trains and evaluates models across all combinations in a predefined discrete Cartesian product grid.
Random Search
A hyperparameter optimization method that samples parameter configurations randomly from specified statistical distributions, providing superior coverage of continuous spaces.
Bayesian Optimization
A sequential design strategy for global optimization that builds a probabilistic surrogate model of the objective function to intelligently select the most promising evaluation points.
Surrogate Model
A computationally cheap probabilistic approximation (e.g. Gaussian Process, Tree-structured Parzen Estimator) of the true expensive objective function.
Acquisition Function
A mathematical function (such as Expected Improvement or Upper Confidence Bound) that guides search exploration by quantifying the utility of sampling a candidate hyperparameter point.
Expected Improvement (EI)
An acquisition function that measures the expected magnitude of performance gain over the current best observed score, integrating over the surrogate posterior uncertainty.
Successive Halving
An early-stopping resource allocation algorithm that trains a pool of configurations on minimal resources, progressively pruning the bottom half and promoting top candidates.
Hyperband
A bandit-based hyperparameter optimization framework that extends Successive Halving across varying initial resource allocations to resolve the exploration vs exploitation trade-off.
Optimization Leakage
The phenomenon where hyperparameter tuning overfits a specific validation fold due to excessive trials, necessitating an untouched external test set for final audit.

Sources and further reading


Kept in this browser, no account needed. Your progress page turns the whole record into one link you can bookmark or open on another device.