Hyperparameter tuning: Grid search and Random search:

  • Random search

Grid search:

Grid search is the simplest algorithm for hyperparameter tuning. In grid search, we simply build a model for every combination of various hyperparameters and evaluate each model. The model which gives the highest accuracy that is considered to be the best. The pattern followed here is similar to the grid, where all the values are placed in the form of a matrix.

Random search:

Random search is a technique where random combinations of the hyperparameters are used to find the best solution for the built model. It is similar to grid search, and yet it has proven to yield better results comparatively.


There are other optimisation techniques which might yield better results compared to these two, depending on the model and the data. When it comes to science, there is no luck but when it comes to randomness we hope to find the best sample with the least possible time.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store