Machine Learning Specialty · 36% of the exam

Modeling: free practice questions

5 sample questions from our 90-question bank for this domain — answers and explanations included. These are the same scenario-based style as the real AWS exam.

1. A data scientist needs to train a binary classification model on a tabular dataset with 50 features and 500,000 rows. The team prioritizes a fast training time, a built-in ability to handle class imbalance, and automatic feature normalization. Which Amazon SageMaker built-in algorithm best satisfies all three requirements?

  • A. XGBoost
  • B. Linear Learner✓ Correct
  • C. K-Means
  • D. Random Cut Forest
Explanation

Linear Learner is correct because it natively supports binary classification, automatically normalizes input features during preprocessing, provides a 'positive_example_weight_mult' hyperparameter for class imbalance, and is highly optimized for fast training on large tabular datasets. XGBoost is a strong classifier but does not perform automatic feature normalization and requires manual handling of class imbalance (e.g., via 'scale_pos_weight'). K-Means is an unsupervised clustering algorithm and cannot perform supervised binary classification. Random Cut Forest is an unsupervised anomaly detection algorithm, not a binary classifier.

2. A data scientist is building a text summarization pipeline for a legal tech company. The documents are in English and average 10,000 words each. The team wants a fully managed solution with no model training required, and the summarizations must be available within 2 seconds for interactive use. Which AWS service and approach BEST meets these requirements?

  • A. Train a custom sequence-to-sequence model on SageMaker using the built-in Seq2Seq algorithm with a P3 instance, then deploy it to a real-time endpoint.
  • B. Use Amazon Bedrock to invoke a foundation model (such as Claude or Titan) via the InvokeModel API, passing the document text with a summarization prompt.✓ Correct
  • C. Use Amazon Comprehend's key phrases extraction API to extract important sentences and concatenate them into a summary.
  • D. Deploy a SageMaker JumpStart pre-trained BART model to a real-time endpoint and invoke it synchronously for each document.
Explanation

Amazon Bedrock provides fully managed access to large foundation models such as Anthropic Claude and Amazon Titan via a simple API call with no model training or infrastructure management. It supports long-context summarization and can return results within the latency budget for interactive use — making it the best fit. Option A requires training a custom model from scratch, which contradicts 'no model training required,' and the Seq2Seq built-in algorithm has limited context length for 10,000-word documents. Option C uses key phrase extraction, not true abstractive summarization, and the quality would be insufficient for legal documents. Option D (JumpStart BART) requires deploying and managing an endpoint; while it avoids training, it is not 'fully managed' in the same sense as Bedrock and BART models typically have shorter max token limits than what's needed for 10,000-word documents.

3. A team trains three candidate models for a multiclass classification task on SageMaker and records the following on a held-out test set: Model A has 88% accuracy and 0.85 macro-average F1. Model B has 91% accuracy and 0.72 macro-average F1. Model C has 89% accuracy and 0.87 macro-average F1. The dataset has severe class imbalance, with one dominant class comprising 80% of examples. Which model should the team select, and why?

  • A. Model A, because its balance between accuracy and F1 indicates the most stable generalization
  • B. Model B, because the highest accuracy on the test set is the definitive indicator of model quality
  • C. Model C, because it achieves the highest macro-average F1 score, indicating the best performance across all classes including minority classes, which matters most with class imbalance✓ Correct
  • D. Model A, because lower accuracy compared to Model B implies less overfitting to the majority class
Explanation

With severe class imbalance, accuracy is misleading because a model can achieve high accuracy simply by predicting the majority class. Macro-average F1 averages the F1 score across all classes equally, penalizing models that ignore minority classes. Model C achieves the highest macro-average F1 (0.87), indicating it performs best across all classes including the underrepresented ones. — Model A has a lower macro-F1 than Model C and is therefore inferior in terms of balanced class performance. — Model B has the highest accuracy (91%) but the lowest macro-F1 (0.72), strongly suggesting it is biased toward the majority class and poorly serves minority classes. — Lower accuracy alone does not imply less overfitting to the majority class; the F1 metric is the appropriate evidence, and Model C leads on that metric.

4. A data scientist is configuring a SageMaker Automatic Model Tuning job using Bayesian optimization for an XGBoost model. The tuning job is searching over 'max_depth' (integer, 3–10), 'eta' (continuous, 0.01–0.3), and 'subsample' (continuous, 0.5–1.0). After 30 tuning jobs, the team notices that performance improvement has plateaued. Which TWO strategies would most effectively improve the tuning outcome WITHOUT simply increasing the total number of jobs?

  • A. Narrow the search ranges for hyperparameters based on the top-performing configurations observed so far✓ Correct
  • B. Switch the tuning strategy from Bayesian optimization to random search
  • C. Add more hyperparameters to the search space to give the optimizer more dimensions to explore
  • D. Enable warm starting with 'IDENTICAL_DATA_AND_ALGORITHM' to seed the new tuning job with prior results✓ Correct
  • E. Increase the maximum number of parallel training jobs to run all remaining configurations simultaneously
Explanation

Narrowing search ranges around top-performing configurations focuses the Bayesian optimizer on the most promising region of the hyperparameter space, improving efficiency when the plateau suggests the global region has been identified but not fully exploited. Enabling warm starting with 'IDENTICAL_DATA_AND_ALGORITHM' transfers the surrogate model's learned knowledge from previous tuning jobs to a new job, allowing Bayesian optimization to continue refining rather than starting from scratch. Switching to random search discards all the probabilistic knowledge Bayesian optimization has accumulated; random search is less efficient than Bayesian optimization after many trials. Adding more hyperparameters increases the dimensionality of the search space, making it harder (not easier) to find optima. Increasing parallel jobs only affects throughput/speed; it does not improve the quality of exploration and may actually reduce Bayesian optimization's effectiveness since parallel jobs cannot incorporate each other's results sequentially.

5. A company is building a named entity recognition (NER) system for processing news articles. The team has a labeled dataset of 50,000 articles with entity annotations and wants to use a SageMaker built-in algorithm to train the model. They need word-level vector representations as a byproduct for downstream tasks. Which SageMaker built-in algorithm is most appropriate?

  • A. Sequence-to-Sequence (Seq2Seq)
  • B. Neural Topic Model (NTM)
  • C. BlazingText in Word2Vec mode✓ Correct
  • D. Latent Dirichlet Allocation (LDA)
Explanation

BlazingText in Word2Vec mode (unsupervised) generates high-quality word embeddings that can be used as features for downstream NLP tasks like NER. While BlazingText also has a supervised text classification mode, the Word2Vec mode produces word-level vector representations as explicitly requested. Sequence-to-Sequence is designed for sequence transformation tasks like machine translation and text summarization, not for producing word embeddings or performing NER. Neural Topic Model (NTM) is a topic modeling algorithm that discovers abstract topics in a document corpus; it does not produce word-level embeddings suitable for NER. Latent Dirichlet Allocation (LDA) is also a topic modeling algorithm focused on document-level topic distributions, not word-level representations for sequence labeling tasks.

85 more questions in this domain

Practice the full bank with instant grading, flashcards, and a timed mock exam.

Start practicing free