Getting started with Azure Machine Learning
Tags: azure, microsoft, machinelearning, cloud
Published: 2021-08-20 05:32:43

In this second part of the Azure Machine Learning Series, we will discuss the following with regards to Azure Machine Learning.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ymi0lzc67et6tcsyxw4.png)
 

## Understanding Machine learning Workflows

We will see a quick recap of the introductory blog on Machine Learning. The workflows involved in Machine Learning are as follows

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/87u2ofabeevb7wbl1nqw.png)
 
## Challenges in MLOps

- Logically create, maintain the resources
- Keep track of ML Experiments and each Runs of experiments  - Create, Reuse, delete environment with dependencies
- Opting, provisioning, re-using Local/Cloud based compute
- Maintaining different versions of Model
- Re-using the existing ML workflows
- Deploying and Maintaining the ML models  

## Tools to perform Machine Learning in Azure

- Azure Portal  
   - Azure Machine Learning Studio (UI + Coding)  
   - Azure Machine Learning Designer (Completely UI + less coding)
- Azure CLI  
- Azure Python SDK  
   - Using Azure ML Studio  
   - Visual Studio Code + AzureML Extensions
   - Other IDEs  

## Architecture of Azure Machine Learning

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ytgnzqnmdi53ubvokp8g.png)
 
## Before we get started...

### Pre-requisites
- Basic Python programming Language
- Understanding of Machine Learning Workflows

### Setup
- Azure Account with Subscription
![Azure Sub](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/403lekyfbyha9orlq3s6.png)
- Create a Machine Learning Resource.
![create ml](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qxkmq6hlbulv1bc0wzeq.png)
- Provide a name for the workspace, Container Register
- Launch the Machine Learning Studio
- Create Compute Resource
    1. On the left side, under Manage, select Compute.
    2. Select +New to create a new compute instance.
    3. Keep all the defaults on the first page, select Next.
    4. Supply a name and select Create.
    5. In about two minutes, you'll see the State of the    compute instance change from Creating to Running. It's now ready to go.
- Create Dataset

   You can create datasets from datastores, public URLs, and Azure Open Datasets.

- Launch a Notebook instance

You can follow this [doc](https://docs.microsoft.com/en-us/azure/machine-learning/quickstart-create-resources) to create necessary Azure ML Resources

## Creating Azure ML Resources

### Workspace

An Azure ML Workspace is an Azure resource that organizes and coordinates the actions of many other Azure resources to assist in executing and sharing machine learning workflows. In particular, an Azure ML Workspace coordinates storage, databases, and compute resources providing added functionality for machine learning experimentation, deployment, inference, and the monitoring of deployed models.

You can create/access workspace by
- Using Constructor
- Using config.json file

{% gist https://gist.github.com/Vivek0712/8769cea65c86ae15c471e001578d361a

%}

### Compute

All ML Experiments requires Compute to execute. To Create / Access the Compute Resource use ComputeTarget Class

{% gist
https://gist.github.com/Vivek0712/74ae6c72fe6fcb89a6607f89cdfbb7f6
%}

### Experiment

In Azure Machine Learning, an experiment is a named process, usually the running of a script or a pipeline, that can generate metrics and outputs and be tracked in the Azure Machine Learning workspace.

*Create Experiment*
An experiment can be run multiple times, with different data, code, or settings; and Azure Machine Learning tracks each run, enabling you to view run history and compare results for each run.

### The Experiment Run Context
When you submit an experiment, you use its run context to initialize and end the experiment run that is tracked in Azure Machine Learning
You can log, monitor every run in the experiment.

{% gist https://gist.github.com/Vivek0712/c2de1ac618a2732c412fc360cd0ddded %}

### Data


Data
Any Machine Learning problems involves working with Data.
It involves importing the data from the data source
Registering, Maintaining the dataset in Data Store
Versioning the dataset. You can learn more about Datasets [here](https://docs.microsoft.com/en-us/azure/machine-learning/how-to-create-register-datasets)

{% gist https://gist.github.com/Vivek0712/b1318ed0436ea279f771af73514de147 %}

Now we have all the necessary resources to train, deploy and monitor ML Models. 

Stay tuned for the next blog in this series for the same.