Question 663 of 1,672
MLS-C01 Modeling Practice Question
A data scientist is building a text classification model using a bag-of-words approach with logistic regression. The dataset has 10,000 documents and 50,000 unique tokens. The model overfits. Which TWO techniques can help reduce overfitting?
⚠ Common exam trap
AWS often tests the misconception that adding more features or using a more complex model always improves performance, when in fact these actions increase overfitting risk in high-dimensional sparse datasets.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Reduce the vocabulary size by removing rare and very frequent terms
Removing rare and very frequent terms reduces the feature space and eliminates noise, which helps the logistic regression model generalize better. Rare terms often act as noise that the model can latch onto for spurious correlations, while very frequent terms (like stopwords) provide little discriminative power. This dimensionality reduction directly combats overfitting by simplifying the model.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the number of n-grams features
Why it's wrong here
Adding more features increases model complexity and likely overfitting.
- ✗
Use one-hot encoding instead of bag-of-words
Why it's wrong here
One-hot encoding does not reduce the number of features and can increase sparsity.
- ✗
Use a more complex model such as a neural network
Why it's wrong here
Using a neural network increases model capacity, which exacerbates overfitting on 10,000 documents with 50,000 sparse bag-of-words features, as it adds more parameters to memorise noise rather than generalise. This option is tempting because neural networks excel at capturing complex patterns in large datasets, and would be correct if the dataset were substantially larger, providing sufficient examples to regularise the additional parameters.
- ✓
Reduce the vocabulary size by removing rare and very frequent terms
Why this is correct
Reducing the number of features reduces model complexity and overfitting.
- ✓
Apply L2 regularization to the logistic regression model
Why this is correct
L2 regularization penalizes large weights, reducing overfitting.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 30, 2026
This MLS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MLS-C01 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.