Building a real-time scoring service
For Azure Machine Learning, you can't really choose a specific deployment case to match your use case. To implement a real-time scoring service, you need to pick a highly scalable compute target (for example, AKS) and provide a scoring file that receives data with each request and returns the prediction of the model synchronously:
- To do so, you need to provide the
init()
andrun()
functions in the scoring file. Let's take a look at a simple scoring file. In reality, this should be very simple, as we have seen most of the code already:import json import numpy as np import os from sklearn.externals import joblib def init():     global model     model_path = Model.get_model_path('sklearn_mnist')     model= joblib.load(model_path) def run(data): try:     result = model.predict(data)     # You can return any JSON serializable...