Grid Search Optimization

Learn to implement the grid search optimization algorithm.

What is grid search optimization?

Grid search is another brute-force optimization algorithm that treats the objective function as a black box and evaluates it on a set of data points just like a random search. Grid search works by dividing the space into a grid and sampling all combinations from that.

Let’s recall the example of the interview process where the task was to find a suitable candidate for a particular role without prescreening. Let’s assume that the objective function g(x1,x2,..,xm)g(x_1, x_2, .., x_m) now takes the mm inputs—such as CGPA, age, experience, expertise, etc.—and measures the skill difference of the candidate xx compared to the desired skills (the lower the objective, the better the candidate).

For each input xix_i (for example, CGPA), we will generate N+1N + 1 equal distant points in the range [ai,bi][a_i, b_i] (for example, CGPA between 8 and 10, depending upon universities) as follows:

Get hands-on with 1200+ tech skills courses.