Mastering MLOps Architecture: From Code to Deployment: Manage the production cycle of continual learning ML models with MLOps
9789355519498
Harness the power of MLOps for managing real time Machine Learning project cycle.
MLOps is the intersection of DevOps,
165
63
4MB
English
Pages 286
Year 2024
Report DMCA / Copyright
DOWNLOAD EPUB FILE
Table of contents :
Cover
Title Page
Copyright Page
Dedication Page
About the Author
About the Reviewer
Acknowledgement
Preface
Table of Contents
1. Getting Started with MLOps
Introduction
Structure
Objectives
Understanding MLOps
Experimentation and tracking
Model management
Importance of MLOps
The evolution of MLOps
Software engineering projects versus machine learning projects
DevOps versus MLOps
Principles of MLOps
MLOps best practices
Code
Data
Model
Metrics and KPIs
Deployment
Team
MLOps in an organization
MLOps strategy
Cloud
Training and talent
Vendor
Executive focus on Return on Investment
Implementing MLOps
Overcoming challenges of MLOps
MLOps in Cloud
MLOps on-premises
MLOps in hybrid environments
Conclusion
Points to remember
Key terms
2. MLOps Architecture and Components
Introduction
Structure
Objectives
MLOps components
Data source and data versioning
Data analysis and experiment management
Code repository
Pipeline orchestration
Workflow orchestration
CI/CD automation
Model training and storage
Model training
Model registry
Model deployment and serving
Monitoring for model, data, and application
Training performance tracking
Metadata store
Feature processing and storage
Feature processing
Feature store
MLOps architecture
Architecture level 1: Minimum viable architecture
Architecture level 2: Production grade MLOps
Architecture level 3: Enterprise grade MLOps
The semantics of dev, staging, and production
Execution environment
Code
Models
Data
Machine learning deployment patterns
Deploy models
Deploy code
Bringing the architectural components together
Development environment
Staging environment
Production environment
Conclusion
Points to remember
Key terms
3. MLOps Infrastructure and Tools
Introduction
Structure
Objectives
Getting started with infrastructure
Storage
Extract, transform, load/extract, load, transform
Batch processing and stream processing
Compute
Public Cloud vendors versus private data centers
Development environments
Development environment setup
Integrated development environments
Containers
Orchestration/workflow management
Airflow installation
Installing using PyPi
Installing in Docker
Airflow in production
Example: Airflow Direct Acyclic Graphs
Machine learning platforms
Model deployment
Model registry
Feature store
Installing MLflow
Build versus buy
Conclusion
Points to remember
Key terms
4. What are Machine Learning Systems?
Introduction
Structure
Objectives
What is a machine learning system
Machine learning systems use cases
Understanding machine learning systems
Machine learning in research versus production
Objectives and requirements
Computational priorities
Data
Fairness
Interpretability
An implementation roadmap for MLOps-based machine learning systems
Phase 1: Initial development
Phase 2: Transition to operations
Phase 3: Operations
Machine learning development: Cookiecutter data science project structure
What is cookiecutter
Why cookiecutter
Getting started with cookiecutter data science
Repository structure
Conclusion
Points to remember
Key terms
5. Data Preparation and Model Development
Introduction
Structure
Objectives
MLOps code repository best practices
pre-commit hooks
Data sourcing
Data sources
Data versioning
Exploratory data analysis
Data preparation
Model development
Deep dive in MLflow workflow
Model evaluation
Model versioning
Deep dive in MLflow models
Conclusion
Points to remember
Key terms
6. Model Deployment and Serving
Introduction
Structure
Objectives
Model deployment
Static deployment
Dynamic deployment on edge device
Dynamic deployment on a server
Virtual machine deployment
Container deployment
Serverless deployment
Streaming model deployment
Deployment strategies
Single deployment
Silent deployment
Canary deployment
Multi-armed bandits
Online model evaluation
Model deployment
Model inference and serving
Modes of model serving
Batch processing
On-demand processing: Human as end-user
On-demand processing: To machines as end users
Model serving in real life
Errors
Change
Human nature
Conclusion
Points to remember
Key terms
7. Continuous Delivery of Machine Learning Models
Introduction
Structure
Objectives
Traditional continuous integration/continuous deployment pipelines
Pipelines for machine learning/artificial intelligence
Architecture level 1
Architecture level 2
Architecture level 3
Continuous integration
GitHub Actions
Continuous training
Continuous training strategy framework
When to retrain
Adhoc/manual retraining
Periodic time-based retraining
Periodic data volume-driven retraining
Performance-driven retraining
Data changes-based retraining
What data should be used
Fixed window size
Dynamic window size
Dynamic data selection
What should we retrain
Continuous delivery
Conclusion
Points to remember
Key terms
8. Continual Learning
Introduction
Structure
Objectives
Understanding the need for continual learning
Continual learning
The need for continual learning
Adaptability
Scalability
Relevance
Performance
Principles of continual learning: Stateless retraining and stateful training
Challenges with continual learning
Obtaining fresh data
Data quality and preprocessing
Evaluating model performance
Optimized algorithms
Continual learning in MLOps
Triggering the retraining of models for continual learning
Conclusion
Points to remember
Key terms
9. Continuous Monitoring, Logging, and Maintenance
Introduction
Structure
Objectives
Key principles of monitoring in machine learning
Model drift
Data drift
Feature drift
Model drift
Upstream data changes
Model transparency
Model bias
Model compliance
Why model monitoring matters
For DevOps or infrastructure teams
For data science or machine learning teams
Ground truth
Input drift
For business stakeholders
For legal and compliance teams
Monitoring in the MLOps workflow
Logging
Model evaluation
Steps and decisions for the monitoring workflow
Before the model evaluation, testing, and monitoring
During the evaluation and testing
After the evaluation and testing
Frameworks for model monitoring
Frameworks
Whylogs
Evidently
Alibi Detect
Integrating with tools
In training and testing pipelines
In production systems
Conclusion
Points to remember
Key terms
Index