How does random search work?

Quick Overview

Asks how random search tunes hyperparameters by sampling configurations from chosen distributions and keeping the best one. Tests whether you can set up the distributions, explain why it often beats grid search for the same budget, and name its limits.

How does random search work?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

How does random search work? Explain the procedure for tuning a model's hyperparameters with random search, how you would set it up, and why it is a common baseline. ```hint Count distinct values Compare it with grid search on a problem where only one of two hyperparameters affects the score, and count how many distinct values of the important one each method tries for the same number of trials. ``` ### What a Strong Answer Covers - The procedure: a distribution per hyperparameter, independent sampling, evaluation, selection and refit. - How to choose the distributions, including log-scale sampling for scale-type parameters. - Why it often does better than grid search for the same budget, and the probability argument for how many trials are enough. - Its limits, and what to use instead when each trial is expensive. ### Follow-up Questions - How many trials do you need for a 99% chance of hitting at least one configuration in the top 1% of the space? - How does Bayesian optimization use earlier trials, and when is it worth the extra overhead? - How do successive halving and Hyperband change the budget given to each trial? - Why is the best validation score found by a search an optimistic estimate of test performance?

Overview: Asks how random search tunes hyperparameters by sampling configurations from chosen distributions and keeping the best one. Tests whether you can set up the distributions, explain why it often beats grid search for the same budget, and name its limits.

General logo
General
Nov 25, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

How does random search work?

Explain the procedure for tuning a model's hyperparameters with random search, how you would set it up, and why it is a common baseline.

What a Strong Answer Covers Guidance

  • The procedure: a distribution per hyperparameter, independent sampling, evaluation, selection and refit.
  • How to choose the distributions, including log-scale sampling for scale-type parameters.
  • Why it often does better than grid search for the same budget, and the probability argument for how many trials are enough.
  • Its limits, and what to use instead when each trial is expensive.

Follow-up Questions Guidance

  • How many trials do you need for a 99% chance of hitting at least one configuration in the top 1% of the space?
  • How does Bayesian optimization use earlier trials, and when is it worth the extra overhead?
  • How do successive halving and Hyperband change the budget given to each trial?
  • Why is the best validation score found by a search an optimistic estimate of test performance?