Giter Site home page Giter Site logo

jomit / real-time-prediction Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 5.0 1.8 MB

Real-time predictions on manufacturing quality using Azure Machine Learning

JavaScript 3.38% Jupyter Notebook 96.62%
azuremlservice machine-learning azure azure-functions azure-eventhub azure-container-instances

real-time-prediction's Introduction

Real-time predictions on manufacturing quality using Azure Machine Learning

High level reference architecture:

Architecture

Business Case

Improve quality and reduce production scrap by predicting the quality of a production run near real time using the machine sensor data coming out of the PLC's / Historian.

Prerequisites

Steps

Training Pipeline

  • Create Azure Blob storage Account and upload data\train.csv in a container named mldatasets

  • Create a new Data Science Virtual Machine and verify that the Jupyter notebook server is running on port 8000.

  • Deploy the Azure ML Workspace using the mlworkspace\template.json template file

    • az group deployment create --resource-group <resource-group-name> --template-file <path-to-template>
  • Upload all the notebooks from mlnotebooks folder to the Jupyter notebook server using the Web UI.

  • Run all notebooks as per the sequence to build and deploy the initial model.

    • Make sure to update the parameters in the notebook as per the instructions.

    • For production deployments use Azure Kubernetes Service to deploy the scoring api

Inference Pipeline

  • Create an Event Hub Namespace and an event hub inside it named qualityprediction

  • Create a new Cosmos DB Account and add a new container with following details:

    • Database id : MLPrediction
    • Container id: qualitypredictions
    • Partition key: /batchid
  • Create an Azure Function App with Runtime Stack as Nodejs

    • Add new Azure Event hub trigger function with following parameters:

      • Name: PredictQuality
      • Event Hub Connection: <Use the event hub created above>
      • Event Hub Name: qualityprediction
      • The event hub cardinality: One
      • Event parameter name: eventHubMessage
    • Click on Integrate in the function and add a New Output of type Azure Cosmos DB with following parameters:

      • Document parameter name: predictionResultDocument
      • Database name: MLPrediction
      • Collection name: qualitypredictions
      • Azure Cosmos DB account connection: <Choose the Cosmos DB Account created above>
    • Updated the function code with function\index.js. Make sure to replace the scoring api url.

  • Setup Edge Gateway \edgegateway which is a nodejs app. (For more complex edge requirements please use Azure IoT Edge along with Azure IoT Hub)

    • Rename the sample-dot-env file to .env

    • Update the eventHubConnectionString and eventHubName values in the .env file

    • (Optional) If integrating with local SQL DB

      • Update the sql related values in the .env file
      • Update code in app.js and sqlserverdb.js

Additional Resources

real-time-prediction's People

Contributors

jomit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.