MLA-C02 · LESSON 2
ML Model and Foundation Model (FM) Development24% · 3 topics
Learn how to choose ML and AI modeling approaches, train, fine-tune and customize models, and analyze and evaluate performance.
2.1Choose an appropriate modeling approach
2.1 Choose a modeling approach suited to ML and AI solutions.
Concept
Development effort increases in this order: ready-made AI services (Rekognition, Comprehend and others) → foundation models (Bedrock, JumpStart) → SageMaker AI built-in algorithms (XGBoost, Linear Learner, k-means, DeepAR, BlazingText and others) → your own models. Choose by problem type (classification, regression, time series, clustering, images, natural language), data volume, interpretability and cost.
How it works / steps
- Translate the problem into an ML task
- Check whether a ready-made AI service or a foundation model is enough
- For tabular classification and regression, start with built-in algorithms such as XGBoost
- Consider DeepAR and similar for time-series forecasting, and BlazingText and similar for text classification
- Choose a simple model if interpretability is required
Workplace example
First try inquiry classification with prompts to a Bedrock foundation model, and build your own classification model with labeled data only for categories where accuracy falls short.
Common confusions and exam tips
- Without labels, supervised algorithms cannot be used
- XGBoost tends to perform well on tabular data
- The most complex model is not always best (cost, interpretability, maintenance)
Mini quiz
Q1. A team with few ML experts wants to automatically build classification models from tabular data and compare candidates. Which is the most appropriate method?
- Pass the table to a Bedrock foundation model and have it classify
- Pick a pretrained JumpStart model and fine-tune it on the table
- Try preprocessing, algorithms and tuning automatically with SageMaker Autopilot
- Search XGBoost hyperparameters with automatic model tuning
Show answer and explanation
Answer: C Try preprocessing, algorithms and tuning automatically with SageMaker Autopilot
Autopilot automatically handles preprocessing, algorithm selection and tuning from tabular data, and lets you compare candidate models. [Other options] Automatic model tuning doesn't choose algorithms or preprocess. JumpStart fine-tuning and foundation models don't build and compare candidates automatically.
Q2. You want to choose a Bedrock foundation model for an assistant. Which is the most appropriate approach?
- Compare quality, latency and cost with Bedrock evaluations on your own question set
- Pick the top model on public benchmarks and verify it in production
- Start with the largest model and switch to smaller ones if cost becomes an issue
- Try a few questions in the Bedrock playground and pick the best impression
Show answer and explanation
Answer: A Compare quality, latency and cost with Bedrock evaluations on your own question set
Choose FMs by comparing quality, latency and cost on data from your own tasks. Bedrock evaluations let you compare. [Other options] Public benchmarks don't show quality for your use. Impressions from a few tries aren't reproducible. Starting largest postpones the cost requirement.
Reference links
2.2Train, fine-tune and customize models
2.2 Train, fine-tune and customize models for ML and AI solutions.
Concept
Train models with SageMaker training jobs and tune them with automatic model tuning (hyperparameter optimization: Bayesian, random, grid, Hyperband). Lower costs with Managed Spot Training (with checkpoints), and train large models faster with distributed training. Address overfitting with regularization (L1, L2), dropout and early stopping. Foundation models can be fine-tuned, continually pre-trained and distilled in Bedrock and JumpStart.
How it works / steps
- Decide the training script and hyperparameter search ranges
- Optimize the objective metric with automatic model tuning
- Lower costs with Spot training and checkpoints while preparing for interruptions
- Watch for signs of overfitting (the gap between training and validation error) and adjust regularization
- Detect problems such as vanishing gradients with SageMaker Debugger
Workplace example
Train an image classification model with Managed Spot Training, saving checkpoints to S3 every 30 minutes so it resumes where it left off if interrupted.
Common confusions and exam tips
- Checkpoint configuration is essential for Spot training
- Too large a learning rate does not converge; too small is slow
- Hyperparameters are different from the parameters (weights) the model learns
Mini quiz
Q1. Training accuracy is 99%, but validation accuracy is only 70%. Which is the most appropriate countermeasure?
- Increase the learning rate and train until training accuracy reaches 100%
- Make the model even larger and more complex, and greatly increase the number of epochs
- Stop using validation data and evaluate the model on training accuracy alone
- Strengthen regularization or use early stopping, and also consider adding training data
Show answer and explanation
Answer: D Strengthen regularization or use early stopping, and also consider adding training data
High accuracy only on training data is overfitting. Improve generalization with regularization, dropout, early stopping and more data.
Q2. Accuracy is low on both training and validation data, stuck around 60% on each. Which is the most appropriate countermeasure?
- Add features or use a more expressive model, and weaken regularization
- Strengthen regularization further so the model fits training data less
- Mix validation data into training data so accuracy looks higher
- Halve the number of training records to shorten training time
Show answer and explanation
Answer: A Add features or use a more expressive model, and weaken regularization
Low on both is insufficient learning (underfitting). Increase model capacity or features.
Reference links
2.3Analyze and evaluate performance
2.3 Analyze and evaluate the performance of ML and AI systems.
Concept
For classification evaluation, use the confusion matrix, precision, recall, F1 and AUC-ROC; for regression, RMSE, MAE and R². Use MLflow in SageMaker for experiment tracking, and shadow testing (trying the new model on a copy of production traffic) for near-production validation. For foundation models and RAG, measure correctness, relevance and faithfulness with Bedrock evaluations (including knowledge base evaluation).
How it works / steps
- Decide evaluation metrics that fit the business goal
- Compare training results on validation data and record them in MLflow
- Check for overfitting and underfitting with learning curves
- Compare under near-production conditions with shadow testing
- For generative AI, use Bedrock evaluations or LLM-based evaluation
Workplace example
For a fraud detection model where misses are costly, prioritize recall and lower the threshold, absorbing the increase in false positives with a staff review process.
Common confusions and exam tips
- Prioritize recall to reduce misses, and precision to reduce false positives
- With imbalanced data, look at F1 or AUC rather than accuracy
- Shadow test responses are not returned to users
Mini quiz
Q1. The confusion matrix of a fraud detection model shows many false negatives (misses). You want to reduce misses without changing the model. Which is the most appropriate adjustment?
- Remove all missed transactions from the evaluation data
- Recount false negatives as correct results
- Raise the classification threshold to narrow what is judged positive
- Lower the classification threshold to widen what is judged positive
Show answer and explanation
Answer: D Lower the classification threshold to widen what is judged positive
Lowering the threshold raises recall and reduces misses, but false positives increase. Decide based on business costs.
Q2. You are running many experiments and lost track of which hyperparameters and data produced the best metrics. Which is the most appropriate method?
- Register each model in SageMaker Model Registry and compare version numbers
- Log each experiment's parameters, metrics and artifacts in managed MLflow
- Write metric values in training job tags and list them with Resource Groups
- Send training logs to CloudWatch Logs and search metrics with Logs Insights
Show answer and explanation
Answer: B Log each experiment's parameters, metrics and artifacts in managed MLflow
MLflow experiment tracking records parameters, metrics and models, enabling comparison and reproduction. [Other options] Model Registry manages versions and doesn't compare parameters and metrics. Log searches and tags don't give structured experiment comparison.
Reference links
Lessons are written by this site based on public information and do not guarantee exam content. Product specifications change, so check the latest information at the reference links.
Notes (unofficial, original questions, no pass guarantee)
- The questions on this site are original practice questions written by this site based on publicly available skills outlines and exam guides. They are not actual exam questions.
- Amazon Web Services, AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. This site is not affiliated with or endorsed by AWS.
- This content is a study aid and does not guarantee a pass. Exam content, format and prerequisites may change without notice; always check the latest information on the official page before taking the exam.
- Your accuracy on the mock exam cannot be converted to the official (scaled) score and does not predict a pass or fail.
- Progress is saved only in this browser (localStorage) unless you sign in with Google to sync it. You can delete it from the Cookie & storage settings page (Japanese).