1
Grid Search
Brummel edited this page 2026-06-17 10:12:19 +02:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Grid Search

Grid search is the exhaustive evaluation of every combination drawn from a manually specified, discrete value set per parameter — the Cartesian product of those sets. [L] It is the most direct search: enumerate the lattice, evaluate every node, keep the best.

Cost: the product of the axes

For d parameters, where parameter i contributes k_i distinct values, the grid has

N_{\text{grid}} = \prod_{i=1}^{d} k_i

points. [L] Because the count is a product, every added parameter multiplies the work. In the simplest case of d binary parameters this is already 2^{d}, exponential in the number of parameters — an instance of the curse of dimensionality. [L] Ten parameters at ten values each is ten billion evaluations; the grid becomes unaffordable long before it is fine-grained enough.

Properties

  • Complete within the lattice, but only the lattice. Grid search finds the best node it enumerates, but the resolution is chosen in advance; an optimum that falls between grid lines is unreachable. [L]
  • Deterministic and reproducible. The same grid yields the same point set in the same order, with no randomness to seed. [L]
  • Independent evaluations. No grid point depends on another's result, so the whole grid is embarrassingly parallel. [L]
  • Wasteful in high dimensions. When only a few parameters affect the objective, grid search still spends its entire budget refining a coarse lattice along the parameters that do not matter. [C]

When grid search fits

Grid search is a reasonable default for few parameters (about three or fewer) over small, known discrete value sets, or when completeness over a specific lattice is itself the goal (e.g. a reproducible reference sweep). [C] Beyond a handful of dimensions, random search or an adaptive method covers the space far more economically.

Claim legend

  • [L] law / exact — a definition, identity, or theorem that does not vary.
  • [C] convention — a practitioner rule of thumb that varies by context.

References