Courseiva
hardMultiple ChoiceObjective-mapped

Logistic Regression Regularization — Reduce Overfitting

A data scientist trained a logistic regression model on a dataset with 100 features. After training, the training accuracy is 0.99 but validation accuracy is 0.75. Which action is MOST likely to reduce overfitting?

Quick Answer

A training accuracy of 0.99 against a validation accuracy of 0.75 is the textbook signature of overfitting: the model has essentially memorized patterns specific to the training set, including noise, rather than learning the general relationships that hold on unseen data, and with 100 features relative to the dataset, it has plenty of room to do so. Increasing the regularization strength addresses this directly by adding a penalty on the size of the model's coefficients, which discourages the model from assigning large weights to features that only help it fit training-set quirks, effectively simplifying the decision boundary so it generalizes better. This is a more targeted fix than something like collecting more data or changing the model architecture, because the failure mode described, a huge accuracy gap between training and validation with no other symptoms mentioned, points specifically at model complexity rather than data quantity or algorithm choice, and regularization is the standard lever built into logistic regression for controlling that complexity. Whenever a question shows a large gap between training and validation performance with everything else about the setup held constant, that gap is the signal to look for an answer that constrains the model rather than one that adds capacity or more training time.

⚠ Common exam trap

AWS often tests the misconception that adding more data or using more complex models always improves performance, but here the correct answer is to increase regularization strength, which directly counters overfitting in a logistic regression model.

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

Increase the regularization strength

The model shows high training accuracy (0.99) but significantly lower validation accuracy (0.75), which is a classic sign of overfitting. Increasing the regularization strength (e.g., L1 or L2 penalty) in logistic regression directly penalizes large coefficients, reducing the model's complexity and improving generalization. This is the most direct way to address overfitting in a logistic regression 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 features

    Why it's wrong here

    Adding more features increases model complexity and can worsen overfitting.

  • Increase the regularization strength

    Why this is correct

    Stronger regularization (e.g., higher L2 penalty) shrinks coefficients and reduces overfitting.

  • Use a more complex model like XGBoost

    Why it's wrong here

    Switching to XGBoost would increase model capacity through deeper trees and more parameters, which exacerbates the high-variance problem already indicated by the 0.99 training versus 0.75 validation gap. This action is tempting because XGBoost often improves predictive performance on complex, non-linear datasets where logistic regression underfits. It would be correct if the issue were underfitting—low training accuracy—rather than overfitting.

  • Use stratified cross-validation

    Why it's wrong here

    Stratified CV helps evaluate generalization but does not directly reduce overfitting.

About these practice questions

Courseiva writes every MLA-C01 question from scratch — 835 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on MLA-C01

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A data scientist is training a logistic regression model and wants to use L1 regularization to create a sparse model. Which parameter should be adjusted?

medium
  • A.alpha
  • B.lambda
  • C.penalty
  • D.C (inverse of regularization strength)

Why C: (penalty) is correct because in logistic regression implementations like scikit-learn's `LogisticRegression`, the `penalty` parameter is set to `'l1'` to apply L1 regularization. This encourages sparsity by driving some feature coefficients to exactly zero, which is the core mechanism for creating a sparse model.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This MLA-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 MLA-C01 exam.