You are currently viewing Getting Started with Microsoft Azure Machine Learning
Photo by Alex Knight on Pexels.com

Getting Started with Microsoft Azure Machine Learning

I’ve recently been learning more about Artificial Intelligence (AI) and all the components such as Machine Learning (ML) that fall under that umbrella. I wanted to document how easy it can be to run projects using the Microsoft Azure Machine Learning platform. Now, a little disclaimer here; other platforms do exist but I thought that it would be wise to learn how Microsoft’s services work given their footprint amongst consumers. Furthermore, they also offer a fundamentals AI certification that I might just attempt to complete if I have the time.

Enough of the background information! If you want to follow along with the demonstration in this article you will need a couple of things and I’ve listed them below:

  • Microsoft Azure tenant
    • It would help to have a basic understanding of how Azure works and ML in general.
  • A dataset
    • This will be the dataset we will use to train our machine learning model. The dataset that we have created for this demonstration is based on the following scenario: We want to be able to predict how long customers will likely wait for new car orders based on their order dates. In order to do this, we will use an ML model called ‘Regression’ where all features and labels have been provided based on fictitious data.
    • Our dataset can be downloaded here

The very first thing that we need to do once logged in to Azure is to navigate to ‘Azure Machine Learning’. This is where we will create a new workspace for our project. Click ‘Create workspace’.

Complete the resource details section relative to your environment. The screenshot below shows an example of our configuration.

Click ‘Next’ to move on to Networking. In our demonstration, we will keep our workspace public.

Unless you want to modify any advanced settings, then you can click ‘Review + Create’.

Once the validation has passed then press ‘Create’.

Wait until the deployment has finished before moving on to the next step.

Click ‘Go to resource’.

Click ‘Launch studio’.

We’re going to start by creating an Automated ML Job. Navigate to Create new > Automated ML job

We’re going to use our dataset shared above. Feel free to use our dataset or use your own. Navigate to Create > From web files and paste in the link to the dataset. Give it a name and press ‘next’.

Leave the ‘Settings and preview’ section as is and click ‘Next’.

The Schema can also stay as is. Proceed by pressing ‘Next’.

Press ‘Create’.

Refresh the data asset and you should now see the new data asset created.

Configure a new job with settings relevant to your environment and press ‘Next’ when complete.

In the next section, we want to select ‘Regression’ as our ML model.

Click ‘View additional configuration settings’ and you want to change to exit criteria to ‘0.5’ which is 30 minutes. That way the model won’t be running through the data for its default of 6 hours. Of course, if you have a big dataset then you might want to increase your exit criteria or leave it at the default of 6 hours. Click ‘Next’ once complete.

The ‘Validate and test’ section can remain the same. Simply press ‘Finish’. This will now start a new experiment that will run for approximately 30 minutes before we can move on to the next step. Once the status has changed to complete then proceed with the next steps.

You can examine the output once the job is complete. You can see the algorithm that has been selected (VotingEnsemble) and the time that the job took to run.

Click ‘Model’ to continue.

Click on ‘VotingEnsemble’. This is the model we will use.

You can now see a summary of the model. In our example, we can see that the VotingEnsemble model has good metrics which should in turn produce good results.

Now click ‘Deploy’ and ‘Deploy to web service’.

Fill in the relevant sections and if you want you can change the CPU and RAM reservations for this deployment. Once happy with your settings, press ‘Deploy’.

Navigate and select ‘Endpoints’.

Click on the endpoint that you’ve just deployed. Here you can monitor the status of the deployment.

Once the deployment state has changed to ‘Healthy’ and the Operation state has changed to ‘Running’ you can now click on the ‘Test’ tab. It’s now time to test our new ML model.

We will take the first value from our raw dataset and press ‘Test’.

Test 1 Values Entered

{
  "Inputs": {
    "data": [
      {
        "Country": "UK",
        "Order Date": "Jan-22",
        "Expected Delivery Date": "Dec-22"
      }
    ]
  },
  "GlobalParameters": 1.0
}

Test 1 Result Generated

{
  "Results": [
    11.000000000000002
  ]
}

As you can see, the result generated is 100% accurate and so we know now that our model should have a good chance of predicting delivery lead times for new vehicles.

Test 2 Values Entered

We then added some values that were not in the dataset to see what results would be thrown out. The following values would suggest an expected delivery time of 12 months, however, if we look at the output, we can see that in fact, our model is telling us, that the lead time would be slightly longer based on the dataset that was provided.

Note: This is only a demonstration of some capabilities of using Azure for machine learning. Datasets, features and labels should be thoroughly analysed to get the best and most realistic results.

{
  "Inputs": {
    "data": [
      {
        "Country": "UK",
        "Order Date": "Jan-25",
        "Expected Delivery Date": "Dec-25"
      }
    ]
  },
  "GlobalParameters": 1.0
}

Test 2 Results Generated

{
  "Results": [
    13.97857142857143
  ]
}

In summary, I think Azure ML is a promising platform with some great features to experiment with and I’m looking forward to carrying out some more experiments on this platform. With that said, I am interested in knowing what projects you’re running with Azure ML; please feel free to comment and share anything cool that you may be working on.

iwiizkiid

Kelvin is a Cyber Security professional with years and experience working with organisations in different verticals, both large and small. He enjoys contributing to the Network Wizkid knowledge base and he also creates technical content. Kelvin enjoys learning new things and often does this by working on achieving new technical certifications. He holds many professional certifications and academically, he has achieved a Bachelors and Master's degree in both Computer Networks and Cyber Security.

Leave a Reply