Machine Learning Design Patterns: Solutions to Common Challenges in Data Preparation, Model Building, and MLOps 1098115783, 9781098115784

The design patterns in this book capture best practices and solutions to recurring problems in machine learning. The aut

1,993 274 16MB

English Pages 400 [408] Year 2020

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Cover
Copyright
Table of Contents
Preface
Who Is This Book For?
What’s Not in the Book
Code Samples
Conventions Used in This Book
O’Reilly Online Learning
How to Contact Us
Acknowledgments
Chapter 1. The Need for Machine Learning Design Patterns
What Are Design Patterns?
How to Use This Book
Machine Learning Terminology
Models and Frameworks
Data and Feature Engineering
The Machine Learning Process
Data and Model Tooling
Roles
Common Challenges in Machine Learning
Data Quality
Reproducibility
Data Drift
Scale
Multiple Objectives
Summary
Chapter 2. Data Representation Design Patterns
Simple Data Representations
Numerical Inputs
Categorical Inputs
Design Pattern 1: Hashed Feature
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 2: Embeddings
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 3: Feature Cross
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 4: Multimodal Input
Problem
Solution
Trade-Offs and Alternatives
Summary
Chapter 3. Problem Representation Design Patterns
Design Pattern 5: Reframing
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 6: Multilabel
Problem
Solution
Trade-Offs and Alternatives
Design Pattern 7: Ensembles
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 8: Cascade
Problem
Solution
Trade-Offs and Alternatives
Design Pattern 9: Neutral Class
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 10: Rebalancing
Problem
Solution
Trade-Offs and Alternatives
Summary
Chapter 4. Model Training Patterns
Typical Training Loop
Stochastic Gradient Descent
Keras Training Loop
Training Design Patterns
Design Pattern 11: Useful Overfitting
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 12: Checkpoints
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 13: Transfer Learning
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 14: Distribution Strategy
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 15: Hyperparameter Tuning
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Summary
Chapter 5. Design Patterns for Resilient Serving
Design Pattern 16: Stateless Serving Function
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 17: Batch Serving
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 18: Continued Model Evaluation
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 19: Two-Phase Predictions
Problem
Solution
Trade-Offs and Alternatives
Design Pattern 20: Keyed Predictions
Problem
Solution
Trade-Offs and Alternatives
Summary
Chapter 6. Reproducibility Design Patterns
Design Pattern 21: Transform
Problem
Solution
Trade-Offs and Alternatives
Design Pattern 22: Repeatable Splitting
Problem
Solution
Trade-Offs and Alternatives
Design Pattern 23: Bridged Schema
Problem
Solution
Trade-Offs and Alternatives
Design Pattern 24: Windowed Inference
Problem
Solution
Trade-Offs and Alternatives
Design Pattern 25: Workflow Pipeline
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 26: Feature Store
Problem
Solution
Why It Works
Trade-Offs and Alternatives
Design Pattern 27: Model Versioning
Problem
Solution
Trade-Offs and Alternatives
Summary
Chapter 7. Responsible AI
Design Pattern 28: Heuristic Benchmark
Problem
Solution
Trade-Offs and Alternatives
Design Pattern 29: Explainable Predictions
Problem
Solution
Trade-Offs and Alternatives
Design Pattern 30: Fairness Lens
Problem
Solution
Trade-Offs and Alternatives
Summary
Chapter 8. Connected Patterns
Patterns Reference
Pattern Interactions
Patterns Within ML Projects
ML Life Cycle
AI Readiness
Common Patterns by Use Case and Data Type
Natural Language Understanding
Computer Vision
Predictive Analytics
Recommendation Systems
Fraud and Anomaly Detection
Index
About the Authors
Colophon

Machine Learning Design Patterns: Solutions to Common Challenges in Data Preparation, Model Building, and MLOps
 1098115783, 9781098115784

  • 0 1 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Recommend Papers