Book Image

Engineering MLOps

By : Emmanuel Raj
Book Image

Engineering MLOps

By: Emmanuel Raj

Overview of this book

Engineering MLps presents comprehensive insights into MLOps coupled with real-world examples in Azure to help you to write programs, train robust and scalable ML models, and build ML pipelines to train and deploy models securely in production. The book begins by familiarizing you with the MLOps workflow so you can start writing programs to train ML models. Then you’ll then move on to explore options for serializing and packaging ML models post-training to deploy them to facilitate machine learning inference, model interoperability, and end-to-end model traceability. You’ll learn how to build ML pipelines, continuous integration and continuous delivery (CI/CD) pipelines, and monitor pipelines to systematically build, deploy, monitor, and govern ML solutions for businesses and industries. Finally, you’ll apply the knowledge you’ve gained to build real-world projects. By the end of this ML book, you'll have a 360-degree view of MLOps and be ready to implement MLOps in your organization.
Table of Contents (18 chapters)
1
Section 1: Framework for Building Machine Learning Models
7
Section 2: Deploying Machine Learning Models at Scale
13
Section 3: Monitoring Machine Learning Models in Production

Hands-on implementation of serving an ML model as an API

In this section, we will apply the principles of APIs and microservices that we have learned previously (in the section Introduction to APIs and microservices) and develop a RESTful API service to serve the ML model. The ML model we'll serve will be for the business problem (weather prediction using ML) we worked on previously. We will use the FastAPI framework to serve the model as an API and Docker to containerize the API service into a microservice.

FastAPI is a framework for deploying ML models. It is easy and fast to code and enables high performance with features such as asynchronous calls and data integrity checks. FastAPI is easy to use and follows the OpenAPI Specification, making it easy to test and validate APIs. Find out more about FastAPI here: https://fastapi.tiangolo.com/.

API design and development

We will develop the API service and run it on a local computer. (This could also be developed on...