Image credit : Microsoft

“No-Code” Machine Learning with Azure ML Designer

By Sagnik Chattopadhyaya

--

The goal of this article is to implement Machine Learning with “No-Code” approach using Azure ML Designer. So to start with, I will show how to create a Machine Learning workspace, how to work with Azure Machine Learning tools then move on to creating a Training Pipeline using Azure ML Designer. This article is a part of the MSP Developer Stories initiative by the Microsoft Student Partners (India) program.

The target is to implement a Machine Learning model without writing any line of Code.

Note: For this you would need a Azure Account and some azure credits. If you are an Student then you can get $100 Azure credit by creating your Azure for student .

Credit: azureml

🚀 Get Started :

1. Let’s start with Creating a Machine Learning Workspace in Azure :

Go to Azure Portal ▶️ Click on Create New Resource ▶️ Search for Machine Learning ▶️ Click Create ▶️ Specify an unique Workspace Name ▶️ Create new Resource Group in the region nearest to you ▶️ Select Enterprise Workspace edition ▶️ Click Create ▶️ After successful creation of the workspace, view it in portal.

Note: Creating Workspace in Enterprise edition would cost you money. but Basic edition does not include capabilities like Auto ML, Data Drift monitoring, ML designer

Creating ML Workspace in Azure

After successfully creation of workspace you will land up to somewhere like this 👇

Resource page

I named my Workspace as AutoMl and the resource group as MlWorkspace. Also in the above picture I have hidden my Subscription ID, Key Vault with Red ink.

For a Data Scientist this page contain a lot of irrelevant information and few links to manage Azure resources in general.

Click on Launch now (You will see something like this marked is in green ink above) to open Azure ML Studio. Else directly visit ml.azure.com . Set this for your workspace and now on you can manage all the ML assets in your workspace from here.

Azure ML gives you the ability to create cloud-based Compute on which you can run training scripts and experiments.

Next I will head to Compute page, from here you will able to manage data science specific compute targets.

Now I will create a compute instance as my workstation to test model. For this move to Compute Instance tab and click on +New to create. Then fulfil the details as asked. For help view the video 👇

Create Compute Instance

So I created a workstation for testing of the Model. Now I need a workstation for training the model.

For this we would switch to Compute Clusters tab and click on +New to create. Then fulfil the details as asked. For help view the video 👇

Create Compute Clusters

There are two more tabs — Inference Clusters and Attached Compute . The first one is for deploying your trained model as a web-service for your client applications to consume.The later is for attaching your databricks or virtual machines that are not in your workspace.

Now I will move to Datastores page. Here you can see two datastores are already present and these were created along the creation of Workspace. These have configuration files, notebooks and data. You can add Azure blob containers, Azure SQL Databases, Azure Data Lakes specific to your project requirement. I won’t wont use this now.

Next I will add dataset for my model to work on. For that I will visit Datasets page and create a new dataset from web file. You can also add dataset from local files or from files in datastore also. Follow the video guideline 👇 for this.

Adding Dataset to Azure ML Studio

If you are wishing to explore the dataset then click on the dataset and then click on Explore to view sample of the dataset.

Up next I will open Jupyter Notebook so that I can start coding. Again go to Compute page and under Compute Instance you can see your compute running. Click on the Jupyter link of your compute instance. It would open up on a new tab.

I will use Azure Machine Learning SDK in my Compute Instance. Azure Machine Learning SDK is already installed in Compute Instance. But to ensure that its updates, I will open a new Terminal and update SDK package.

pip install --upgrade azureml-sdk[notebooks,automl,explain]

Next Close the terminal and in the Jupyter Notebook open Users. Create a new notebook here to connect with your Workspace and view your Azure ML resources.

Follow the next video for all the steps said above.

Updating Azure ML SDK and opening up Notebook

After you have opened up the Notebook successfully (if not, rewatch the ending of the above video)start with some Python Coding now. This coding i just to check whether everything is configured properly or not.

First Check the version of the Azure ML SDK using

import azureml.core
print(“Ready to use Azure ML”, azureml.core.VERSION)

Next task is to connect to the Workspace. For that use the following code

from azureml.core import Workspace

ws = Workspace.from_config()
print(ws.name, "loaded")

After running the above code, you will need to grant permission for connecting Cross-platform application. Just follow the instruction given in the output window of the above code and it will be sorted.

Up next I need to verify that workspace is correctly connected and I can access resources from the workspace. To do so lets view ML resources using following code.

from azureml.core import ComputeTarget, Datastore, Dataset

print("Compute Targets:")
for compute_name in ws.compute_targets:
compute = ws.compute_targets[compute_name]
print("\t", compute.name, ':', compute.type)

print("Datastores:")
for datastore_name in ws.datastores:
datastore = Datastore.get(ws, datastore_name)
print("\t", datastore.name, ':', datastore.datastore_type)

print("Datasets:")
for dataset_name in list(ws.datasets.keys()):
dataset = Dataset.get_by_name(ws, dataset_name)
print("\t", dataset.name)
Connecting Notebook with Workspace

And 💥we have created our workspace and required component successfully.

2. Let’s Create a Training Pipeline with Azure ML Designer

So now the task is to create a designer pipeline and explore the data. To do so view the Designer page and create new Pipeline.

Change the Pipeline name to Visual Diabetes Training from the Settings pane. Specify the compute target, select the dataset and finally visualise it.

The video below shows exact process 👇

Creating Designer Pipeline with Azure ML Design

Before I move to training the data. I need to apply some preprocessing transformations to the data. This is important as here I will specify the normalisation of data, split data in test and train and so on.

Adding Transformations to the Designer

Then I will move on to add training module. Here I will add Two-Class Logistic Regression module as our ML Algorithm and some modules for checking the Score.

Now we will run our Training pipeline. To do so click on Submit on top right corner. Once prompted, like the image below, create a new Experiment named visual-training and the Submit. This would start running our model. Now this will take around 10 mins or longer to run the model.

Running the Pipeline

Wait for all the Modules to complete. Once Evaluate Model is complete (indicated by a ✅ icon), select it and on the Settings pane click on the Outputs + Logs tab. Under Data outputs you will find Evaluation result. Click on Visualise to see all te graphs stating how our Model performed.

The performance of the model isn’t that great, partly because I performed pre-processing and minimal feature engineering.

Go on Exploring more into this section and figure our the most optimal performing model. You can connect the Split Data module to multiple Train Model and Score Model modules, ultimately connecting it to an Evaluate Model module in order to see side-by-side results.

I’m Sagnik Chattopadhyaya, a Microsoft Student Partner. You can Visit my Website to know more about me. Twitter: @sagnik_20

Hope you liked it, please click on the 👏 button below. ❤

Happy Learning! 🐱‍💻

--

--

Sagnik Chattopadhyaya
Sagnik Chattopadhyaya

Written by Sagnik Chattopadhyaya

CS Fresher (looking for a full-time opportunity) | Former Technical Intern at South Eastern Railway | Writes mostly about Azure and Java(Spring Boot)

No responses yet