Skip to main content
Welcome. This lesson outlines the machine learning (ML) development lifecycle and the typical ML pipeline, with practical AWS-centric patterns for production-ready workflows. At a high level the ML lifecycle is a continuous loop: define a measurable business goal → collect and prepare data → train and evaluate models → deploy for inference (real‑time or batch) → monitor and iterate. Many AWS workflows center on Amazon S3 and Amazon SageMaker as core components for storage, training, deployment, and monitoring.
A slide titled "ML Development Lifecycle – Introduction" showing a multicolored cyclic arrow loop labeled "ML Model" at the center. The diagram highlights stages around the loop — Data Collection, Training, Deployment, and Monitoring — with an AWS logo and note at the bottom.

1. Business goal identification

Every ML initiative must start with a clearly defined business objective and measurable success criteria. Examples:
  • Increase customer retention by X% within Y months.
  • Improve revenue per user or lifetime value.
  • Reduce operational costs or incident response time by a target amount.
Define metrics (KPIs) up front, map them to model outputs, and align stakeholders before investing in data collection and modeling. This prevents scope drift and ensures model outcomes are actionable for the business.
A presentation slide titled "Business Goal Identification" with a central icon labeled "Business Goal." Three goals are listed at the bottom: increase customer retention, boost revenue by 15%, and reduce operational costs by 10%.

2. Data collection and preparation

Identify sources needed to meet your business objective and design an ingestion pipeline. Common AWS data sources and storage patterns include:
  • Object storage: Amazon S3 (central artifact store for raw and processed data).
  • Relational databases: Amazon RDS.
  • Data warehouses: Amazon Redshift.
  • Streaming sources: Amazon Kinesis, Amazon MSK.
  • Compute hosts and batch jobs: EC2, EMR.
Catalog, clean, transform, and enrich data using ETL/data-catalog tools before pushing datasets into training pipelines.
Design your data contracts and schema early. Consistent schemas and metadata (via a data catalog) reduce downstream surprises when training or deploying models.
Key patterns:
  • Use S3 as the single source of truth for artifacts (features, training data, model artifacts).
  • Use AWS Glue and Lake Formation for cataloging and governing datasets.
  • Stream or batch ingest based on latency requirements; use AWS Lambda for serverless stream processing when appropriate.
An architecture diagram titled "Data Collection and Preparation" showing AWS services and the data flow for ingesting, cataloging, transforming, and storing data. It depicts sources (Redshift, S3, RDS, Kinesis, MSK, EC2) feeding into AWS Glue (Data Catalog, Studio, ETL) and Lake Formation, then into data lakes/warehouses and analytics tools (Athena, Redshift, EMR, SageMaker, QuickSight).

Data preprocessing and feature engineering

Preprocessing turns raw data into features suitable for model consumption:
  • Impute missing values (mean/median or model-based).
  • Normalize/scale numeric features.
  • Encode categorical variables.
  • Detect and remove outliers or anomalies.
  • Create derived features (feature crosses, embeddings).
  • Reduce dimensionality or downsample for efficiency.
Tools and environments:
  • SageMaker notebooks and Processing jobs for medium-scale tasks.
  • Managed ETL: AWS Glue for schema discovery and batch transforms.
  • Big-data frameworks (Spark on EMR) for large-scale feature pipelines.

Data augmentation

When datasets are limited or class-imbalanced, augment data to improve generalization. Examples:
  • Image transforms: flip, rotate, crop, color jitter.
  • Text augmentation: synonym replacement, back-translation.
  • Synthetic data generation for rare events.
SageMaker supports integration of augmentation strategies in training pipelines.

Train / validation / test split

Recommended practice: split your dataset to prevent overfitting and to produce reliable performance estimates. Common splits: 80/10/10, 70/20/10, or time-based splits for temporal data.
  • Training: bulk of data used to fit model parameters.
  • Validation: tune hyperparameters and detect overfitting during training.
  • Test: final unbiased evaluation before deployment.
An infographic titled "Splitting Data for Training, Validation, and Testing" with three donut charts labeled Training (80%), Validation (10%), and Testing (10%). It shows that 80% of data is used to teach the model, 10% for fine‑tuning, and 10% to measure final performance.

3. Model training

Training optimizes model parameters (weights) to minimize an objective function on training data. Training can be iterative, distributed, and resource-intensive. Amazon SageMaker provides:
  • Managed training jobs with automatic provisioning of compute (CPU/GPU).
  • Built-in algorithms and prebuilt containers for TensorFlow, PyTorch, XGBoost, scikit‑learn.
  • SageMaker Processing and Studio for experiment-driven development.
  • Automatic Model Tuning for hyperparameter search across multiple jobs.
Critical tunables: learning rate, batch size, regularization, optimizer choice, model architecture, and feature selection. Use experiment tracking to record configurations, datasets, and metrics for reproducibility.
Slide titled "Training the Model" with an AWS SageMaker logo centered. Below are two panels labeled "Automated Resource Management" (hierarchy icon) and "Algorithm and Framework Support" (hands holding a puzzle piece).

4. Evaluating model performance

Evaluation is ongoing during training (validation) and finalized on the test set. Choose metrics aligned with business goals—classification, regression, ranking, or forecasting all require different metrics. Common metrics:
  • Classification: Accuracy, Precision, Recall, F1 score, ROC-AUC.
  • Regression: MAE, MSE, RMSE.
  • Ranking/Recommendation: MAP, NDCG.
Use confusion matrices and diagnostics to identify error modes and potential biases.
A slide titled "Evaluating Model Performance" showing four blue numbered circles labeled 01–04 that correspond to Accuracy, Precision, Recall, and F1 Score.
A confusion matrix visualizes true positives, false positives, false negatives, and true negatives — essential for understanding where the model fails and how that impacts business outcomes.
An infographic titled "Evaluating Model Performance" showing a confusion matrix with four colored blocks labeled True Positive, False Positive, False Negative, and True Negative. To the right are two callouts reading "Assess model performance" and "Identify failures."
SageMaker provides experiment and model-tracking features that let you compare runs, tie metrics back to datasets and hyperparameters, and select the best candidate for deployment.

5. Model deployment

Deployment patterns depend on latency, throughput, and cost constraints. Typical options: For most production ML workflows on AWS, SageMaker hosted endpoints (for online) and SageMaker Batch Transform (for offline) are common choices. Containerization enables portability between SageMaker, ECS, EKS, or self-managed clusters.
A diagram titled "Integrating the ML Pipeline for Success" showing a central cyclical ML model workflow with multicolored arrows. Around it are AWS service icons (Amazon S3, AWS Glue, SageMaker, CloudWatch, Lambda, EMR) mapped to stages like data collection, training, deployment, and monitoring.

6. Monitoring and continuous improvement

Post-deployment monitoring ensures models continue to meet SLAs and business KPIs. Watch for:
  • Data drift: input feature distributions change.
  • Concept drift: relationship between inputs and labels changes.
  • Model performance degradation: increasing error rates or latency spikes.
  • Infrastructure and resource metrics: CPU, memory, latency, error rates.
AWS monitoring tools:
  • SageMaker Model Monitor: detect feature and prediction drift and generate alerts.
  • Amazon CloudWatch: logs, custom metrics, and alarms for infra and app-level signals.
  • Automated retraining pipelines: schedule or trigger retraining based on thresholds or new labeled data.
Monitor for data and concept drift continuously. Unnoticed drift can silently degrade business outcomes and introduce compliance risks.
Monitoring forms an automated feedback loop: production data (and labeled examples when available) feed back into preprocessing, feature stores, retraining, and redeployment. Combine monitoring alerts with CI/CD for ML (MLOps) to automate safe rollouts and rollbacks. The ML lifecycle is an iterative loop of discovery, modeling, deployment, and improvement:
  1. Identify the business problem and measurable objectives.
  2. Collect and prepare data (ingest, catalog, clean, augment).
  3. Train models (iterate and tune hyperparameters).
  4. Evaluate and validate (use business-aligned metrics and holdout test sets).
  5. Deploy models (real-time or batch inference; SageMaker is commonly used).
  6. Monitor in production and retrain as needed (SageMaker Model Monitor, CloudWatch).
Common AWS services used across the ML pipeline: Use these patterns as a foundation for building robust, scalable ML pipelines that align technical implementation with business value.

Watch Video