Advanced ML: Learn how to Improve Accuracy by optimizing Hyper-parameters
Lets Get Started
Hyperparameters are settings that can be tuned to control the behavior of a
machine/deep learning algorithm.
The Optimization Part
How Do We Tune Them
Prepare a grid of the possible combination of values of your hyper-parameter!!
Calculate Accuracy for all those combinations
Choose the combination for best accuracy
You Optimized it !!
Prepare a grid of the possible combination of values of your hyperparameter !!
But dont check for every combination !!
Good !! Obviously Faster than Grid ..
But everything is upto luck !!!
Just Think !!
If you want to do a Regression Analysis
In sklearn library,there are around 20 approaches for Regression
On an average each has 5 hyperparameters
Taking 1000 sets of hyper-parameter for each algorithm, if each takes half a minute to train
It would take around 7 days to get you the best hyper-parameter for your data
Damn its slow
Do the Math!
And that was not even a Neural Network
Tree-Structured Parzen Estimator
Do you remember Decision Tree ??
We have something similar for you !!
the tree structure
based on history
Picks the best model
(one with max value of Expected Improvement)
Adds it in its history
Selecting next set of Hyper-param accordingly
So where do the Hyperopt fits in the Picture?
Lets take a toy example,
Minimize: f(x,y) = x^2 - y^2
Such that x and y belongs to a range R1 and R2
Boom !! You'll get the
best range for x and y
LET'S GET OUR HANDS DIRTY !!!
Copy of Efficient Hyperparameter Optimization-
By Tanay Agrawal