Advent of 2020, Day 26 – Connecting Azure Machine Learning Services Workspace and Azure Databricks

Series of Azure Databricks posts:

Yesterday we looked into GraphFrames in Azure Databricks and the capabilities of calculating graph data.

Today we will look into Azure Machine Learning services.

What is Azure Machine Learning? It is a cloud-based environment you can use to train, deploy, automate, manage, and track ML models. It can be used for any kind of machine learning, from classical ML to deep learning, supervised, and unsupervised learning.

It supports Python and R code with the SDK and also gives you possibility to use Azure Machine Learning studio designer for “drag&drop” and no-code option. It supports also out-of-the-box tracking experiment, for prediction model workflow, managing, deploying and monitoring models with Azure Machine Learning.

Login to your Azure Portal and select the Databricks services. On the main page of Databricks service in Azure Portal, select “Link Azure ML workspace”

After selecting “Link Azure ML workspace”, you will be prompted to add additional information, mainly because we are connecting two separate services.

And many of these should already be available from previous days (Key Vault, Store Account, Container Registry). You should only create a new application insights.

Click Review + create and Create.

Once completed you can download the deployment script or go directly to resource.

Among the resources, one new resource will be created for you. Go to this resource. You will see, that you will be introduced to Machine Learning Workspace and you can launch Studio.

Since this is the first time setup of this new workspace that has connection to Azure Databricks, you will be prompted additional information about the Active Directory account:

Hit that “Get started” button to launch the Studio.

You will be presented with a brand new Machine Learning Workspace. After you instantiate your workspace, MLflow Tracking is automatically set to be tracked in all of the following places:

  • The linked Azure Machine Learning workspace.
  • Your original ADB workspace.

All your experiments land in the managed Azure Machine Learning tracking service.

Now go to Azure Databricks and add some additional packages. In Azure Databricks under your cluster that we already used for MLflow, install package azureml-mlflow using PyPI.

Linking your ADB workspace to your Azure Machine Learning workspace enables you to track your experiment data in the Azure Machine Learning workspace.

The following code should be in your experiment notebook IN AZURE DATABRICKS (!) to get your linked Azure Machine Learning workspace.

import mlflow
import mlflow.azureml
import azureml.mlflow
import azureml.core

from azureml.core import Workspace

#Your subscription ID that you are running both Databricks and ML Service
subscription_id = 'subscription_id'

# Azure Machine Learning resource group NOT the managed resource group
resource_group = 'resource_group_name' 

#Azure Machine Learning workspace name, NOT Azure Databricks workspace
workspace_name = 'workspace_name'  

# Instantiate Azure Machine Learning workspace
ws = Workspace.get(name=workspace_name,
                   subscription_id=subscription_id,
                   resource_group=resource_group)

#Set MLflow experiment. 
experimentName = "/Users/{user_name}/{experiment_folder}/{experiment_name}" 
mlflow.set_experiment(experimentName) 

If you want your models to be tracked and monitored only in Azure Machine Learning service, add these two lines in Databricks notebook:

uri = ws.get_mlflow_tracking_uri()
mlflow.set_tracking_uri(uri)

Tomorrow we will look how to connect to your Azure databricks Service from your client machine or on-prem machine.

Complete set of code and the Notebook is available at the Github repository.

Happy Coding and Stay Healthy!

Tagged with: , , , , , , , , ,
Posted in Azure Databricks, Uncategorized
9 comments on “Advent of 2020, Day 26 – Connecting Azure Machine Learning Services Workspace and Azure Databricks
  1. […] by data_admin [This article was first published on R – TomazTsql, and kindly contributed to R-bloggers]. (You can report issue about the content on this page […]

    Like

  2. […] article was first published on R – TomazTsql, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) […]

    Like

  3. […] Dec 26: Connecting Azure Machine Learning Services Workspace and Azure Databricks […]

    Like

  4. […] article was first published on R – TomazTsql, and kindly contributed to R-bloggers]. (You can report issue about the content on this page […]

    Like

  5. […] article was first published on R – TomazTsql, and kindly contributed to R-bloggers]. (You can report issue about the content on this page […]

    Liked by 1 person

  6. […] Dec 26: Connecting Azure Machine Learning Services Workspace and Azure Databricks […]

    Liked by 1 person

  7. […] Dec 26: Connecting Azure Machine Learning Services Workspace and Azure Databricks […]

    Liked by 1 person

  8. […] Dec 26: Connecting Azure Machine Learning Services Workspace and Azure Databricks […]

    Liked by 1 person

Leave a comment

Follow TomazTsql on WordPress.com
Programs I Use: SQL Search
Programs I Use: R Studio
Programs I Use: Plan Explorer
Rdeči Noski – Charity

Rdeči noski

100% of donations made here go to charity, no deductions, no fees. For CLOWNDOCTORS - encouraging more joy and happiness to children staying in hospitals (http://www.rednoses.eu/red-noses-organisations/slovenia/)

€2.00

Top SQL Server Bloggers 2018
TomazTsql

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

Discover WordPress

A daily selection of the best content published on WordPress, collected for you by humans who love to read.

Revolutions

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

tenbulls.co.uk

tenbulls.co.uk - attaining enlightenment with the Microsoft Data and Cloud Platforms with a sprinkling of Open Source and supporting technologies!

SQL DBA with A Beard

He's a SQL DBA and he has a beard

Reeves Smith's SQL & BI Blog

A blog about SQL Server and the Microsoft Business Intelligence stack with some random Non-Microsoft tools thrown in for good measure.

SQL Server

for Application Developers

Business Analytics 3.0

Data Driven Business Models

SQL Database Engine Blog

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

Search Msdn

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

R-bloggers

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

R-bloggers

R news and tutorials contributed by hundreds of R bloggers

Data Until I Die!

Data for Life :)

Paul Turley's SQL Server BI Blog

sharing my experiences with the Microsoft data platform, SQL Server BI, Data Modeling, SSAS Design, Power Pivot, Power BI, SSRS Advanced Design, Power BI, Dashboards & Visualization since 2009

Grant Fritchey

Intimidating Databases and Code

Madhivanan's SQL blog

A modern business theme

Alessandro Alpi's Blog

DevOps could be the disease you die with, but don’t die of.

Paul te Braak

Business Intelligence Blog

Sql Insane Asylum (A Blog by Pat Wright)

Information about SQL (PostgreSQL & SQL Server) from the Asylum.

Gareth's Blog

A blog about Life, SQL & Everything ...