Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Azure Machine Learning

You're reading from   Mastering Azure Machine Learning Perform large-scale end-to-end advanced machine learning in the cloud with Microsoft Azure Machine Learning

Arrow left icon
Product type Paperback
Published in Apr 2020
Publisher Packt
ISBN-13 9781789807554
Length 436 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Christoph Körner Christoph Körner
Author Profile Icon Christoph Körner
Christoph Körner
Kaijisse Waaijer Kaijisse Waaijer
Author Profile Icon Kaijisse Waaijer
Kaijisse Waaijer
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface Section 1: Azure Machine Learning
1. Building an end-to-end machine learning pipeline in Azure FREE CHAPTER 2. Choosing a machine learning service in Azure Section 2: Experimentation and Data Preparation
3. Data experimentation and visualization using Azure 4. ETL, data preparation, and feature extraction 5. Azure Machine Learning pipelines 6. Advanced feature extraction with NLP Section 3: Training Machine Learning Models
7. Building ML models using Azure Machine Learning 8. Training deep neural networks on Azure 9. Hyperparameter tuning and Automated Machine Learning 10. Distributed machine learning on Azure 11. Building a recommendation engine in Azure Section 4: Optimization and Deployment of Machine Learning Models
12. Deploying and operating machine learning models 13. MLOps—DevOps for machine learning 14. What's next? Index

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:

  1. To do so, you need to provide the init() and run() 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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image