Exams / MLA-C01 / D1 ML Model Development
D1.1
ML Model Development (part 1 of 2)
- Exam domain: ML Model Development
You are reading a free preview. The rest of the MLA-C01 course unlocks with an Exam pass or All access.See plans
Choosing a built-in algorithm
| Need | Algorithm | Why |
|---|---|---|
| Binary/multiclass classification or regression, transparent coefficients | Linear Learner | "provides a solution for both classification and regression problems" |
| Tabular classification/regression, imbalance, feature interactions | LightGBM / XGBoost | Tree ensembles; LightGBM has is_unbalance / scale_pos_weight (binary only, mutually exclusive) |
| Ranking | XGBoost | "XGBoost for regression, classification (binary and multiclass), and ranking problems." |
| Anomaly detection, unlabeled | Random Cut Forest | "an unsupervised algorithm for detecting anomalous data" |
| Object + location in image | Object detection | Predicts "location and scale with a rectangular bounding box" |
| Per-pixel labels | Semantic segmentation | "Tag every pixel of an image individually with a category" |
| Text-to-text (summarization, translation) | Seq2seq | |
| Recommendations on high-dimensional sparse data | Factorization Machines | "capture interactions between features within high dimensional sparse datasets" |
RCF: num_trees is the main hyperparameter; increasing it reduces noise in the averaged score.
Overfitting and regularization
- Good on training data, poor on unseen data = overfitting (high variance). Fix: more regularization, shallower trees (lower
max_depth), fewer features, early stopping. - L1 → sparsity (zeroes out irrelevant/redundant terms, feature selection). L2 → shrinks weights but rarely to exactly zero.
- Performance that peaks then declines during training → early stopping.
- Adding layers/neurons increases capacity and worsens overfitting.
Metrics
| Problem | Metrics |
|---|---|
| Regression / numeric prediction | MAE, RMSE, MAPE (lower is better) |
| Classification | Accuracy (both classes correct), precision, recall, specificity, F1, AUC |
Training at scale, tuning and tracking
- Distributed data parallelism: scale by adding instances to cut wall-clock time; keep instances, subnet and data in the same Region and AZ to minimize communication cost.
- Hyperband: multi-fidelity tuning that stops poor jobs early; only for iterative algorithms (e.g. neural networks).
- SageMaker Experiments tracks inputs, parameters and results of many runs with little effort; Model Registry catalogs deployable model versions.
- SageMaker Profiler: annotate the script to find under-used GPU sections.
- Autopilot: AutoML for tabular data, quickest way to test whether a target is predictable.
Exam traps
- Model Registry is for versioning/approval, not run-by-run experiment tracking.
- CloudTrail logs API calls, not GPU utilization; Model Monitor watches deployed endpoints.
- Macie is data discovery, not modelling.
- Both
is_unbalanceandscale_pos_weightcannot be set together. - Per-group normalization when groups have different baselines (question 063).
Docs
- https://docs.aws.amazon.com/sagemaker/latest/dg/data-parallel-intro.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/distributed-training-scenarios.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/linear-learner.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/lightgbm-hyperparameters.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/xgboost.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-how-it-works.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-early-stopping.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/canvas-metrics.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/randomcutforest.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/fact-machines.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/train-use-sagemaker-profiler.html