All Projects → microsoft → az-ml-realtime-score

microsoft / az-ml-realtime-score

Licence: MIT license
Architecture for deploying real-time scoring of machine learning models using Azure Machine Learning

Programming Languages

Jupyter Notebook
11667 projects
Makefile
30231 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to az-ml-realtime-score

hi-ml
HI-ML toolbox for deep learning for medical imaging and Azure integration
Stars: ✭ 150 (+275%)
Mutual labels:  azureml
Machinelearningnotebooks
Python notebooks with ML and deep learning examples with Azure Machine Learning Python SDK | Microsoft
Stars: ✭ 2,790 (+6875%)
Mutual labels:  azureml
DistributedDeepLearning
Distributed Deep Learning using AzureML
Stars: ✭ 36 (-10%)
Mutual labels:  azureml
az-ml-batch-score
Deploying a Batch Scoring Pipeline for Python Models
Stars: ✭ 17 (-57.5%)
Mutual labels:  azureml
az-deep-realtime-score
AKS Deployment Tutorial
Stars: ✭ 33 (-17.5%)
Mutual labels:  azureml
MLOps VideoAnomalyDetection
Operationalize a video anomaly detection model with Azure ML
Stars: ✭ 102 (+155%)
Mutual labels:  azureml
mlops-platforms
Compare MLOps Platforms. Breakdowns of SageMaker, VertexAI, AzureML, Dataiku, Databricks, h2o, kubeflow, mlflow...
Stars: ✭ 293 (+632.5%)
Mutual labels:  azureml
azureml-cheatsheets
Azure Machine Learning Cheat Sheets
Stars: ✭ 23 (-42.5%)
Mutual labels:  azureml

Build Status

Authors: Fidan Boylu Uz, Yan Zhang, Mario Bourgoin

Acknowledgements: Mathew Salvaris

Deploying Python models for real-time scoring using Azure Machine Learning

In this repository there are a number of tutorials in Jupyter notebooks that have step-by-step instructions on (1) how to train a machine learning model using Python; (2) how to deploy a trained machine learning model throught Azure Machine Learning (AzureML). The tutorials cover how to deploy models on following deployment target:

Overview

This scenario shows how to deploy a Frequently Asked Questions (FAQ) matching model as a web service to provide predictions for user questions. For this scenario, “Input Data” in the architecture diagram refers to text strings containing the user questions to match with a list of FAQs. The scenario is designed for the Scikit-Learn machine learning library for Python but can be generalized to any scenario that uses Python models to make real-time predictions.

Design

The scenario uses a subset of Stack Overflow question data which includes original questions tagged as JavaScript, their duplicate questions, and their answers. It trains a Scikit-Learn pipeline to predict the match probability of a duplicate question with each of the original questions. These predictions are made in real time using a REST API endpoint. The application flow for this architecture is as follows:

  1. The client sends a HTTP POST request with the encoded question data.
  2. The webservice extracts the question from the request
  3. The question is then sent to the Scikit-learn pipeline model for featurization and scoring.
  4. The matching FAQ questions with their scores are then piped into a JSON object and returned to the client.

An example app that consumes the results is included with the scenario.

Prerequisites

  1. Linux (Ubuntu).
  2. Anaconda Python
  3. Docker installed.
  4. Azure account.

NOTE You will need to be able to run docker commands without sudo to run this tutorial. Use the following commands to do this.

sudo usermod -aG docker $USER
newgrp docker

The tutorial was developed on an Azure Ubuntu DSVM, which addresses the first three prerequisites.

Setup

To set up your environment to run these notebooks, please follow these steps. They setup the notebooks to use Azure seamlessly.

  1. Create a Linux Ubuntu VM.
  2. Log in to your VM. We recommend that you use a graphical client such as X2Go to access your VM. The remaining steps are to be done on the VM.
  3. Open a terminal emulator.
  4. Clone, fork, or download the zip file for this repository:
    git clone https://github.com/Microsoft/az-ml-realtime-score.git
    
  5. Enter the local repository:
    cd az-ml-realtime-score
    
  6. Copy sample_workspace_conf.yml to a new file, workspace_conf.yml, and fill in each field. This will keep secrets out of the source code, and this file will be ignored by git.
  7. Create the Python az-ml-realtime-score virtual environment using the environment.yml:
    conda env create -f environment.yml
    
  8. Activate the virtual environment:
    source activate az-ml-realtime-score
    
    The remaining steps should be done in this virtual environment.
  9. Login to Azure:
    az login
    
    You can verify that you are logged in to your subscription by executing the command:
    az account show -o table
    
  10. Start the Jupyter notebook server:
    jupyter notebook
    

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Related projects

Microsoft AI Github Find other Best Practice projects, and Azure AI Designed patterns in our central repository.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].