SlideShare a Scribd company logo
1 of 22
Download to read offline
Deploy and serve model from
Azure Databricks
onto Azure Machine Learning
- Reema Kuvadia ( Software Engineer 2)
- Tao Li (Senior Applied Scientist)
Agenda
▪ Model Training and
experimenting
▪ Model Deployment
▪ Model Consumption and Azure
website deployment
Azure Resources
Azure Databricks Azure Blob Storage Azure Machine Learning Azure Kubernetes Azure Web Service
Azure Databricks is an
Apache Spark-based
analytics platform
optimized for the Microsoft
Azure cloud services
platform
Experiment on Azure
Databricks
Model training using
PySpark
Azure Blob storage is a
service for storing large
amounts of unstructured
object data
Published model is stored
in Azure blob storage
Azure machine learning is
a cloud-based service
used to build, test and
deploy predictive analytics
solutions based on your
data
Register the model to
Azure Machine Learning
Azure Kubernetes
Service (AKS) is a
managed container
orchestration service,
based on the open
source Kubernetes system,
which is available on
the Azure public cloud
Create model image and
create endpoint
Microsoft Azure Web Sites
is a cloud computing based
platform for hosting
websites, created and
operated by Microsoft.
Model serve as Web
Service on Azure
Consume model using
RestAPI endpoint
Model Training Model Storing Model Deployment Model Severing
Model
Consumption
Demo 1:
Deployment of Azure Resources
using ARM Template
Session 1: Model Training and Experimenting
Introduction to the problem
▪ The current solutions mostly rely on dictionary/vocabulary, regular expression, and rule-based loop up
and matching to identify the semantic types.
▪ not robust to dirty and complex data
▪ not generalized to diverse data types.
▪
Problem: Correctly detecting the semantic types of data (column of data) is critical for data science
tasks such as data cleaning/normalization, data matching, and data enrichment.
Data Type
D. James, Kevin Louis, Steven Moring, Thomas V. Beard Name
Chicago, Seattle, Tenn, TBA Location
2019-10-12, Oct 12, 2019, 10/12/2019, 20191012 Date
Model E2E Flow
…
Data
…
App
Model Training
Experiment on Azure
Databricks
Model training using
PySpark
Azure Databricks
PySpark
Model Packaging
Package model using
MLeap
Publish model to azure
blob storage
Azure Blob Storage
Define Deployment
Define model environment
and dependencies
Prepare Scoring script
Visual Studio Code
Register the model to
Azure Machine Learning
Create model image
Deploy to azure
Kubernetes web service
Model Deployment
Azure Machine
Learning
Azure Kubernetes
Serve & Consume
Model serve as Web
Service on Azure
Consume model using
RestAPI endpoint
Azure Web Service
Model Architecture and Training
▪ Featurization
▪ Embedding Dataframe lookup in memory
▪ Spark SQL for featurization using UDF (user-defined function)
Multi-class Classification using Random Forest
▪ Modeling
▪
▪
text
Web Table:
Bing RetroIndex
Public Table:
Paper Data
Customer Table:
Demo Data
First Name Date Phone
John
Michael
...
Richard
2015-11-19 1-925-226-7368x212
08/15/2015 830-115-4090
... ...
May 27, 2016 (067)681-4908
1. Data Source &Table repository 2. Tabular Data & Features
Header Embeddings
Character Distributions
Word Embeddings
Global Statistics
Header statistics
Feature Extraction
(Data)
Column Data
Column Header
Feature Extraction
(Header)
Label Extraction
...
Person
.FirstName
Calendar
.Date
Identity.Service
.Phone
...
Features Labels
concatenate
Label Cleaning
3. Training and Testing 4. Semantic Type Detection
Training
Testing
Table for scoring
ML Model
Predicted Type
+
Confidence Score
Location.City: 0.8
NA: 0.6
Calendar.Year: 0.9
Excel Table
...
Demo 2:
Training the model using Azure Databricks
Session 2: Model Deployment
Model Deployment
▪ Model training on Azure Databricks.
▪ Package model and publish into Azure Blob
Storage
▪ Prerequisites
▪ AML (Azure Machine Learning) Workspace
▪ AKS (Azure Kubernetes Service) Cluster
▪ Azure Machine Learning and Storage SDK
▪ Model Registry
Registering a model to store, version, and track metadata about
models in your workspace.
▪ Define deployment
▪ Scoring File (named score.py)
▪ Loads the model when the deployed service starts.
▪ Receiving data, passing it to the model, and then returning
a response.
▪ AML environment. (software dependencies and libraries)
▪ Deploy the model
▪ Create the image
▪ Config the entry script and environment
▪ Config Runtime (runtime="spark-py")
▪ CPU and Memory
▪ Deploy image as a web app
▪ Deploy the model to AKS cluster
▪ Get model endpoint
▪ Consume the model
▪ Use the model via SDK
▪ Use the model via Endpoints
Scoring File (Score.py)
▪ init():
▪ This function loads the model into a global object.
▪ This function is run only once, when the Docker container
start the web service.
The entry script receives data submitted to a deployed web service and passes it to the model. It then
takes the response returned by the model and returns that to the client. The script contains two
functions that load and run the model:
def run(input_data):
try:
data = json.loads(input_data)['data’]
features = Featurization_new(data)
feature_df = spark.createDataFrame([features,], names)
predictions_raw = model.transform(feature_df)
predictions = predictions_raw.select("prediction", "features")
#Get each scored result
predictions = predictions.collect()
preds = [str(x['prediction']) for x in predictions]
return preds[0]
except Exception as e:
def init():
global spark
global model
global word_to_embedding
spark = SparkSession.builder.getOrCreate()
model_path = Model.get_model_path('semantic_mapping_model')
model = PipelineModel.load(model_path)
embedding_path = Model.get_model_path('word_to_embedding.pkl')
file = open(embedding_path, 'rb')
word_to_embedding = pickle.load(file)
file.close()
▪ run(input_data):
▪ This function uses the model to predict a value based on
the input data.
▪ Inputs and outputs of the run typically use JSON for
serialization and deserialization.
Demo 3:
Model Deployment using
Azure Machine Learning
Session 3: Model Consumption
Model Consumption and Website Deployment
▪ Registration:
▪ To register model we need following:
▪ Path: (string) location of model
▪ Name: (string) model name
▪ Description: (string) that describes the model
▪ Worskapce: (string) name of workspace that we want
to consume in webservice.
In this script we register the model, create or use existing environment using YAML file.
Then deploy model as Webservice on AKS which will create and endpoint, that we consume in the
website.
name : project_environment
dependencies :
- python=3.6.2
- pip:
- azureml-defaults
- scikit-learn
- numpy
- inference-schema[numpy-support]
from azureml.core.model import Model
embedding = Model(ws, 'word_to_embedding.pkl')
if not embedding:
embedding = Model.register(model_path="./model/word_to_embedding.pkl
",
model_name="word_to_embedding.pkl",
description="Word to embedding",
workspacee=ws)
▪ Environment config file:
▪ You can now create and/or use an Environment object
when deploying a Webservice. The Environment can have
been previously registered with your Workspace, or it will
be registered with it as a part of the Webservice
deployment.
Application Demo
Semantic Mapping
Automatically
detects the correct
Attribute Type
And can prevent
possible human error
(due to data input or
miss-understanding)
Demo 4:
Model consumption by creating
endpoint in AKS and consuming
it using Azure Web Service
Summary
▪ Spark APIs we used are:
▪ Spark SQL and UDF (User Defined Functions) for
featurization
▪
▪ Microsoft Azure for making it
seamless to integrate with 3rd
party platforms
References
▪ Databricks
▪ https://docs.microsoft.com/en-us/azure/azure-databricks/quickstart-create-databricks-workspace-resource-manager-template
▪ https://github.com/Azure/azure-quickstart-templates/tree/master/101-databricks-all-in-one-template-for-vnet-injection
▪ Azure Blob Storage
▪ https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal
▪ https://github.com/Azure/azure-quickstart-templates/tree/master/101-storage-blob-container
▪ Azure Machine Learning
▪ https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/machine-learning/studio/deploy-with-resource-manager-
template.md
▪ https://docs.microsoft.com/en-us/azure/machine-learning/tutorial-1st-experiment-sdk-setup
▪ Azure Website Deployment
▪ https://docs.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-to-azure?view=vs-2019&viewFallbackFrom=vs-
2019%E2%80%8B
Feedback
Your feedback is important to us.
Don’t forget to rate and
review the sessions.
Deploy Spark model from Azure Databricks to Azure ML

More Related Content

What's hot

MLOps Virtual Event: Automating ML at Scale
MLOps Virtual Event: Automating ML at ScaleMLOps Virtual Event: Automating ML at Scale
MLOps Virtual Event: Automating ML at ScaleDatabricks
 
Machine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and KubernetesMachine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and KubernetesArun Gupta
 
Databricks Platform.pptx
Databricks Platform.pptxDatabricks Platform.pptx
Databricks Platform.pptxAlex Ivy
 
DevOps for Databricks
DevOps for DatabricksDevOps for Databricks
DevOps for DatabricksDatabricks
 
MLOps Virtual Event | Building Machine Learning Platforms for the Full Lifecycle
MLOps Virtual Event | Building Machine Learning Platforms for the Full LifecycleMLOps Virtual Event | Building Machine Learning Platforms for the Full Lifecycle
MLOps Virtual Event | Building Machine Learning Platforms for the Full LifecycleDatabricks
 
Why do the majority of Data Science projects never make it to production?
Why do the majority of Data Science projects never make it to production?Why do the majority of Data Science projects never make it to production?
Why do the majority of Data Science projects never make it to production?Itai Yaffe
 
Azure DataBricks for Data Engineering by Eugene Polonichko
Azure DataBricks for Data Engineering by Eugene PolonichkoAzure DataBricks for Data Engineering by Eugene Polonichko
Azure DataBricks for Data Engineering by Eugene PolonichkoDimko Zhluktenko
 
Using MLOps to Bring ML to Production/The Promise of MLOps
Using MLOps to Bring ML to Production/The Promise of MLOpsUsing MLOps to Bring ML to Production/The Promise of MLOps
Using MLOps to Bring ML to Production/The Promise of MLOpsWeaveworks
 
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of HadoopDatabricks
 
Databricks Fundamentals
Databricks FundamentalsDatabricks Fundamentals
Databricks FundamentalsDalibor Wijas
 
Data Catalog & ETL - Glue & Athena
Data Catalog & ETL - Glue & AthenaData Catalog & ETL - Glue & Athena
Data Catalog & ETL - Glue & AthenaAmazon Web Services
 
Big data on google cloud
Big data on google cloudBig data on google cloud
Big data on google cloudTu Pham
 
End to end Machine Learning using Kubeflow - Build, Train, Deploy and Manage
End to end Machine Learning using Kubeflow - Build, Train, Deploy and ManageEnd to end Machine Learning using Kubeflow - Build, Train, Deploy and Manage
End to end Machine Learning using Kubeflow - Build, Train, Deploy and ManageAnimesh Singh
 
AWS Data Analytics on AWS
AWS Data Analytics on AWSAWS Data Analytics on AWS
AWS Data Analytics on AWSsampath439572
 
Apache Spark on K8S Best Practice and Performance in the Cloud
Apache Spark on K8S Best Practice and Performance in the CloudApache Spark on K8S Best Practice and Performance in the Cloud
Apache Spark on K8S Best Practice and Performance in the CloudDatabricks
 
Getting Started with Amazon QuickSight
Getting Started with Amazon QuickSightGetting Started with Amazon QuickSight
Getting Started with Amazon QuickSightAmazon Web Services
 
Rahat Yasir: Enterprise Data & AI Strategy & Platform Designing
Rahat Yasir: Enterprise Data & AI Strategy & Platform DesigningRahat Yasir: Enterprise Data & AI Strategy & Platform Designing
Rahat Yasir: Enterprise Data & AI Strategy & Platform DesigningLviv Startup Club
 
Simplifying Model Management with MLflow
Simplifying Model Management with MLflowSimplifying Model Management with MLflow
Simplifying Model Management with MLflowDatabricks
 

What's hot (20)

MLOps Virtual Event: Automating ML at Scale
MLOps Virtual Event: Automating ML at ScaleMLOps Virtual Event: Automating ML at Scale
MLOps Virtual Event: Automating ML at Scale
 
Machine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and KubernetesMachine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and Kubernetes
 
Databricks Platform.pptx
Databricks Platform.pptxDatabricks Platform.pptx
Databricks Platform.pptx
 
DevOps for Databricks
DevOps for DatabricksDevOps for Databricks
DevOps for Databricks
 
MLOps Virtual Event | Building Machine Learning Platforms for the Full Lifecycle
MLOps Virtual Event | Building Machine Learning Platforms for the Full LifecycleMLOps Virtual Event | Building Machine Learning Platforms for the Full Lifecycle
MLOps Virtual Event | Building Machine Learning Platforms for the Full Lifecycle
 
Why do the majority of Data Science projects never make it to production?
Why do the majority of Data Science projects never make it to production?Why do the majority of Data Science projects never make it to production?
Why do the majority of Data Science projects never make it to production?
 
Azure DataBricks for Data Engineering by Eugene Polonichko
Azure DataBricks for Data Engineering by Eugene PolonichkoAzure DataBricks for Data Engineering by Eugene Polonichko
Azure DataBricks for Data Engineering by Eugene Polonichko
 
Using MLOps to Bring ML to Production/The Promise of MLOps
Using MLOps to Bring ML to Production/The Promise of MLOpsUsing MLOps to Bring ML to Production/The Promise of MLOps
Using MLOps to Bring ML to Production/The Promise of MLOps
 
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
 
Databricks Fundamentals
Databricks FundamentalsDatabricks Fundamentals
Databricks Fundamentals
 
Data Catalog & ETL - Glue & Athena
Data Catalog & ETL - Glue & AthenaData Catalog & ETL - Glue & Athena
Data Catalog & ETL - Glue & Athena
 
Big data on google cloud
Big data on google cloudBig data on google cloud
Big data on google cloud
 
End to end Machine Learning using Kubeflow - Build, Train, Deploy and Manage
End to end Machine Learning using Kubeflow - Build, Train, Deploy and ManageEnd to end Machine Learning using Kubeflow - Build, Train, Deploy and Manage
End to end Machine Learning using Kubeflow - Build, Train, Deploy and Manage
 
AWS Data Analytics on AWS
AWS Data Analytics on AWSAWS Data Analytics on AWS
AWS Data Analytics on AWS
 
Apache Spark on K8S Best Practice and Performance in the Cloud
Apache Spark on K8S Best Practice and Performance in the CloudApache Spark on K8S Best Practice and Performance in the Cloud
Apache Spark on K8S Best Practice and Performance in the Cloud
 
MLOps with Kubeflow
MLOps with Kubeflow MLOps with Kubeflow
MLOps with Kubeflow
 
Getting Started with Amazon QuickSight
Getting Started with Amazon QuickSightGetting Started with Amazon QuickSight
Getting Started with Amazon QuickSight
 
Rahat Yasir: Enterprise Data & AI Strategy & Platform Designing
Rahat Yasir: Enterprise Data & AI Strategy & Platform DesigningRahat Yasir: Enterprise Data & AI Strategy & Platform Designing
Rahat Yasir: Enterprise Data & AI Strategy & Platform Designing
 
Simplifying Model Management with MLflow
Simplifying Model Management with MLflowSimplifying Model Management with MLflow
Simplifying Model Management with MLflow
 
MLOps for production-level machine learning
MLOps for production-level machine learningMLOps for production-level machine learning
MLOps for production-level machine learning
 

Similar to Deploy Spark model from Azure Databricks to Azure ML

Azure machine learning service
Azure machine learning serviceAzure machine learning service
Azure machine learning serviceRuth Yakubu
 
I want my model to be deployed ! (another story of MLOps)
I want my model to be deployed ! (another story of MLOps)I want my model to be deployed ! (another story of MLOps)
I want my model to be deployed ! (another story of MLOps)AZUG FR
 
Machine Learning Use Case - Agriculture
Machine Learning Use Case - AgricultureMachine Learning Use Case - Agriculture
Machine Learning Use Case - AgricultureNilabja GhoshChowdhury
 
Shift Remote AI: Build and deploy PyTorch Models with Azure Machine Learning ...
Shift Remote AI: Build and deploy PyTorch Models with Azure Machine Learning ...Shift Remote AI: Build and deploy PyTorch Models with Azure Machine Learning ...
Shift Remote AI: Build and deploy PyTorch Models with Azure Machine Learning ...Shift Conference
 
Build and deploy PyTorch models with Azure Machine Learning - Henk - CCDays
Build and deploy PyTorch models with Azure Machine Learning - Henk - CCDaysBuild and deploy PyTorch models with Azure Machine Learning - Henk - CCDays
Build and deploy PyTorch models with Azure Machine Learning - Henk - CCDaysCodeOps Technologies LLP
 
Train, predict, serve: How to go into production your machine learning model
Train, predict, serve: How to go into production your machine learning modelTrain, predict, serve: How to go into production your machine learning model
Train, predict, serve: How to go into production your machine learning modelCloudera Japan
 
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...Sotrender
 
How to Train Your Classifier: Create a Serverless Machine Learning System wit...
How to Train Your Classifier: Create a Serverless Machine Learning System wit...How to Train Your Classifier: Create a Serverless Machine Learning System wit...
How to Train Your Classifier: Create a Serverless Machine Learning System wit...Stuart Myles
 
Productionizing Machine Learning Pipelines with Databricks and Azure ML
Productionizing Machine Learning Pipelines with Databricks and Azure MLProductionizing Machine Learning Pipelines with Databricks and Azure ML
Productionizing Machine Learning Pipelines with Databricks and Azure MLDatabricks
 
Unsupervised Aspect Based Sentiment Analysis at Scale
Unsupervised Aspect Based Sentiment Analysis at ScaleUnsupervised Aspect Based Sentiment Analysis at Scale
Unsupervised Aspect Based Sentiment Analysis at ScaleAaron (Ari) Bornstein
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien
 
AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings Adam Book
 
ML_Development_with_Sagemaker.pptx
ML_Development_with_Sagemaker.pptxML_Development_with_Sagemaker.pptx
ML_Development_with_Sagemaker.pptxTemiReply
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated MLMark Tabladillo
 
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...SQUADEX
 
10 things I’ve learnt In the clouds
10 things I’ve learnt In the clouds10 things I’ve learnt In the clouds
10 things I’ve learnt In the cloudsStuart Lodge
 
Azuresatpn19 - An Introduction To Azure Data Factory
Azuresatpn19 - An Introduction To Azure Data FactoryAzuresatpn19 - An Introduction To Azure Data Factory
Azuresatpn19 - An Introduction To Azure Data FactoryRiccardo Perico
 
AI with Azure Machine Learning
AI with Azure Machine LearningAI with Azure Machine Learning
AI with Azure Machine LearningGeert Baeke
 

Similar to Deploy Spark model from Azure Databricks to Azure ML (20)

Azure machine learning service
Azure machine learning serviceAzure machine learning service
Azure machine learning service
 
I want my model to be deployed ! (another story of MLOps)
I want my model to be deployed ! (another story of MLOps)I want my model to be deployed ! (another story of MLOps)
I want my model to be deployed ! (another story of MLOps)
 
Machine Learning Use Case - Agriculture
Machine Learning Use Case - AgricultureMachine Learning Use Case - Agriculture
Machine Learning Use Case - Agriculture
 
Shift Remote AI: Build and deploy PyTorch Models with Azure Machine Learning ...
Shift Remote AI: Build and deploy PyTorch Models with Azure Machine Learning ...Shift Remote AI: Build and deploy PyTorch Models with Azure Machine Learning ...
Shift Remote AI: Build and deploy PyTorch Models with Azure Machine Learning ...
 
Build and deploy PyTorch models with Azure Machine Learning - Henk - CCDays
Build and deploy PyTorch models with Azure Machine Learning - Henk - CCDaysBuild and deploy PyTorch models with Azure Machine Learning - Henk - CCDays
Build and deploy PyTorch models with Azure Machine Learning - Henk - CCDays
 
Train, predict, serve: How to go into production your machine learning model
Train, predict, serve: How to go into production your machine learning modelTrain, predict, serve: How to go into production your machine learning model
Train, predict, serve: How to go into production your machine learning model
 
Kraken at DevCon TLV
Kraken at DevCon TLVKraken at DevCon TLV
Kraken at DevCon TLV
 
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
 
How to Train Your Classifier: Create a Serverless Machine Learning System wit...
How to Train Your Classifier: Create a Serverless Machine Learning System wit...How to Train Your Classifier: Create a Serverless Machine Learning System wit...
How to Train Your Classifier: Create a Serverless Machine Learning System wit...
 
Productionizing Machine Learning Pipelines with Databricks and Azure ML
Productionizing Machine Learning Pipelines with Databricks and Azure MLProductionizing Machine Learning Pipelines with Databricks and Azure ML
Productionizing Machine Learning Pipelines with Databricks and Azure ML
 
Unsupervised Aspect Based Sentiment Analysis at Scale
Unsupervised Aspect Based Sentiment Analysis at ScaleUnsupervised Aspect Based Sentiment Analysis at Scale
Unsupervised Aspect Based Sentiment Analysis at Scale
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
 
Azure App Services
Azure App ServicesAzure App Services
Azure App Services
 
AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings
 
ML_Development_with_Sagemaker.pptx
ML_Development_with_Sagemaker.pptxML_Development_with_Sagemaker.pptx
ML_Development_with_Sagemaker.pptx
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated ML
 
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...
 
10 things I’ve learnt In the clouds
10 things I’ve learnt In the clouds10 things I’ve learnt In the clouds
10 things I’ve learnt In the clouds
 
Azuresatpn19 - An Introduction To Azure Data Factory
Azuresatpn19 - An Introduction To Azure Data FactoryAzuresatpn19 - An Introduction To Azure Data Factory
Azuresatpn19 - An Introduction To Azure Data Factory
 
AI with Azure Machine Learning
AI with Azure Machine LearningAI with Azure Machine Learning
AI with Azure Machine Learning
 

More from Databricks

DW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDatabricks
 
Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1Databricks
 
Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2Databricks
 
Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Databricks
 
Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Databricks
 
Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDatabricks
 
Learn to Use Databricks for Data Science
Learn to Use Databricks for Data ScienceLearn to Use Databricks for Data Science
Learn to Use Databricks for Data ScienceDatabricks
 
Why APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML MonitoringWhy APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML MonitoringDatabricks
 
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch FixThe Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch FixDatabricks
 
Stage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationStage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationDatabricks
 
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchSimplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchDatabricks
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesScaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesDatabricks
 
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark PipelinesScaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark PipelinesDatabricks
 
Sawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsSawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsDatabricks
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkRedis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkDatabricks
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkDatabricks
 
Raven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesRaven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesDatabricks
 
Processing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkProcessing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkDatabricks
 
Massive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeMassive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeDatabricks
 
Machine Learning CI/CD for Email Attack Detection
Machine Learning CI/CD for Email Attack DetectionMachine Learning CI/CD for Email Attack Detection
Machine Learning CI/CD for Email Attack DetectionDatabricks
 

More from Databricks (20)

DW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptx
 
Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1
 
Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2
 
Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2
 
Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4
 
Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized Platform
 
Learn to Use Databricks for Data Science
Learn to Use Databricks for Data ScienceLearn to Use Databricks for Data Science
Learn to Use Databricks for Data Science
 
Why APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML MonitoringWhy APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML Monitoring
 
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch FixThe Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
 
Stage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationStage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI Integration
 
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchSimplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorch
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesScaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on Kubernetes
 
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark PipelinesScaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
 
Sawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsSawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature Aggregations
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkRedis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and Spark
 
Raven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesRaven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction Queries
 
Processing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkProcessing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache Spark
 
Massive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeMassive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta Lake
 
Machine Learning CI/CD for Email Attack Detection
Machine Learning CI/CD for Email Attack DetectionMachine Learning CI/CD for Email Attack Detection
Machine Learning CI/CD for Email Attack Detection
 

Recently uploaded

ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our WorldEduminds Learning
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改yuu sss
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryJeremy Anderson
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectBoston Institute of Analytics
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfchwongval
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 217djon017
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanMYRABACSAFRA2
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.natarajan8993
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPTBoston Institute of Analytics
 
Machine learning classification ppt.ppt
Machine learning classification  ppt.pptMachine learning classification  ppt.ppt
Machine learning classification ppt.pptamreenkhanum0307
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Seán Kennedy
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理e4aez8ss
 

Recently uploaded (20)

ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our World
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data Story
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis Project
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdf
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population Mean
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
 
Machine learning classification ppt.ppt
Machine learning classification  ppt.pptMachine learning classification  ppt.ppt
Machine learning classification ppt.ppt
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
 

Deploy Spark model from Azure Databricks to Azure ML

  • 1.
  • 2. Deploy and serve model from Azure Databricks onto Azure Machine Learning - Reema Kuvadia ( Software Engineer 2) - Tao Li (Senior Applied Scientist)
  • 3. Agenda ▪ Model Training and experimenting ▪ Model Deployment ▪ Model Consumption and Azure website deployment
  • 4. Azure Resources Azure Databricks Azure Blob Storage Azure Machine Learning Azure Kubernetes Azure Web Service Azure Databricks is an Apache Spark-based analytics platform optimized for the Microsoft Azure cloud services platform Experiment on Azure Databricks Model training using PySpark Azure Blob storage is a service for storing large amounts of unstructured object data Published model is stored in Azure blob storage Azure machine learning is a cloud-based service used to build, test and deploy predictive analytics solutions based on your data Register the model to Azure Machine Learning Azure Kubernetes Service (AKS) is a managed container orchestration service, based on the open source Kubernetes system, which is available on the Azure public cloud Create model image and create endpoint Microsoft Azure Web Sites is a cloud computing based platform for hosting websites, created and operated by Microsoft. Model serve as Web Service on Azure Consume model using RestAPI endpoint Model Training Model Storing Model Deployment Model Severing Model Consumption
  • 5. Demo 1: Deployment of Azure Resources using ARM Template
  • 6. Session 1: Model Training and Experimenting
  • 7. Introduction to the problem ▪ The current solutions mostly rely on dictionary/vocabulary, regular expression, and rule-based loop up and matching to identify the semantic types. ▪ not robust to dirty and complex data ▪ not generalized to diverse data types. ▪ Problem: Correctly detecting the semantic types of data (column of data) is critical for data science tasks such as data cleaning/normalization, data matching, and data enrichment. Data Type D. James, Kevin Louis, Steven Moring, Thomas V. Beard Name Chicago, Seattle, Tenn, TBA Location 2019-10-12, Oct 12, 2019, 10/12/2019, 20191012 Date
  • 8. Model E2E Flow … Data … App Model Training Experiment on Azure Databricks Model training using PySpark Azure Databricks PySpark Model Packaging Package model using MLeap Publish model to azure blob storage Azure Blob Storage Define Deployment Define model environment and dependencies Prepare Scoring script Visual Studio Code Register the model to Azure Machine Learning Create model image Deploy to azure Kubernetes web service Model Deployment Azure Machine Learning Azure Kubernetes Serve & Consume Model serve as Web Service on Azure Consume model using RestAPI endpoint Azure Web Service
  • 9. Model Architecture and Training ▪ Featurization ▪ Embedding Dataframe lookup in memory ▪ Spark SQL for featurization using UDF (user-defined function) Multi-class Classification using Random Forest ▪ Modeling ▪ ▪ text Web Table: Bing RetroIndex Public Table: Paper Data Customer Table: Demo Data First Name Date Phone John Michael ... Richard 2015-11-19 1-925-226-7368x212 08/15/2015 830-115-4090 ... ... May 27, 2016 (067)681-4908 1. Data Source &Table repository 2. Tabular Data & Features Header Embeddings Character Distributions Word Embeddings Global Statistics Header statistics Feature Extraction (Data) Column Data Column Header Feature Extraction (Header) Label Extraction ... Person .FirstName Calendar .Date Identity.Service .Phone ... Features Labels concatenate Label Cleaning 3. Training and Testing 4. Semantic Type Detection Training Testing Table for scoring ML Model Predicted Type + Confidence Score Location.City: 0.8 NA: 0.6 Calendar.Year: 0.9 Excel Table ...
  • 10. Demo 2: Training the model using Azure Databricks
  • 11. Session 2: Model Deployment
  • 12. Model Deployment ▪ Model training on Azure Databricks. ▪ Package model and publish into Azure Blob Storage ▪ Prerequisites ▪ AML (Azure Machine Learning) Workspace ▪ AKS (Azure Kubernetes Service) Cluster ▪ Azure Machine Learning and Storage SDK ▪ Model Registry Registering a model to store, version, and track metadata about models in your workspace. ▪ Define deployment ▪ Scoring File (named score.py) ▪ Loads the model when the deployed service starts. ▪ Receiving data, passing it to the model, and then returning a response. ▪ AML environment. (software dependencies and libraries) ▪ Deploy the model ▪ Create the image ▪ Config the entry script and environment ▪ Config Runtime (runtime="spark-py") ▪ CPU and Memory ▪ Deploy image as a web app ▪ Deploy the model to AKS cluster ▪ Get model endpoint ▪ Consume the model ▪ Use the model via SDK ▪ Use the model via Endpoints
  • 13. Scoring File (Score.py) ▪ init(): ▪ This function loads the model into a global object. ▪ This function is run only once, when the Docker container start the web service. The entry script receives data submitted to a deployed web service and passes it to the model. It then takes the response returned by the model and returns that to the client. The script contains two functions that load and run the model: def run(input_data): try: data = json.loads(input_data)['data’] features = Featurization_new(data) feature_df = spark.createDataFrame([features,], names) predictions_raw = model.transform(feature_df) predictions = predictions_raw.select("prediction", "features") #Get each scored result predictions = predictions.collect() preds = [str(x['prediction']) for x in predictions] return preds[0] except Exception as e: def init(): global spark global model global word_to_embedding spark = SparkSession.builder.getOrCreate() model_path = Model.get_model_path('semantic_mapping_model') model = PipelineModel.load(model_path) embedding_path = Model.get_model_path('word_to_embedding.pkl') file = open(embedding_path, 'rb') word_to_embedding = pickle.load(file) file.close() ▪ run(input_data): ▪ This function uses the model to predict a value based on the input data. ▪ Inputs and outputs of the run typically use JSON for serialization and deserialization.
  • 14. Demo 3: Model Deployment using Azure Machine Learning
  • 15. Session 3: Model Consumption
  • 16. Model Consumption and Website Deployment ▪ Registration: ▪ To register model we need following: ▪ Path: (string) location of model ▪ Name: (string) model name ▪ Description: (string) that describes the model ▪ Worskapce: (string) name of workspace that we want to consume in webservice. In this script we register the model, create or use existing environment using YAML file. Then deploy model as Webservice on AKS which will create and endpoint, that we consume in the website. name : project_environment dependencies : - python=3.6.2 - pip: - azureml-defaults - scikit-learn - numpy - inference-schema[numpy-support] from azureml.core.model import Model embedding = Model(ws, 'word_to_embedding.pkl') if not embedding: embedding = Model.register(model_path="./model/word_to_embedding.pkl ", model_name="word_to_embedding.pkl", description="Word to embedding", workspacee=ws) ▪ Environment config file: ▪ You can now create and/or use an Environment object when deploying a Webservice. The Environment can have been previously registered with your Workspace, or it will be registered with it as a part of the Webservice deployment.
  • 17. Application Demo Semantic Mapping Automatically detects the correct Attribute Type And can prevent possible human error (due to data input or miss-understanding)
  • 18. Demo 4: Model consumption by creating endpoint in AKS and consuming it using Azure Web Service
  • 19. Summary ▪ Spark APIs we used are: ▪ Spark SQL and UDF (User Defined Functions) for featurization ▪ ▪ Microsoft Azure for making it seamless to integrate with 3rd party platforms
  • 20. References ▪ Databricks ▪ https://docs.microsoft.com/en-us/azure/azure-databricks/quickstart-create-databricks-workspace-resource-manager-template ▪ https://github.com/Azure/azure-quickstart-templates/tree/master/101-databricks-all-in-one-template-for-vnet-injection ▪ Azure Blob Storage ▪ https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal ▪ https://github.com/Azure/azure-quickstart-templates/tree/master/101-storage-blob-container ▪ Azure Machine Learning ▪ https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/machine-learning/studio/deploy-with-resource-manager- template.md ▪ https://docs.microsoft.com/en-us/azure/machine-learning/tutorial-1st-experiment-sdk-setup ▪ Azure Website Deployment ▪ https://docs.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-to-azure?view=vs-2019&viewFallbackFrom=vs- 2019%E2%80%8B
  • 21. Feedback Your feedback is important to us. Don’t forget to rate and review the sessions.