Understanding Sweep Parameters module in Azure Machine Learning

When you train a machine learning algorithm it is very important that you choose right set of parameters. When you don’t understand the in-side out of that algorithm it might be very difficult to choose and fine tune the parameters. Even if you understand the algorithm well, it might be daunting to run different iteration of training and evaluate a model with different combination of parameters – consider Neural Networks.

Microsoft Azure Machine Learning comes with a handy option to address the same with a module called Sweep Parameters. This module takes an untrained model along with training and validation data set and generates optimum parameter settings with just clicks.

I will give you a walk through on how to train and optimize a two-class neural network model with Sweep Parameters.

Below is the model to train the neural network with the default parameter settings.

two class neural network

Below is the performance of the model we found by visualizing the output of the Evaluate Model. To understand the Evaluate Model and its output, I have a separate blog post here.

visualising the output of the Evaluate Model

As you can notice the accuracy of the model is 0.971. Let’s try to improve the accuracy through finding optimized the parameter setting with Sweep Parameters. You can access the official documentation page for the same here.

sweep parameters

Here we have chosen “Entire grid” for Sweeping mode. This option is useful for cases where you don’t know what the best parameter settings might be and want to try many parameters. It loops over a grid predefined by the system to try different combinations and identify the best learner.

Alternatively you can choose “Random Sweep” and specify the maximum number of runs that you want the module to execute. It will randomly select parameter values over a system-defined range. This option is suggested when you want to increase model performance using the metrics of your choice and conserve computing resources.

Let’s now investigate what optimized parameters the module is suggesting:

visualize output of the sweep parameters

Either you can pick up best value from above or try visualizing the other output of the Sweep Parameters, to just find suggested best possible parameters. And then allow to the parameters to your model to get the best performance.

Well, this might not be the ultimate way to improve the performance of your model but certainly a handy tool during experiment phase.

Sumit Mund

Data Solution Architect with more than 15 years of hands-on experience. He has an MSc by Research (in AI) degree and B.Tech degree in Information Technology. He is also a part-time PhD scholar at the University of Huddersfield where his research area includes applications of AI in Finance, particularly in Risk Management (Hedging). Read More...

Leave a Reply

Close Menu