Grid Search Method

What is Grid Search?

Grid Search systematically tests all possible combinations of hyperparameter values from a predefined grid.

How It Works

  1. Define parameter grid (e.g., max_depth: [3, 5, 10])
  2. Test every combination
  3. Evaluate with cross-validation
  4. Return best combination

Advantages

  • Thorough: Guaranteed to find best in grid
  • Simple: Easy to understand and implement

Disadvantages

  • Slow: Exponential combinations
  • May Miss: Best values between grid points

Example

  • 3 values for param1 * 4 values for param2 = 12 combinations
  • With 5-fold CV = 60 model fits

Related Terms

  • Random Search: Faster alternative
  • Hyperparameter Tuning: The broader process