Cert Notes/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
SCS-C03 · SpecialtySecurity - Specialty
MLA-C01 · AssociateMachine Learning Engineer - Associate
  • Week 1
    • 1.ML Lifecycle and the Role of ML Engineers
    • 2.ML Problem Types and Evaluation Metrics Basics
    • 3.Day 3
    • 4.SageMaker Overview: Studio, Training/Inference, Built-in Algorithms
    • 5.Week 1 Comprehensive Review — ML Fundamentals & AWS Stack
  • Week 2
    • 1.Data Collection: S3 Data Lake, Kinesis, Batch Ingestion, Data Formats
    • 2.Data Catalog & ETL: AWS Glue and DataBrew
    • 3.Query & Exploration: Athena, Redshift, EDA Basics
    • 4.Data Storage Strategy: Partitioning, Format Optimization, Training Readiness
    • 5.Week 2 Comprehensive Review — Data Collection & Storage Recap
  • Week 3
    • 1.Feature Engineering: The Art of Transforming Data into Numbers Models Can Read
    • 2.SageMaker Data Wrangler: No-Code Data Preparation
    • 3.SageMaker Feature Store: Managing Features as Assets
    • 4.Data Bias·Quality: Clarify, Class Imbalance Handling, Data Split
    • 5.Week 3 Comprehensive Review — Feature Engineering·Data Quality
  • Week 4
    • 1.SageMaker Training Job: Estimator, Input Channels, Instances, Spot
    • 2.Built-in Algorithms: XGBoost, Linear Learner, Image·Text, Input Formats
    • 3.Hyperparameter Tuning (AMT): Bayesian·Random·Grid, Early Stopping, Warm Start
    • 4.JumpStart·Pre-trained Models·Transfer Learning + Training Cost Optimization
    • 5.Week 4 Comprehensive Review: Model Development 1 — SageMaker Training
  • Week 5
    • 1.Custom Training: Script Mode, BYOC, Framework Containers
    • 2.Distributed Training: Data Parallel and Model Parallel
    • 3.Debugging and Profiling: SageMaker Debugger and Profiler
    • 4.Model Evaluation: Metric Selection, Overfitting, Cross-validation, Confusion Matrix
    • 5.Week 5 Comprehensive: Model Development 2 Review
  • Week 6
    • 1.Inference Options Overview: 4 Deployment Modes and Selection Criteria
    • 2.Real-time Endpoints: Configuration, Auto-scaling, Instance Selection
    • 3.Cost & Advanced Inference: Multi-model, Multi-container, Inference Pipeline, Inferentia
    • 4.Batch & Serverless Inference Deep Dive: Throughput Tuning & Cost Tradeoffs
    • 5.Week 6 Synthesis: Inference Deployment Review
  • Week 7
    • 1.Declare parameters, injectible at execution
    • 2.Create package group bundling models of same purpose
    • 3.buildspec.yml — commands CodeBuild executes
    • 4.CloudFormation: SageMaker endpoint declared as code
    • 5.Synthesis code: pipeline end with condition passes → approval triggers deploy
  • Week 8
    • 1.SageMaker Model Monitor: Data Quality and Model Quality Drift
    • 2.Bias and Explainability Drift: Monitoring During Operations with Clarify
    • 3.Filter recent errors from log group
    • 4.Day 4
    • 5.Best practice: aggregating operational metrics + model monitor metrics on one dashboard
  • Week 9
    • 1.Day 1
    • 2.Day 2
    • 3.Data and Model Protection: KMS Encryption and Secrets
    • 4.Day 4
    • 5.Day 5
  • Week 10
    • 1.Day 1
    • 2.Day 2
    • 3.Day 3
    • 4.Day 4
    • 5.Day 5
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
← MLA-C01/Week 1/Day 5
MLA-C01· AssociateWeek 1 · Day 5~17 min read

Day 5 - Week 1 Comprehensive Review — ML Fundamentals & AWS Stack

This week we surveyed ML basics and how to implement them on AWS. Today we tie the scattered pieces together. MLA-C01 tests not isolated knowledge but "which tool at which stage for this situation?" — so the most efficient way to learn is to layer concepts and services on the ML lifecycle.

Four dimensions to review today: ① ML lifecycle, ② problem types and metrics, ③ SageMaker essentials, ④ AWS AI Services. We'll organize each by "when do you pick what?" decision criteria.

ML Lifecycle: The Full Picture

ML projects don't train once and end — they cycle. The four domains of MLA-C01 map directly to this lifecycle.

[1. Data Prep] → [2. Model Dev] → [3. Deploy·Serve] → [4. Monitor·Maintain]
  Collect/Store/Transform   Train/Tune/Evaluate   Pick Endpoint   Drift/Retrain
  (Domain 1, 28%)           (Domain 2, 26%)       (Domain 3, 22%) (Domain 4, 24%)
        ↑                                                              |
        └──────────────── Retrain Trigger ──────────────────────────┘

The key is that last arrow. Deployed models degrade over time as data distribution drifts, then you cycle back to data prep. ML engineers' job is to automate and stabilize this cycle.

💡 Related Theory: This cycle is standardized as CRISP-DM (Cross-Industry Standard Process for Data Mining). Established in the 1990s, it defines 6 iterative stages: business understanding → data understanding → data preparation → modeling → evaluation → deployment. Modern MLOps tightly couples this to "post-deployment monitoring and automated retraining." Exam scenarios saying "model performance declines over time" always point to the monitoring/retrain stage in this cycle.

Problem Types and Metrics

What problem a model solves dictates its metrics. Pick the wrong metric and you build a "99% accurate but useless model."

Problem TypeDescriptionKey Metrics
Binary classificationOne of two (churn/stay)Precision, Recall, F1, AUC-ROC
Multi-class classificationThree+ categoriesAccuracy, Macro-F1, Confusion Matrix
RegressionContinuous prediction (price)RMSE, MAE, R²
ClusteringUnsupervised groupingSilhouette, Inertia

Also review supervised/unsupervised/reinforcement learning. Supervised learns from labeled data (classification·regression). Unsupervised finds structure without labels (clustering, dimensionality reduction, anomaly detection). Reinforcement learns policies from rewards.

from sklearn.metrics import precision_score, recall_score, f1_score
 
# With imbalanced data (0.1% fraud), accuracy is a trap — look at precision/recall
precision = precision_score(y_true, y_pred)   # Share of positive predictions that are true
recall = recall_score(y_true, y_pred)         # Share of actual positives we caught
f1 = f1_score(y_true, y_pred)                 # Harmonic mean of both

💡 Related Theory: The Precision-Recall tradeoff comes from asymmetric costs. For "missing is catastrophic" problems like fraud detection, prioritize Recall (catching misses). For "false alarms are painful" like spam filters, prioritize Precision (reducing false alarms). With extreme class imbalance, Accuracy is meaningless — predicting all as the majority class hits 99%. That's why imbalanced problems use F1 or AUC-PR as summary metrics.

⚠️ Gotcha: Don't confuse RMSE and MAE in regression. RMSE squares large errors, penalizing them harder, so it's sensitive to outliers. MAE treats all errors equally, more robust. "Lots of outliers and I need to specially penalize large errors" → RMSE. "Reduce outlier impact" → MAE.

SageMaker Essentials Organized

SageMaker, which we explored in the second half of this week, is a toolkit covering the entire ML lifecycle. By stage:

Lifecycle StageSageMaker FeatureRole
Work environmentStudio (domain, user profile)Unified IDE, permission separation
Data prepData Wrangler, Feature StoreVisual transforms, feature management
TrainingTraining Job, built-in algorithmsEphemeral container training
TuningAutomatic Model TuningHyperparameter optimization
DeploymentReal-time/serverless/batch/asyncTraffic-specific inference options
OperationsModel Monitor, PipelinesDrift detection, automation

Key exam points: training happens in ephemeral containers (auto-terminates, spot cuts cost), and inference options split by traffic pattern.

import sagemaker
from sagemaker.estimator import Estimator
 
session = sagemaker.Session()
role = sagemaker.get_execution_role()
 
# Train tabular classification with built-in XGBoost
estimator = Estimator(
    image_uri=sagemaker.image_uris.retrieve("xgboost", session.boto_region_name, "1.7-1"),
    role=role,
    instance_count=1,
    instance_type="ml.m5.xlarge",
    use_spot_instances=True,   # Cut training costs
)
estimator.fit({"train": "s3://my-bucket/train/"})

🔍 Deeper Dive: Memorize inference option choice in one line. "Thousands of requests/second, low latency" → Real-time endpoint. "Sporadic, no idle cost" → Serverless. "Bulk batch scoring" → Batch transform. "Large payload, long processing" → Asynchronous. If built-in doesn't fit, use script mode (your code + AWS framework container) or custom container.

AWS AI Services: Pre-Trained Models Without Training

Not every ML problem needs direct training. AWS offers pre-trained managed AI Services via API. "Common task, want it fast" — this is the answer.

DomainServiceUse Case
Text analysisComprehendSentiment, entities, key phrases
TranslationTranslateReal-time machine translation
Speech→TextTranscribeSpeech recognition, subtitles
Text→SpeechPollyTTS voice synthesis
Image·VideoRekognitionObjects, faces, content detection
Document extractionTextractOCR, forms, tables
ForecastingForecastTime-series demand prediction
RecommendationPersonalizePersonalized recommendation engine
Generative AIBedrockFoundation model API

Decision criterion: abstraction level. AI Services (API call, no training) → SageMaker (direct train/deploy, flexible) → EC2 direct (max control, max burden). "Common problem + speed" → AI Service. "Custom model on my data" → SageMaker.

💡 Related Theory: This hierarchy is the cloud version of "build vs buy." AI Services borrow pre-trained models AWS trained on massive datasets (buy). SageMaker builds custom on your data (build). The ML engineer's decision point: "Is my problem general or domain-specific?" General NLP/vision tasks are faster, more accurate, and less operational burden via AI Services. Domain-specialized data (medical imaging, manufacturing defects) needs direct training.

Summary

Week 1's big picture: ML cycles through the lifecycle (prep → dev → deploy → monitor → retrain), each problem type needs different metrics (watch for accuracy traps in imbalance), the whole lifecycle is covered by SageMaker, and common tasks attach fast via AI Services without training. The core exam skill is choosing abstraction level (AI Services → SageMaker → EC2) by problem generality.

Next week (Week 2) we dive deep into the lifecycle's first stage: data collection and storage — S3, Kinesis, Glue, Athena.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

A deployed churn prediction model's accuracy is slowly declining over months. Input data distribution has shifted from training time. Which lifecycle stage does this correspond to, and the response?

Question 2

Fraud detection model where fraud is 0.1% of transactions. Which metric is most inappropriate and why?

Question 3

Convert call center recordings to text, then analyze customer complaints for sentiment. Implement fastest without training?

Question 4

For regression evaluation, you want to heavily penalize large errors to catch outliers sensitively. Which metric?

Question 5

"Train a custom classifier on unique manufacturing defect images from our domain." At the abstraction layer, which choice fits?

PreviousSageMaker Overview: Studio, Training/Inference, Built-in AlgorithmsWeek 1 · Day 4Next Data Collection: S3 Data Lake, Kinesis, Batch Ingestion, Data FormatsWeek 2 · Day 1

On this page

  • ML Lifecycle: The Full Picture
  • Problem Types and Metrics
  • SageMaker Essentials Organized
  • AWS AI Services: Pre-Trained Models Without Training
  • Summary
  • Practice Questions