liveBook · Manning

Grid search

As explained in Bayesian Optimization in Action

Grid search is an optimization technique that evaluates points arranged on a regular grid over the search space.

Grid search explores an objective function by dividing its search space into evenly spaced segments and evaluating each segment endpoint. Spreading evaluations across the range avoids the accidental clustering that can waste resources in random search. section 1.2.4

A basic grid-search procedure is:

  • Divide the search space into evenly spaced segments. section 1.2.4
  • Evaluate the objective at each segment endpoint. section 1.2.4
  • Select the best evaluated point, while recognizing that the true global optimum may lie between grid points. section 1.2.4

A one-dimensional search

Across a range from −5 to 5, grid search evaluates evenly spaced locations and identifies the endpoint at 5 as the best tested point, with an objective value of roughly 4.86. It improves on random search but still misses the actual global optimum and remains inefficient at narrowing a promising region. section 1.2.4

Figure 1.7 Grid search is still inefficient at narrowing down a good region.

Use the figure to see how evenly spaced evaluations can remain inefficient at narrowing down a good region. section 1.2.4

How Bayesian Optimization in Action covers it

How deep it goes
Defines segment partitioning and endpoint evaluation, but stops short of adaptive narrowing or reliable global-optimum discovery.
Examples
Evaluates evenly spaced points from −5 to 5 and selects the point at 5 with an objective value near 4.86.
What it assumes
Assumes a defined search space and evaluable objective, without requiring prior knowledge of important regions.
What you can do after
Apply it by partitioning a search space evenly and evaluating each segment endpoint.
How it connects
Contrasts grid search with random search and Bayesian optimization.

Also explained in

Compare how 6 books explain grid search →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bayesian Optimization in Action. The section links point to the parts of the book it draws on.