Hyperparameter Tuning
Hyperparameter tuning is a process to find the optimal hyperparameters for an ML algorithm. The simplest manual strategy is as follows:
- Divide the training set into 2 parts: train_set and val_set.
- Set initial hyperparameters.
- Train your model with the train_set and evaluate on the val_set with some metric ( accuracy, AUC, etc).
- Change your hyperparameter values and repeat step 3. Do this for a couple of times
- Choose those hyperparameter values which gave the best metric value and retrain the model on the entire training set with these chosen values.
Hyperparameter tuning is a very important step. You can have the best algorithms and the best data, but to get to the point of best output, you inevitable need to tune your hyperparameters. These days there are a lot of automated libraries for hyperparameter tuning as well where you don't have to lay a finger and the library will get you the optimal values. However for starters, it is best to try this manually. Later, you can switch to these automated libraries.
You might often find the same model trained on same data giving different results, simply because of the difference in hyperparameters. So, it becomes of utmost importance to get the model with best possible performance (approximately!).