23 December 2015

Azure Machine Learning in 5 Steps

The purpose of this post is not to be a technical article, but a guideline to help you develop a Machine Learning model.

Register and Login to Azure Machine Learning

First of all, you need to create an account in Azure, so you can access Machine Learning Studio.

It is possible to create a free account to build a Machine Learning model, but with some restrictions concerning available space, number of processing cores and some other features.

After creating the account to Microsoft Azure, you can Login to Azure Machine Learning and start to explore the platform:

Now you are the Azure Machine Learning home page, where it is possible to access the gallery of experiments and data sources, and try some examples.

Now you are the Azure Machine Learning home page, where it is possible to access the gallery of experiments and data sources, and try some examples.

Uploading Datasets

Before creating an experiment, it is very important to have data so we can train the model.

The data is uploaded to the Azure Machine Learning, in the DataSets section.

After clicking in “New”, choose to “upload the dataset from a local file”.

It is possible to choose many file formats, but the most common is the CSV file.

New datasets can be uploaded to the model, at any time.

Creating a Training Experiment

To create an experiment, click on “New” / “Experiment”.

Here we can create a blank experiment or open a template or a sample from the gallery:

Choosing the “Blank Experiment”, the Studio working space will be available:

This screen can be split into four areas:

1 – Toolbox Area, at the left, where all the components needed to create the experiment can be found: Datasets, Trained Models, Transformations, Joins, Data Transformation, …

2 – Working Area, at the center, to where we drag the components and connect them to create the flow of data and build the experiment.

3 – Properties Area, at the right, where is possible to define properties of the documents and tune some processing.

4 – Action Area, at the bottom, where are available some actions over the experiment, such as Save, Run, Deploy Web Service or Publish Model

Drag and drop the Datasets, the joins, the transformations and any other objects/components from the Toolbox Area and start building the model.

Make sure you use the best algorithm to train your model and, if needed, change the properties of the algorithm or use “Sweep Parameters” to get better results.

It is also possible to use different algorithms in the same Training Experiment, and then choose the better one according to their results.

Here’s an example of a Training Experiment using two different algorithms to process the same data:

Save, and Run the experiment.

Choose the best algorithm and right click in component “Train Model”, to save the trained model:

Creating a Predictive Model and Setting Up the Web Service

The fastest way to create a Predictive Experiment, is to Set Up the Web Service, choosing the option “Predictive Web Service [Recommended]”:

The Azure Machine Learning will automatically aggregate the Training Experiment and create a Predictive Experiment with the Web Services.

The Web Service is now available in Web Services folder:

Using the Web Service and Predicting Values

Inside the Web Service are available the API key and the URL.

To get the URL, click in BATCH EXECUTION and copy the URL provided:

In Excel Store is possible to get an App inside Data Analytics, or can use the Search to find it easely, and use the Predictive Experiment just created:

 

We can then add the web service provided by the Machine Learning:

Add the API and URL provided by the Machine Learning:

Create a table with the inputs for prediction:

And, finally predict your data, as shown below:

Hope this article was useful to help you creating a Predictive Experiment in Azure Machine Learning.

.
.
.
.
.
.
        Rui Xavier
       Consultant
Blog