Based on the MLS-C01 exam guideReport an error
Every other exam question comes from Domain 3. Tie the four axes of algorithm selection → deep learning → tuning → evaluation into one flow.
[Business problem]
│
├─ 1) Map the ML problem type
│ Labels present → supervised learning (classification/regression)
│ No labels → unsupervised (clustering/anomaly detection/dimensionality reduction)
│ Reward signal → reinforcement learning
│
├─ 2) Select the algorithm
│ Structured tabular data → XGBoost, Linear Learner
│ Images → CNN (Image Classification)
│ Sequences/time series → RNN/LSTM, DeepAR
│ Text → BlazingText, Transformer
│
├─ 3) Train / tune
│ Hyperparameters = set by a person before training
│ Search with AMT (Bayesian), balance overfitting ↔ underfitting
│
└─ 4) Evaluate / debug
Classification = precision/recall/F1/AUC, regression = RMSE/MAE/R²
Debugger (process) / Clarify (bias and explainability)| Algorithm (built-in) | Problem type | Input data shape | Typical clue words |
|---|---|---|---|
| XGBoost | Classification, regression, ranking | Structured table (CSV, libsvm) | "Tabular form", "missing values, mixed types" |
| Linear Learner | Classification, regression | Structured table (protobuf, CSV) | "Linear", "high-dimensional sparse" |
| KNN | Classification, regression | Numeric vectors | "Decide from similar samples" |
| Factorization Machines | Classification, regression (recommendation) | Very sparse vectors | "Recommendation", "click-through rate" |
| Image Classification | Image classification | Images | "One label per photo" |
| Object Detection | Location + class | Images + bounding boxes | "How many, and where" |
| Semantic Segmentation | Pixel-level classification | Images + masks | "Pixel level", "region boundaries" |
| DeepAR | Time-series forecasting | Many time series (JSON Lines) | "Demand forecasting per store/SKU" |
| BlazingText | Text classification, embeddings | Text | "Sentiment classification", "Word2Vec" |
| Object2Vec | Embeddings of object pairs | Pairs (sentence-sentence, user-item) | "Relationship between two entities" |
| Seq2Seq | Sequence → sequence | Pairs of token sequences | "Translation", "summarization" |
| LDA / NTM | Topic modeling | Document-word counts | "Group into N topics" |
| K-Means | Clustering | Numeric vectors | "Segments", "no labels" |
| PCA | Dimensionality reduction | Numeric vectors | "Too many features" |
| Random Cut Forest | Anomaly detection | Numeric, streaming | "Abnormal spikes", "outliers" |
| IP Insights | Anomalous relationship detection | (entity, IPv4) pairs | "Abnormal login IP" |
"Start with XGBoost for structured tabular data" is a strong default in both practice and the exam. Gradient boosting handles missing values, mixed types, and nonlinear interactions well, and has plenty of room for tuning. Conversely, when the data shape is explicitly images, sequences, or text, you branch to CNN, RNN/DeepAR, and BlazingText respectively. The first clue in an algorithm question is almost always "what shape is the data (table/image/sequence/text)?"
| Architecture | Suitable data | Key point |
|---|---|---|
| CNN | Images, spatial patterns | Extracts local features with convolutions |
| RNN/LSTM | Sequences, time series, text | Remembers order and context |
| Transformer | Text, long-range dependencies | Attention, parallel processing |
| Autoencoder | Dimensionality reduction, anomaly detection | Reconstruction error |
| Activation function | Use |
|---|---|
| ReLU | Default for hidden layers (mitigates vanishing gradients) |
| Sigmoid | Binary classification output |
| Softmax | Multi-class classification output |
| Tanh | Zero-centered, RNN gates |
| Problem type | Output neurons | Output activation | Loss function |
|---|---|---|---|
| Binary classification | 1 | Sigmoid | Binary cross-entropy |
| Multi-class (exclusive) | Number of classes | Softmax | Categorical cross-entropy |
| Multi-label (overlap allowed) | Number of labels | Sigmoid per label | Per-label binary cross-entropy |
| Regression | 1 | None (linear) | MSE (outlier-sensitive) / MAE (robust) |
The output-layer activation is a direct translation of the problem type. Binary classification is Sigmoid (a single 0-1 probability), multi-class is Softmax (a probability vector summing to 1), and regression is no activation (linear). For hidden layers, ReLU, which reduces vanishing gradients, is practically the default. Options like "Sigmoid for a multi-class output" or "Softmax for a regression output" are traps.
⚠️ Pitfall: "Several tags can be attached to each image at the same time" is a multi-label problem. It is not exclusive multi-class, so the answer is not Softmax but Sigmoid per label.
| Concept | Content |
|---|---|
| Parameter vs hyperparameter | Obtained through training vs set by a person before training |
| learning rate | Too large diverges, too small is slow |
| epochs/early stopping | Stop before overfitting |
| regularization (L1/L2, dropout) | Suppresses overfitting |
| AMT search strategy | Bayesian (default, efficient) > Random > Grid |
| Search strategy | Behavior | Strength / weakness |
|---|---|---|
| Bayesian | Infers the next candidate from earlier trial results | Good solutions with few jobs (AMT default) / sequential |
| Random | Randomly samples from the search space | Easy to parallelize / doesn't use history |
| Grid | Exhaustively tries every combination of specified values | Complete search / combinations explode as dimensions grow |
| Hyperband | Stops bad jobs early and reallocates resources | Efficient for iterative training / epoch evaluation must be possible |
The default strategy of SageMaker Automatic Model Tuning is Bayesian optimization. Whereas grid/random search ignores the search history and tries blindly, Bayesian optimization picks the next candidate intelligently from earlier trial results. So with the same job budget it has a higher chance of finding better hyperparameters. When you see a clue like "efficient / optimal with few trials," it is Bayesian. Also, for the objective metric direction, errors (RMSE) are Minimize and performance (F1/AUC) is Maximize.
| Symptom | Diagnosis | Response |
|---|---|---|
| Training accuracy high, validation low | Overfitting | Increase regularization, more data, simplify the model, early stopping |
| Both training and validation low | Underfitting | Increase model complexity, more features, train longer |
| Loss diverges/oscillates | Learning rate too large | Lower the learning rate |
| Training loss barely decreases | Learning rate too small / insufficient capacity | Raise the learning rate, more layers/trees |
| Only validation loss rises again | Passed the overfitting onset | Early stopping, dropout, data augmentation |
| Score fluctuates widely across folds | Insufficient data / unstable split | Cross-validation, stratified split |
| Good in training but bad only in production | Data leakage / distribution difference | Remove leaking features, time-based split |
| Only the minority class keeps being wrong | Class imbalance | Class weights, resampling, threshold adjustment |
Predicted: positive Predicted: negative
Actual positive │ TP (hit positive) │ FN (missed positive) │ ← denominator of recall
Actual negative │ FP (false alarm) │ TN (hit negative) │
↑ denominator of precision (TP+FP)
Precision = TP / (TP + FP) "Of what was called positive, the true ones"
Recall = TP / (TP + FN) "Of the true positives, the ones found"
F1 = 2 · P · R / (P + R) "Harmonic mean of precision and recall"
Accuracy = (TP + TN) / total "Don't trust it when imbalanced"
FPR = FP / (FP + TN) x-axis of the ROC curve| Metric | When |
|---|---|
| Accuracy | Balanced data only |
| Precision | When FP cost is large (spam) |
| Recall | When FN cost is large (disease/fraud) |
| F1 | Imbalanced, balancing FP and FN |
| ROC-AUC | Comparing models independent of the threshold |
| PR-AUC | Extreme imbalance |
| RMSE / MAE | Sensitive to large errors / robust to outliers (regression) |
Model selection and threshold decision are two separate steps. First choose the "model that ranks well" with a threshold-independent metric like AUC, then set the operating threshold that fits the FP/FN costs afterward. Even if the cost structure changes, you only need to adjust the threshold without retraining. Debugging splits as SageMaker Debugger (tensors, gradients, and overfitting in the training process) and, for bias and explainability, Clarify (group fairness, SHAP).
⚠️ Pitfall: Lowering the threshold raises recall and lowers precision, and raising it raises precision and lowers recall, a trade-off every time. "Raise both at once" is impossible through threshold adjustment alone.
| Clue in the stem | Answer to pick |
|---|---|
| "Customer table of rows and columns", "mixed missing values and categories" | XGBoost |
| "High-dimensional sparse vectors", "linear baseline" | Linear Learner |
| "One label per photo" | Image Classification (CNN) |
| "Down to the location inside the image" | Object Detection |
| "Forecast weekly sales for hundreds of stores" | DeepAR |
| "Sentiment classification of review text", "word vectors" | BlazingText |
| "Relationship embedding of user-item pairs" | Object2Vec |
| "Group documents into topics without labels" | LDA / NTM |
| "Group customers without labels" | K-Means |
| "Detect abnormal spikes without labels" | Random Cut Forest |
| "Too many features, so training is slow" | PCA |
| Clue in the stem | Answer to pick |
|---|---|
| "Only training accuracy is high, validation is low" | Overfitting → regularization, dropout, early stopping |
| "Both training and validation are low" | Underfitting → increase complexity, features, training amount |
| "Loss becomes NaN or oscillates" | Learning rate too large → reduce it |
| "Want to reduce the number of features automatically" | L1 regularization |
| "Many correlated features, so coefficients are unstable" | L2 regularization |
| "A good combination with few training jobs" | Bayesian optimization (AMT default) |
| "Want to kill bad training jobs early" | Hyperband strategy |
| "Automatically detect vanishing gradients and overfitting during training" | SageMaker Debugger |
| "Explain fairness between groups and feature contributions" | SageMaker Clarify (SHAP) |
| "Data is small, so use a pretrained model" | Transfer learning (fine-tuning) |
| Clue in the stem | Answer to pick |
|---|---|
| "Blocking legitimate mail as spam is fatal" | Precision |
| "Missing cancer or fraud is fatal" | Recall |
| "Positives are only 0.3%" | PR-AUC (+ Recall) |
| "Compare models regardless of the threshold" | ROC-AUC |
| "Bigger penalty for large errors" | RMSE |
| "Many outliers distort the error metric" | MAE |
| "Accuracy is 99% yet useless" | Imbalance → switch to F1/PR-AUC |
| Comparison | Key difference |
|---|---|
| Supervised vs unsupervised | Labels present vs absent |
| Classification vs regression | Categorical output vs continuous output |
| XGBoost vs Linear Learner | Nonlinear boosted trees, handles missing values natively vs linear model, needs scaling, strong on high-dimensional sparse data |
| XGBoost vs deep learning | Structured tabular data vs images/sequences/text |
| BlazingText vs Object2Vec | Word- and document-level classification/embeddings vs relationship embeddings of arbitrary object pairs |
| LDA vs NTM | Probabilistic generative model (non-neural) vs neural-network-based topic model (can use GPU) |
| K-Means vs KNN | Unsupervised clustering (no labels) vs supervised classification/regression (decides from neighbor labels) |
| RCF vs autoencoder anomaly detection | Tree-based anomaly score, streaming vs reconstruction error, requires training on normal data |
| CNN vs RNN vs Transformer | Spatial local patterns vs sequential context vs long-range dependencies via attention and parallel training |
| Sigmoid vs Softmax | One independent probability (binary, multi-label) vs a vector summing to 1 (exclusive multi-class) |
| Overfitting vs underfitting | Only validation is low (high variance) vs both are low (high bias) |
| L1 vs L2 | Pushes coefficients to 0 (sparse, feature selection) vs shrinks coefficients (spreads across correlated features) |
| Bayesian vs Random vs Grid | Efficiency from using history vs random parallel vs exhaustive search (combinatorial explosion) |
| Precision vs Recall | Suppress false alarms (FP) vs suppress misses (FN) |
| ROC-AUC vs PR-AUC | Comparison for balanced to moderately imbalanced vs more honest under extreme imbalance |
| RMSE vs MAE | Squared so sensitive to large errors vs absolute value so robust to outliers |
| Debugger vs Clarify | Training process (tensors, gradients, convergence) vs bias and explainability (fairness, SHAP) |
| Question form | What the stem looks like | How to solve it |
|---|---|---|
| Algorithm selection | Data shape + prediction target | Narrow down in the order data shape → problem type → built-in |
| Activation/loss matching | Neural network output-layer design | First check the number of classes and whether they are exclusive |
| Overfitting diagnosis | Two numbers: training/validation scores | A gap means overfitting; both low means underfitting |
| Metric selection | Which of FP or FN cost is larger | Choose the metric that reduces the larger cost |
| Tuning strategy | Mentions of budget, job count, efficiency | Efficiency = Bayesian, early stopping = Hyperband |
| Debugging/explanation requirement | "Why did it predict this?", "Is it fair?" | Training process = Debugger, bias and contribution = Clarify |
In the next note we cover the last domain, ML implementation and operations (Domain 4), and the end-to-end scenarios that cut across all four domains.
Click a choice to reveal the answer and explanation.
Question 1
You want to predict churn from structured tabular customer data (mixed numeric and categorical, with some missing values). Which SageMaker built-in algorithm is MOST appropriate to try first?
Question 2
You are designing the output layer of a neural network that classifies into 3 classes (low/medium/high risk). Which is the correct activation function?
Question 3
A model has 98% accuracy on the training data but 72% accuracy on the validation data, a large gap. What response should be prioritized?
Question 4
In SageMaker Automatic Model Tuning, you want to efficiently find good hyperparameters with a small training job budget. Which recommended search strategy and reason are correct?
Question 5
In a fraud transaction detection model, positives (fraud) are 0.3% of the total and the cost of missing fraud is very high. Which combination of evaluation metrics should be the primary focus?