CertNote/ 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
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
  • Week 1
    • 1.The ML Lifecycle (from a Specialty Perspective)
    • 2.Data Storage for ML: S3, EFS, FSx for Lustre, and Data Formats
    • 3.Data Ingestion: Kinesis, Glue, Batch vs. Streaming
    • 4.Data Labeling: SageMaker Ground Truth, Active Learning, Label Quality
    • 5.Week 1 Comprehensive Review: ML Overview & Data Engineering 1
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
  • Week 7
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
    • 1.Domains 1 & 2 Integration: Data Engineering + EDA
    • 2.Domain 3 Integration: Modeling (Algorithm to Evaluation)
    • 3.Domain 4 Integration: ML Implementation & Operations
    • 4.Synthesis: 4 Domains + End-to-End Scenarios
    • 5.D-Day Wrap-Up: Exam Structure, Time Allocation, Requirement Translation Tables, Trap Roundup
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← MLS-C01/Week 12/Day 2

Based on the MLS-C01 exam guide·Report an error

MLS-C01· AssociateWeek 12 · Day 2~37 min read

Day 2 - Domain 3 Integration: Modeling (Algorithm to Evaluation)

📌 Key Takeaways

  • Domain 3 (modeling) carries the largest exam weight at 36%. It asks about the whole process: problem definition → algorithm selection → training and tuning → evaluation and debugging.
  • The first clue for algorithm selection is always the shape of the data. Tables = XGBoost/Linear Learner, images = CNN, sequences = DeepAR/RNN, text = BlazingText.
  • The output-layer activation is a literal translation of the problem type. Binary = Sigmoid, multi-class = Softmax, regression = no activation (linear).
  • Overfitting (only validation is low) and underfitting (both are low) have a fixed symptom → diagnosis → response. Branch immediately from the symptom sentence alone.
  • A metric is a translation of business cost. If FP is expensive, Precision; if FN is expensive, Recall; if extremely imbalanced, PR-AUC.

Flow Map: From Problem Definition to Evaluation

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 Selection: Decided by Data Shape

Algorithm (built-in)Problem typeInput data shapeTypical clue words
XGBoostClassification, regression, rankingStructured table (CSV, libsvm)"Tabular form", "missing values, mixed types"
Linear LearnerClassification, regressionStructured table (protobuf, CSV)"Linear", "high-dimensional sparse"
KNNClassification, regressionNumeric vectors"Decide from similar samples"
Factorization MachinesClassification, regression (recommendation)Very sparse vectors"Recommendation", "click-through rate"
Image ClassificationImage classificationImages"One label per photo"
Object DetectionLocation + classImages + bounding boxes"How many, and where"
Semantic SegmentationPixel-level classificationImages + masks"Pixel level", "region boundaries"
DeepARTime-series forecastingMany time series (JSON Lines)"Demand forecasting per store/SKU"
BlazingTextText classification, embeddingsText"Sentiment classification", "Word2Vec"
Object2VecEmbeddings of object pairsPairs (sentence-sentence, user-item)"Relationship between two entities"
Seq2SeqSequence → sequencePairs of token sequences"Translation", "summarization"
LDA / NTMTopic modelingDocument-word counts"Group into N topics"
K-MeansClusteringNumeric vectors"Segments", "no labels"
PCADimensionality reductionNumeric vectors"Too many features"
Random Cut ForestAnomaly detectionNumeric, streaming"Abnormal spikes", "outliers"
IP InsightsAnomalous 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)?"

Deep Learning: Architectures and Uses

ArchitectureSuitable dataKey point
CNNImages, spatial patternsExtracts local features with convolutions
RNN/LSTMSequences, time series, textRemembers order and context
TransformerText, long-range dependenciesAttention, parallel processing
AutoencoderDimensionality reduction, anomaly detectionReconstruction error
Activation functionUse
ReLUDefault for hidden layers (mitigates vanishing gradients)
SigmoidBinary classification output
SoftmaxMulti-class classification output
TanhZero-centered, RNN gates

Matching Output Layer and Loss Function

Problem typeOutput neuronsOutput activationLoss function
Binary classification1SigmoidBinary cross-entropy
Multi-class (exclusive)Number of classesSoftmaxCategorical cross-entropy
Multi-label (overlap allowed)Number of labelsSigmoid per labelPer-label binary cross-entropy
Regression1None (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.

Hyperparameter Tuning

ConceptContent
Parameter vs hyperparameterObtained through training vs set by a person before training
learning rateToo large diverges, too small is slow
epochs/early stoppingStop before overfitting
regularization (L1/L2, dropout)Suppresses overfitting
AMT search strategyBayesian (default, efficient) > Random > Grid
Search strategyBehaviorStrength / weakness
BayesianInfers the next candidate from earlier trial resultsGood solutions with few jobs (AMT default) / sequential
RandomRandomly samples from the search spaceEasy to parallelize / doesn't use history
GridExhaustively tries every combination of specified valuesComplete search / combinations explode as dimensions grow
HyperbandStops bad jobs early and reallocates resourcesEfficient for iterative training / epoch evaluation must be possible
  • Objective metric direction: errors (RMSE, log loss) are Minimize; performance (F1, AUC) is Maximize.
  • If you set the number of concurrent jobs too large, there is less history for the Bayesian method to reference and its advantage disappears.

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.

Overfitting and Underfitting: Symptom → Diagnosis → Response

SymptomDiagnosisResponse
Training accuracy high, validation lowOverfittingIncrease regularization, more data, simplify the model, early stopping
Both training and validation lowUnderfittingIncrease model complexity, more features, train longer
Loss diverges/oscillatesLearning rate too largeLower the learning rate
Training loss barely decreasesLearning rate too small / insufficient capacityRaise the learning rate, more layers/trees
Only validation loss rises againPassed the overfitting onsetEarly stopping, dropout, data augmentation
Score fluctuates widely across foldsInsufficient data / unstable splitCross-validation, stratified split
Good in training but bad only in productionData leakage / distribution differenceRemove leaking features, time-based split
Only the minority class keeps being wrongClass imbalanceClass weights, resampling, threshold adjustment
  • Raising regularization increases bias and lowers variance, which is the response to overfitting; raising model capacity lowers bias and increases variance, which is the response to underfitting.

Evaluation: Metrics Are a Translation of Business Cost

            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
MetricWhen
AccuracyBalanced data only
PrecisionWhen FP cost is large (spam)
RecallWhen FN cost is large (disease/fraud)
F1Imbalanced, balancing FP and FN
ROC-AUCComparing models independent of the threshold
PR-AUCExtreme imbalance
RMSE / MAESensitive 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.

Exam Clue Keyword → Answer Translation Table

Data Shape Clues

Clue in the stemAnswer 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

Symptom and Requirement Clues

Clue in the stemAnswer 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)

Metric Clues

Clue in the stemAnswer 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

Confusing Pairs Comparison Table

ComparisonKey difference
Supervised vs unsupervisedLabels present vs absent
Classification vs regressionCategorical output vs continuous output
XGBoost vs Linear LearnerNonlinear boosted trees, handles missing values natively vs linear model, needs scaling, strong on high-dimensional sparse data
XGBoost vs deep learningStructured tabular data vs images/sequences/text
BlazingText vs Object2VecWord- and document-level classification/embeddings vs relationship embeddings of arbitrary object pairs
LDA vs NTMProbabilistic generative model (non-neural) vs neural-network-based topic model (can use GPU)
K-Means vs KNNUnsupervised clustering (no labels) vs supervised classification/regression (decides from neighbor labels)
RCF vs autoencoder anomaly detectionTree-based anomaly score, streaming vs reconstruction error, requires training on normal data
CNN vs RNN vs TransformerSpatial local patterns vs sequential context vs long-range dependencies via attention and parallel training
Sigmoid vs SoftmaxOne independent probability (binary, multi-label) vs a vector summing to 1 (exclusive multi-class)
Overfitting vs underfittingOnly validation is low (high variance) vs both are low (high bias)
L1 vs L2Pushes coefficients to 0 (sparse, feature selection) vs shrinks coefficients (spreads across correlated features)
Bayesian vs Random vs GridEfficiency from using history vs random parallel vs exhaustive search (combinatorial explosion)
Precision vs RecallSuppress false alarms (FP) vs suppress misses (FN)
ROC-AUC vs PR-AUCComparison for balanced to moderately imbalanced vs more honest under extreme imbalance
RMSE vs MAESquared so sensitive to large errors vs absolute value so robust to outliers
Debugger vs ClarifyTraining process (tensors, gradients, convergence) vs bias and explainability (fairness, SHAP)

Typical Question Forms in Domain 3

Question formWhat the stem looks likeHow to solve it
Algorithm selectionData shape + prediction targetNarrow down in the order data shape → problem type → built-in
Activation/loss matchingNeural network output-layer designFirst check the number of classes and whether they are exclusive
Overfitting diagnosisTwo numbers: training/validation scoresA gap means overfitting; both low means underfitting
Metric selectionWhich of FP or FN cost is largerChoose the metric that reduces the larger cost
Tuning strategyMentions of budget, job count, efficiencyEfficiency = Bayesian, early stopping = Hyperband
Debugging/explanation requirement"Why did it predict this?", "Is it fair?"Training process = Debugger, bias and contribution = Clarify

Self-Check Questions

  1. With no labels, you want to group customers into natural clusters? → K-Means (unsupervised clustering)
  2. A strong default for classifying structured tabular data? → XGBoost
  3. The built-in algorithm for time-series demand forecasting? → DeepAR
  4. Output activation for multi-class classification? → Softmax
  5. Training accuracy 99%, validation 70%? → Overfitting → regularization, data augmentation, early stopping
  6. AMT's efficient default search strategy? → Bayesian optimization
  7. Direction of the objective metric for regression tuning? → Minimize (RMSE, etc.)
  8. The service that automatically detects vanishing gradients during training? → SageMaker Debugger
  9. Output layer when several tags are attached to one image at the same time? → Sigmoid per label
  10. The regularization that automatically reduces the number of features? → L1 (Lasso)
  11. The main metric for classification with a 0.3% positive ratio? → Recall + PR-AUC
  12. The metric to look at instead of RMSE in regression with many outliers? → MAE
  13. What happens to precision and recall when you lower the threshold? → Recall up, precision down (always a trade-off)

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.

📖 Glossary

  • Hyperparameter: A setting a person decides before training. Distinguished from the weights (parameters) obtained by training.
  • Overfitting / underfitting: A state that fits only the training data well and is weak on new data / a state that cannot even fit the training data.
  • Bias-variance trade-off: The trade-off in which simplifying the model increases bias and making it complex increases variance.
  • Regularization: A technique that prevents overfitting by penalizing weights so they can't grow large. L1 pushes them to 0, and L2 shrinks them overall.
  • Early stopping: Halting training when validation loss stops improving, preventing both overfitting and waste.
  • Bayesian optimization: A search method that infers and picks the next hyperparameters to test based on the results of trials so far.
  • Confusion matrix: A 2×2 table crossing actual and predicted. Most classification metrics are derived from TP, FP, FN, and TN.
  • PR-AUC: The area under the precision-recall curve. When positives are extremely rare, it shows performance differences more honestly than ROC-AUC.
  • Transfer learning: A method of taking a model pretrained on large-scale data and fine-tuning it with a small amount of data.
  • SageMaker Debugger / Clarify: A tool that catches tensor and gradient anomalies in the training process / a tool that explains bias in data and models and prediction contributions.

📝 Practice Questions

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?

PreviousDomains 1 & 2 Integration: Data Engineering + EDAWeek 12 · Day 1Next Domain 4 Integration: ML Implementation & OperationsWeek 12 · Day 3

Official references

  • MLS-C01 official exam page(opens in a new tab)
  • Amazon SageMaker AI documentation(opens in a new tab)

On this page

  • Key Takeaways
  • Flow Map: From Problem Definition to Evaluation
  • Algorithm Selection: Decided by Data Shape
  • Deep Learning: Architectures and Uses
  • Matching Output Layer and Loss Function
  • Hyperparameter Tuning
  • Overfitting and Underfitting: Symptom → Diagnosis → Response
  • Evaluation: Metrics Are a Translation of Business Cost
  • Exam Clue Keyword → Answer Translation Table
  • Data Shape Clues
  • Symptom and Requirement Clues
  • Metric Clues
  • Confusing Pairs Comparison Table
  • Typical Question Forms in Domain 3
  • Self-Check Questions
  • Glossary
  • Practice Questions