Skip to content

2.1

Task 2.1: Choose a modeling approach (MLA-C01)

Key Knowledge Summary

  • ML algorithms & when to apply: Linear/logistic regression (simple relationships, high interpretability, low complexity); decision trees/random forests (non-linear, rule-based, good interpretability); SVM; K-means (clustering); K-NN; PCA (dimensionality reduction); LDA (topic modeling); word2vec/seq2seq (embeddings/sequences); multinomial logistic. Deep learning: artificial neurons, weights/biases, activation functions. CNNs (image classification/object detection via convolutional layers). RNNs (sequences/time-series, translation, audio, sentiment) – order matters. Vanishing gradient mitigation: LSTM (gates for remember/forget, multiple internal nets, higher train time) or GRU (simpler gates, less compute, faster train).
  • Interpretability in selection: Higher interpretability = easier to understand predictions, but trade-off vs performance. Intrinsic (inherently simple models: linear regression = weighted sum; decision trees = if-then rules). Post-hoc (model-agnostic, for complex/non-linear like NNs): local (single instance) or global (overall behavior). SageMaker Clarify implements scalable SHAP for bias detection + explanations.
  • AWS AI services (pre-trained, API-driven, solve common needs without training): Lex (chatbots); Polly (text-to-speech, SSML, custom lexicons for pronunciation); Textract (OCR, forms/handwriting → text for NLP); Comprehend (NLP: entities, key phrases, sentiment, topics, PII; Comprehend Medical); Transcribe (ASR speech-to-text: calls, meetings, subtitles); Translate (mass text translation); Rekognition (Image/Video: labels, objects, faces, celebs, custom labels via S3 + Ground Truth); Forecast (time-series; requires your historical data to train); Personalize (recommendations); Fraud Detector; Bedrock (fully managed generative AI: choose/customize foundation models from providers for text/image/etc.).
  • SageMaker layer: Built-in algorithms (tuned containers for classification, regression, clustering, topic modeling, seq2seq, image class, etc.); JumpStart (pre-trained models, solution templates, examples); notebooks/Studio; training jobs (Docker containers); hyperparameter tuning; inference endpoints; Neo (optimize once, run anywhere); Clarify; Ground Truth; A2I (human review); Marketplace. Containers package code/scripts/models/libs (not primarily for scaling). Choose based on data availability/quality/complexity/feasibility, problem type, cost (built-in/AI services often cheaper than custom training), interpretability needs.
  • Selection skills: Assess data + complexity → ML feasible? Compare algorithms/models (performance vs interpretability vs cost vs latency). Prefer AI services for common problems; JumpStart/Bedrock/built-ins for speed; custom only when needed. Cost-aware: AI services = pay-per-use; SageMaker training/inference = instance-hours + storage.

Exam traps & tips (from official review):

  • Trap: Confusing RNN variants – vanishing gradient solved by LSTM (more powerful/slower) or GRU (faster/lighter). CNN ≠ sequences; RNN/LSTM/GRU for ordered data (translation word order, time-series).
  • Trap: Always picking highest-performance black-box (NN) when business needs interpretability (prefer linear/trees or Clarify/SHAP post-hoc). Intrinsic for simple; post-hoc for complex.
  • Trap: Using Forecast like pure AI services (it needs training data). Polly mispronounces acronyms/business terms → use pronunciation lexicons (not SSML alone). Comprehend for sentiment/entities on social text (not Rekognition). Rekognition Custom Labels needs your labeled S3 data (+ Ground Truth).
  • Trap: Ignoring cost – custom training/endpoints expensive vs AI services/JumpStart/Bedrock FMs or built-ins. SageMaker containers = packaging for train/infer, managed by service.
  • Tip: Stack awareness (infra/frameworks → SageMaker ML → AI services). JumpStart for quick templates. Match service to problem (e.g., crawler + sentiment → Comprehend + Lambda + OpenSearch). Feasibility first: data quantity/quality/complexity. Bedrock for genAI FMs without managing infra.

Hands-on Exercises (Minimized Cost)

All exercises use console-first + tiny payloads + immediate cleanup. No persistent endpoints, no large training jobs, no GPU, no long-running notebooks. Expected total cost: << $1 (usually cents or free-tier-like pay-per-use; AI services charge per character/second/image; delete everything). Assume you create/delete in one sitting (<30-60 min). Use AWS free-sample data or your own tiny files (<1 KB text, <100 KB image/audio). Prefer us-east-1. Monitor Billing/Cost Explorer. Never leave SageMaker instances/endpoints running.

Exercise 1: Select & Invoke AWS AI Services for Business Problems (Core for service selection + cost awareness)

Objective: Map business needs to AI services, experience API/console behavior, apply exam tips (Polly lexicons, Comprehend sentiment, Rekognition labels, Translate, Bedrock FMs, Transcribe). Reinforces “choose AI services for common needs” and cost (pay-per-use beats custom ML).

Steps:

  1. Comprehend (sentiment/entities for social crawler use-case): Console → Amazon Comprehend → Real-time analysis. Paste 2-3 short social posts (e.g., “Love this product! #awesome” and a negative one). Run Entity, Key phrase, Sentiment, Language detection. Note scores.
  2. Rekognition (image analysis): Console → Amazon Rekognition → Image analysis (or Demo). Upload one small public-domain JPG (<50 KB, e.g., street scene). Run Labels, Faces if present. Note confidence. (Optional Custom Labels: just browse; do not start training.)
  3. Polly + lexicon (pronunciation trap): Console → Amazon Polly. Synthesize a short sentence with acronym/business term (e.g., “AWS MLA-C01 exam uses S3 and EC2”). Download MP3. Then create a simple lexicon (XML: <lexeme><grapheme>MLA</grapheme><phoneme>em-el-ay</phoneme></lexeme>), upload, re-synthesize with lexicon, compare audio.
  4. Translate + Transcribe: Translate Console – translate 1 short paragraph EN→ES/FR. Transcribe Console – upload one tiny WAV/MP3 (<10s, speak a sentence) or use sample; start job, view transcript.
  5. Bedrock (foundation model choice): Console → Amazon Bedrock → Model access (enable 1-2 cheap ones if needed, e.g., Amazon Titan Text Lite or available free-tier-ish). Playground: send 1 short prompt (“Summarize: choose ML algorithm for image classification”). Note model choice options + output. Do not provision throughput or fine-tune.
  6. Cleanup: Delete any lexicons, transcription jobs, custom resources. No endpoints created.

Expected results:

  • Comprehend returns sentiment (POSITIVE/NEGATIVE + score), entities, phrases instantly.
  • Rekognition returns labels (e.g., “Car 98%”) with bounding boxes.
  • Polly audio correct after lexicon (acronym sounds right).
  • Translate accurate; Transcribe text matches speech.
  • Bedrock generates coherent response from chosen FM; you see provider/model list. You can now justify: “social sentiment crawler → Comprehend (+ Lambda)”; “pronunciation → Polly lexicon”; “images → Rekognition (or Custom Labels if domain-specific)”; “genAI → Bedrock FM selection by use-case/cost”.

Cost control: < few cents (Comprehend per 100 chars, Rekognition per image, Polly per char, etc.). No infra.

Exam relation: Directly practices service selection tips/traps (Polly lexicon question, Comprehend for sentiment indexing, Rekognition vs custom, Bedrock for FMs). Highlights cost (no training) and when AI service > custom algorithm. Feasibility = “do I need to train?” → usually no.

Exercise 2: Explore SageMaker Built-in Algorithms, JumpStart & Interpretability Path (Algorithms + JumpStart + Clarify awareness)

Objective: Browse/choose built-in algorithms & JumpStart templates by problem type; understand containers, cost of training vs pre-built; note interpretability (Clarify/SHAP). Reinforces algorithm selection, built-ins vs FMs, cost-based choice, interpretability trade-off. No full training to keep cost near-zero.

Steps:

  1. Console exploration (zero compute): SageMaker Console → JumpStart. Browse “Models”, “Solutions”, “Frameworks”. Filter by task (Image Classification, Text Generation, Tabular Classification, Clustering, Time-series). Open 2-3 cards (e.g., XGBoost built-in, object detection, a Bedrock-linked or HuggingFace model). Note: problem type, framework, estimated cost cues, deploy options. Check “Algorithms” list (Linear Learner, XGBoost, K-Means, PCA, LDA, Seq2Seq, Image Classification, etc.).
  2. Built-in algorithm quick view: Still in console, note which are supervised/unsupervised, input formats (recordIO/CSV), and typical use (e.g., Linear Learner for regression/classification – high interpretability; CNN-style for images). Open documentation links for 1-2 (no launch).
  3. Clarify/interpretability (docs + conceptual): SageMaker Console → Clarify. Read overview (bias + SHAP feature attributions). Note it works post-training on models (intrinsic for linear/trees; post-hoc SHAP for others). No job launched.
  4. Optional tiny notebook peek (strict cost limit): If you must touch compute – SageMaker → Notebook instances → Create (ml.t3.medium or smallest CPU, 5 GB volume). Start, open Jupyter, create a 1-cell notebook that only import sagemaker; print(sagemaker.image_uris.retrieve("xgboost", region)) or lists JumpStart models via SDK (no fit/deploy). Immediately Stop + Delete notebook instance + any S3 artifacts you created. Total runtime <10 min.
  5. Algorithm decision simulation: On paper/notepad (or text file): Given “image classification, need some interpretability, low cost” → choose Rekognition or JumpStart CNN-style / built-in Image Classification + later Clarify. “Sequence translation” → RNN/LSTM or Translate service or seq2seq built-in. “Simple tabular + explainability” → Linear Learner or XGBoost + Clarify (intrinsic/post-hoc).
  6. Cleanup: Delete notebook instance (confirm terminated), any S3 buckets/folders created, JumpStart nothing persistent. Check SageMaker → Training/Inference = empty.

Expected results:

  • JumpStart shows ready templates/models with one-click potential (you only browsed). You can list 5+ built-ins and match to problems (K-Means clustering, PCA reduction, etc.).
  • Understand containers hold the algorithm code.
  • Clarify = SHAP for “why this prediction”.
  • Decision notes link data complexity → algorithm (e.g., ordered text → LSTM/GRU or Translate; images → CNN/Rekognition). No models trained = no charges beyond possible few minutes of t3.medium (~$0.05 or less).

Cost control: Pure console = $0. Notebook (if used) = stop/delete immediately → cents. Never create endpoint or HPO job.

Exam relation: Practices “choose built-in algorithms, FMs, JumpStart templates”; cost selection; interpretability (Clarify/SHAP post-hoc vs intrinsic linear/trees). Traps avoided: knowing CNN vs RNN/LSTM/GRU use-cases, when JumpStart/AI service beats from-scratch. Feasibility assessment via browsing problem types.

Exercise 3: End-to-End Lightweight Decision Flow + Cost Comparison (Feasibility, comparison, cost, full task skills)

Objective: Assess fake business problem → choose approach (AI service vs built-in vs custom) → “implement” tiny version → evaluate interpretability/cost. Ties all knowledge.

Steps:

  1. Define problem (use this or similar): “Analyze customer support call audio for sentiment + key entities, then generate a short spoken summary in Spanish; need some explanation of sentiment. Low budget, quick.”
  2. Assess: Data = short audio. Complexity = speech + NLP + TTS + translation. Feasible with AI services (no custom training needed). Interpretability = Comprehend scores + later Clarify if model used. Cost = pay-per-use.
  3. Implement minimal:
  4. Transcribe Console: tiny audio → text.
  5. Comprehend: sentiment + entities on transcript.
  6. Translate: text → ES.
  7. Polly: Spanish text → audio (add lexicon if terms).
  8. (Optional) Note: if you had tabular features you could have used Linear Learner + Clarify for higher intrinsic interpretability.
  9. Compare alternatives on paper: (a) Pure AI services (cheapest, fastest). (b) JumpStart text model + Bedrock. (c) Custom RNN/LSTM training in SageMaker (expensive, needs data/labels, longer). Choose (a) for cost/interpretability needs.
  10. Interpretability note: Comprehend gives confidence scores (intrinsic-ish); for black-box would add Clarify SHAP.
  11. Cleanup: Delete jobs, audio files in S3 (if any), lexicons.

Expected results: Working tiny pipeline (transcript → sentiment “POSITIVE 0.92” + entities → Spanish audio). Decision matrix shows AI services win on cost/speed for this problem; you documented trade-offs. Matches “selecting AI services to solve common business needs” + “selecting models/algorithms based on costs” + interpretability.

Cost control: Only AI service calls on tiny data = cents max. No SageMaker compute.

Exam relation: Full skill practice – data/complexity feasibility, compare/select (algorithms vs AI vs JumpStart/Bedrock), cost, interpretability. Directly mirrors sample questions (Polly lexicon, Comprehend sentiment design, service choice). Avoids traps of over-building custom NNs or ignoring LSTM/GRU/interpretability trade-offs.

Quick Study Checklist Before Exam

  • Match 10+ algorithms/services to problem types + cost/interpretability.
  • Draw AWS ML stack.
  • Explain vanishing gradient → LSTM vs GRU.
  • Intrinsic vs post-hoc + Clarify/SHAP.
  • When Forecast/Personalize/Bedrock/Rekognition Custom vs pure pre-trained.
  • Always cleanup + prefer serverless/AI services for cost.

Perform the three exercises in one low-cost session. Review official AWS docs for each service/algorithm (built-in list, JumpStart, Clarify, Bedrock model cards) for any UI changes. This builds exactly the knowledge + skills in Task 2.1 while keeping billing minimal.