Code Monkey home page Code Monkey logo

amlsdummy's Introduction

Simple Cloud Machine Learning/AI Model Deployment using Azure

Daniel Grecoe - A Microsoft Employee

The code in this repository sets up different versions of an Azure Machine Learning Service.

Azure Machine Learning Real Time Scoring Service

For detailed information on the Azure Machine Learning Real Time Scoring Service deployed in this example read this document.

A real time scoring service is a REST endpoint in which consumers of the endpoint send in individual records to be scored synchronously. Applications for such a service can be found in predicitive maintenance or other applications where some immediate action should occur.

For example, a model is deployed for in a factory setting. At a given cadence the manufacturing equipement transmits it's current status and potentially the status over the last time period.

The real time scoring service would then predict if the machine is about to experience some sort of issue. Business logic built with this endpoint could then shut down the machine or schedule a maintenance ticket.

Azure Machine Learning Batch Scoring Service

For detailed information on the Azure Machine Learning Batch Scoring Service deployed in this example read this document.

A batch scoring service is an asynchronous service that can be run either on a schedule or when triggered. Applications for such a service can be found in financial services or other applications where periodic scoring of large numbers of records are required and immediate action is not neccesary.

For example, certain fraudulent activity occurs over a period of time but is not detectable by individual transactions. Using a batch service, transaction historry would be collected by a back end system and placed in a storage area (many storage options are available for both input and outputs).

When the input data is collected, the batch service would then be triggered to predict fraud over some period of records and output the results into another storage location for further business processing.

Repository Content

Item Type Description
contexts Directory Source files that wrap Azure Functionality for both Batch and RealTime Scoring paths.
scripts Directory Utility source files for dealing with program arguments, Azure services and logging.
paths Directory Detailed configuration information for both paths including scoring scripts to be utilized by the different paths.
environment.yml File File used to generate the required conda environment (see below)
batchcreate.py File Main script for deploying an Azure Machine Learning Batch Scoring service.
rtscreate.py File Main script for deploying an Azure Machine Learning Real Time Scoring service.
rtsloadtest.py File Script for load testing an Azure Machine Learning Real Time Scoring service.
rtsexploreruns File Script for moving an experiment run to completed if it's run longer than 4 hours. Exposed during CMK testing but may prove useful for other scenarios.
LICENSE File MIT License for this repository.
README.md File The file you are reading now.

Common Configuration

Conda Environment

Either path you choose you need to set up a conda environment to execute the scripts in as required Azure and Azure Machine Learning modules need to be present.

  1. Clone this repo to your machine
  2. Create the conda environment
    • conda env create -f environment.yml
    • conda activate SimpleModel
  3. Choose the path you want to follow:
    • Real Time Scoring - Navigate to rtsreadme.md
    • Batch Scoring - Navigate to batchreadme.md

Logging

Regardless of path you execute, upon completion of either the rtscreate.py or batchcreate.py a log file directory is created with the following:

Item Type Description
Logs Directory Holds all logs regardless of path executed.
Overview.csv File Generic CSV with three columns:

Path Type
Output Log File Name/Path
Execution Length in Seconds
BatchScoringLogs Directory Holds any log all batchcreate.py runs. Each run creates it's own timestamped log file.
RealTimeScoringLogs Directory Holds any log all rtscreate.py runs. Each run creates it's own timestamped log file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.