Machine Learning Engineering with MLflow

Book description

Get up and running, and productive in no time with MLflow using the most effective machine learning engineering approach

Key Features

  • Explore machine learning workflows for stating ML problems in a concise and clear manner using MLflow
  • Use MLflow to iteratively develop a ML model and manage it
  • Discover and work with the features available in MLflow to seamlessly take a model from the development phase to a production environment

Book Description

MLflow is a platform for the machine learning life cycle that enables structured development and iteration of machine learning models and a seamless transition into scalable production environments.

This book will take you through the different features of MLflow and how you can implement them in your ML project. You will begin by framing an ML problem and then transform your solution with MLflow, adding a workbench environment, training infrastructure, data management, model management, experimentation, and state-of-the-art ML deployment techniques on the cloud and premises. The book also explores techniques to scale up your workflow as well as performance monitoring techniques. As you progress, you'll discover how to create an operational dashboard to manage machine learning systems. Later, you will learn how you can use MLflow in the AutoML, anomaly detection, and deep learning context with the help of use cases. In addition to this, you will understand how to use machine learning platforms for local development as well as for cloud and managed environments. This book will also show you how to use MLflow in non-Python-based languages such as R and Java, along with covering approaches to extend MLflow with Plugins.

By the end of this machine learning book, you will be able to produce and deploy reliable machine learning algorithms using MLflow in multiple environments.

What you will learn

  • Develop your machine learning project locally with MLflow's different features
  • Set up a centralized MLflow tracking server to manage multiple MLflow experiments
  • Create a model life cycle with MLflow by creating custom models
  • Use feature streams to log model results with MLflow
  • Develop the complete training pipeline infrastructure using MLflow features
  • Set up an inference-based API pipeline and batch pipeline in MLflow
  • Scale large volumes of data by integrating MLflow with high-performance big data libraries

Who this book is for

This book is for data scientists, machine learning engineers, and data engineers who want to gain hands-on machine learning engineering experience and learn how they can manage an end-to-end machine learning life cycle with the help of MLflow. Intermediate-level knowledge of the Python programming language is expected.

Publisher resources

Download Example Code

Table of contents

  1. Machine Learning Engineering with MLflow
  2. Contributors
  3. About the author
  4. About the reviewer
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Share Your Thoughts
  6. Section 1: Problem Framing and Introductions
  7. Chapter 1: Introducing MLflow
    1. Technical requirements
    2. What is MLflow?
    3. Getting started with MLflow
      1. Developing your first model with MLflow
    4. Exploring MLflow modules
      1. Exploring MLflow projects
      2. Exploring MLflow tracking
      3. Exploring MLflow Models
      4. Exploring MLflow Model Registry
    5. Summary
    6. Further reading
  8. Chapter 2: Your Machine Learning Project
    1. Technical requirements 
    2. Exploring the machine learning process
    3. Framing the machine learning problem
      1. Problem statement
      2. Success and failure definition
      3. Model output
      4. Output usage
      5. Heuristics
      6. Data layer definition
    4. Introducing the stock market prediction problem
      1. Stock movement predictor
      2. Problem statement
      3. Success and failure definition
      4. Model output
      5. Output usage
      6. Heuristics
      7. Data layer definition
    5. Sentiment analysis of market influencers
      1. Problem statement
      2. Success and failure definition
      3. Model output
      4. Output usage
      5. Heuristics
      6. Data layer definition
    6. Developing your machine learning baseline pipeline
    7. Summary
    8. Further reading
  9. Section 2: Model Development and Experimentation
  10. Chapter 3: Your Data Science Workbench
    1. Technical requirements 
    2. Understanding the value of a data science workbench
    3. Creating your own data science workbench
      1. Building our workbench
    4. Using the workbench for stock prediction
      1. Starting up your environment
      2. Updating with your own algorithms
    5. Summary
    6. Further reading
  11. Chapter 4: Experiment Management in MLflow
    1. Technical requirements
    2. Getting started with the experiments module
    3. Defining the experiment
      1. Exploring the dataset
    4. Adding experiments
      1. Steps for setting up a logistic-based classifier
    5. Comparing different models
    6. Tuning your model with hyperparameter optimization
    7. Summary
    8. Further reading
  12. Chapter 5: Managing Models with MLflow
    1. Technical requirements
    2. Understanding models in MLflow
    3. Exploring model flavors in MLflow
      1. Custom models
    4. Managing model signatures and schemas
    5. Introducing Model Registry
      1. Adding your best model to Model Registry
    6. Managing the model development life cycle
    7. Summary
    8. Further reading
  13. Section 3: Machine Learning in Production
  14. Chapter 6: Introducing ML Systems Architecture
    1. Technical requirements
    2. Understanding challenges with ML systems and projects
    3. Surveying state-of-the-art ML platforms
      1. Getting to know Michelangelo
      2. Getting to know Kubeflow
    4. Architecting the PsyStock ML platform
      1. Describing the features of the ML platform
      2. High-level systems architecture
      3. MLflow and other ecosystem tools
    5. Summary
    6. Further reading
  15. Chapter 7: Data and Feature Management
    1. Technical requirements
    2. Structuring your data pipeline project
    3. Acquiring stock data
    4. Checking data quality
    5. Generating a feature set and training data
      1. Running your end-to-end pipeline
    6. Using a feature store
    7. Summary
    8. Further reading
  16. Chapter 8: Training Models with MLflow
    1. Technical requirements
    2. Creating your training project with MLflow
    3. Implementing the training job
    4. Evaluating the model
    5. Deploying the model in the Model Registry
    6. Creating a Docker image for your training job
    7. Summary
    8. Further reading
  17. Chapter 9: Deployment and Inference with MLflow
    1. Technical requirements
    2. Starting up a local model registry
    3. Setting up a batch inference job
    4. Creating an API process for inference
    5. Deploying your models for batch scoring in Kubernetes
    6. Making a cloud deployment with AWS SageMaker
    7. Summary
    8. Further reading
  18. Section 4: Advanced Topics
  19. Chapter 10: Scaling Up Your Machine Learning Workflow
    1. Technical requirements
    2. Developing models with a Databricks Community Edition environment
    3. Integrating MLflow with Apache Spark
    4. Integrating MLflow with NVIDIA RAPIDS (GPU)
    5. Integrating MLflow with the Ray platform
    6. Summary
    7. Further reading
  20. Chapter 11: Performance Monitoring
    1. Technical requirements
    2. Overview of performance monitoring for machine learning models
    3. Monitoring data drift and model performance
      1. Monitoring data drift
      2. Monitoring target drift
      3. Monitoring model drift
    4. Infrastructure monitoring and alerting
    5. Summary
    6. Further reading
  21. Chapter 12: Advanced Topics with MLflow
    1. Technical requirements
    2. Exploring MLflow use cases with AutoML
      1. AutoML pyStock classification use case
      2. AutoML – anomaly detection in fraud
    3. Integrating MLflow with other languages
      1. MLflow Java example
      2. MLflow R example
    4. Understanding MLflow plugins
    5. Summary
    6. Further reading
    7. Why subscribe?
  22. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts

Product information

  • Title: Machine Learning Engineering with MLflow
  • Author(s): Natu Lauchande
  • Release date: August 2021
  • Publisher(s): Packt Publishing
  • ISBN: 9781800560796