Praise for Designing Machine Learning Systems
There is so much information one needs to know to be an effective machine learning engineer. Its hard to cut through the chaff to get the most relevant information, but Chip has done that admirably with this book. If you are serious about ML in production, and care about how to design and implement ML systems end to end, this book is essential.
Laurence Moroney, AI and ML Lead, Google
One of the best resources that focuses on the first principles behind designing ML systems for production. A must-read to navigate the ephemeral landscape of tooling and platform options.
Goku Mohandas, Founder of Made With ML
Chips manual is the book we deserve and the one we need right now. In a blooming but chaotic ecosystem, this principled view on end-to-end ML is both your map and your compass: a must-read for practitioners inside and outside of Big Techespecially those working at reasonable scale. This book will also appeal to data leaders looking for best practices on how to deploy, manage, and monitor systems in the wild.
Jacopo Tagliabue, Director of AI, Coveo; Adj. Professor of MLSys, NYU
This is, simply, the very best book you can read about how to build, deploy, and scale machine learning models at a company for maximum impact. Chip is a masterful teacher, and the breadth and depth of her knowledge is unparalleled.
Josh Wills, Software Engineer at WeaveGrid and former Director of Data Engineering, Slack
This is the book I wish I had read when I started as an ML engineer.
Shreya Shankar, MLOps PhD Student
Designing Machine Learning Systems is a welcome addition to the field of applied machine learning. The book provides a detailed guide for people building end-to-end machine learning systems. Chip Huyen writes from her extensive, hands-on experience building real-world machine learning applications.
Brian Spiering, Data Science Instructor at Metis
Chip is truly a world-class expert on machine learning systems, as well as a brilliant writer. Both are evident in this book, which is a fantastic resource for anyone looking to learn about this topic.
Andrey Kurenkov, PhD Candidate at the Stanford AI Lab
Chip Huyen has produced an important addition to the canon of machine learning literatureone that is deeply literate in ML fundamentals, but has a much more concrete and practical approach than most. The focus on business requirements alone is uncommon and valuable. This book will resonate with engineers getting started with ML and with others in any part of the organization trying to understand how ML works.
Todd Underwood, Senior Engineering Director for ML SRE, Google, and Coauthor of Reliable Machine Learning
Designing Machine Learning Systems
by Chip Huyen
Copyright 2022 Huyen Thi Khanh Nguyen. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .
- Acquisitions Editor: Nicole Butterfield
- Development Editor: Jill Leonard
- Production Editor: Gregory Hyman
- Copyeditor: nSight, Inc.
- Proofreader: Piper Editorial Consulting, LLC
- Indexer: nSight, Inc.
- Interior Designer: David Futato
- Cover Designer: Karen Montgomery
- Illustrator: Kate Dullea
Revision History for the First Edition
- 2022-05-17: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781098107963 for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. Designing Machine Learning Systems, the cover image, and related trade dress are trademarks of OReilly Media, Inc.
The views expressed in this work are those of the author, and do not represent the publishers views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-098-10796-3
[LSI]
Preface
Ever since the first machine learning course I taught at Stanford in 2017, many people have asked me for advice on how to deploy ML models at their organizations. These questions can be generic, such as What model should I use? How often should I retrain my model? How can I detect data distribution shifts? How do I ensure that the features used during training are consistent with the features used during inference?
These questions can also be specific, such as Im convinced that switching from batch prediction to online prediction will give our model a performance boost, but how do I convince my manager to let me do so? or Im the most senior data scientist at my company and Ive recently been tasked with setting up our first machine learning platform; where do I start?
My short answer to all these questions is always: It depends. My long answers often involve hours of discussion to understand where the questioner comes from, what theyre actually trying to achieve, and the pros and cons of different approaches for their specific use case.
ML systems are both complex and unique. They are complex because they consist of many different components (ML algorithms, data, business logic, evaluation metrics, underlying infrastructure, etc.) and involve many different stakeholders (data scientists, ML engineers, business leaders, users, even society at large). ML systems are unique because they are data dependent, and data varies wildly from one use case to the next.
For example, two companies might be in the same domain (ecommerce) and have the same problem that they want ML to solve (recommender system), but their resulting ML systems can have different model architecture, use different sets of features, be evaluated on different metrics, and bring different returns on investment.
Many blog posts and tutorials on ML production focus on answering one specific question. While the focus helps get the point across, they can create the impression that its possible to consider each of these questions in isolation. In reality, changes in one component will likely affect other components. Therefore, its necessary to consider the system as a whole while attempting to make any design decision.
This book takes a holistic approach to ML systems. It takes into account different components of the system and the objectives of different stakeholders involved. The content in this book is illustrated using actual case studies, many of which Ive personally worked on, backed by ample references, and reviewed by ML practitioners in both academia and industry. Sections that require in-depth knowledge of a certain topice.g., batch processing versus stream processing, infrastructure for storage and compute, and responsible AIare further reviewed by experts whose work focuses on that one topic. In other words, this book is an attempt to give nuanced answers to the aforementioned questions and more.