Sample questions
Question 1Easy
Overfitting means a model
- performs poorly on training data only
- fits noise in the training data and generalises poorly
- has too few parameters
- always has the lowest bias and variance
Answer: B. fits noise in the training data and generalises poorly
Explanation
An overfit model memorises quirks of the training set and fails on new data.
Step-by-step solution
- Overfitting means the model learns noise in training data.
- It performs well on training data but poorly on new data.
- This leads to poor generalisation ability.
- The model fits random fluctuations instead of patterns.
- So it generalises poorly on unseen data.
Why the other options are wrong
- A. Overfitting is poor generalisation to new data; the model often does well on training data.
- C. Too few parameters means underfitting; overfitting comes from too much flexibility.
- D. An overfit model has low bias but high variance, so it does not have the lowest variance.
Tip: Remember: overfitting means poor performance on new data due to learning noise.
Question 2Easy
Training accuracy 99% but validation accuracy 70% suggests
- Underfitting
- Data leakage from the validation set
- A perfect model
- Overfitting
Answer: D. Overfitting
Explanation
The model memorised the training data and generalises poorly.
Step-by-step solution
- Compare train vs validation.
- Large gap signals overfit.
- Add regularisation or data.
Why the other options are wrong
- A. Underfit models score poorly on training too.
- B. That would inflate the validation score.
- C. A 29-point gap is a warning.
Question 3Medium
In 5-fold cross-validation on 1000 examples, each training set contains
- 200 examples
- 800 examples
- 1000 examples
- 500 examples
Answer: B. 800 examples
Explanation
Each round holds out 1/5 (200) for validation and trains on the other 4/5 = 800.
Step-by-step solution
- Each fold has 1000 / 5 = 200 examples.
- Validation set is 1 fold = 200 examples.
- Training set is 4 folds = 4 * 200 = 800 examples.
- So each training set contains 800 examples.
- Final answer: 800 examples.
Why the other options are wrong
- A. 200 is the size of one validation fold, not the training set.
- C. 1000 is the whole dataset; each training set leaves one fold out for validation.
- D. 500 would be half the data, but 5-fold trains on four folds, which is 800.
Tip: Remember: Training size = (k-1)/k * total examples.
Question 4Medium
Weights are w = [2, -3] and lambda = 0.5. The L2 penalty lambda*sum(w^2) and L1 penalty lambda*sum(|w|) are
- 2.5 and 6.5
- 13 and 5
- 6.5 and 5
- 6.5 and 2.5
Answer: D. 6.5 and 2.5
Explanation
L2: 0.5*(4+9) = 6.5. L1: 0.5*(2+3) = 2.5.
Step-by-step solution
- L2: squares are 2^2 = 4 and (-3)^2 = 9; sum is 13; times lambda 0.5 gives 6.5.
- L1: absolute values are 2 and 3; sum is 5; times lambda 0.5 gives 2.5.
- So L2 is 6.5 and L1 is 2.5, option D.
Why the other options are wrong
- A. The values are in the wrong order: L2 is 6.5 (first) and L1 is 2.5 (second), but this option puts 2.5 first and 6.5 second, which swaps them.
- B. 13 is the sum of squares before lambda, and 5 is the sum of absolute values before lambda.
- C. 6.5 is correct for L2, but the L1 penalty is 2.5, because lambda 0.5 must be applied to the sum of 5.
Tip: Penalty: first sum the squares (L2) or absolute values (L1), then multiply by lambda.
Question 5Medium
Increasing the regularisation strength lambda too much will
- cause overfitting
- remove the need for a validation set
- cause underfitting (higher bias)
- reduce training error to zero
Answer: C. cause underfitting (higher bias)
Explanation
A huge lambda forces weights toward zero and the model becomes too simple.
Step-by-step solution
- Lambda controls how strongly the weights are pushed toward zero.
- Too large a lambda shrinks the weights too much, so the model cannot capture the real pattern.
- This is underfitting with high bias, option C.
Why the other options are wrong
- A. Overfitting comes from too little regularisation, not too much.
- B. A validation set is still needed to choose lambda.
- D. Heavy regularisation raises the training error; it does not push it to zero.
Tip: More regularisation means simpler model: less variance, more bias. Too much leads to underfitting.
Question 6Medium
Early stopping reduces overfitting by
- Increasing epochs until loss is zero
- Halting training when validation loss stops improving
- Removing the validation set
- Increasing the learning rate steadily with each new epoch
Answer: B. Halting training when validation loss stops improving
Explanation
Training loss keeps falling while validation loss eventually rises; stopping at its minimum retains the best generalisation.
Step-by-step solution
- Monitor validation loss.
- Stop when it stops improving.
- Restore the best weights.
Why the other options are wrong
- A. That would encourage memorisation.
- C. It needs the validation set.
- D. Unrelated to early stopping.
Question 7Medium
In Ridge or Lasso, increasing lambda (regularisation strength) generally
- Decreases bias and increases variance
- Increases both
- Leaves the model unchanged
- Increases bias and decreases variance
Answer: D. Increases bias and decreases variance
Explanation
A stronger penalty shrinks weights, producing a simpler, smoother model.
Step-by-step solution
- Larger lambda means stronger shrinkage.
- Model becomes simpler.
- Bias up, variance down.
Why the other options are wrong
- A. That is the effect of lowering lambda.
- B. Not both.
- C. Lambda changes the fit directly.
Question 8Medium
Compared with ridge, L1 (lasso) regularisation tends to
- never shrink any weight
- increase all weights
- only work on classification
- drive some weights exactly to zero, giving sparse models
Answer: D. drive some weights exactly to zero, giving sparse models
Explanation
The L1 penalty has a corner at zero, so many coefficients become exactly zero, performing feature selection.
Step-by-step solution
- L1 regularisation adds absolute values of weights to loss.
- This creates corners at zero in the optimisation path.
- Weights hit zero and stay there, making them zero.
- Zero weights remove features, creating sparse models.
- Final answer: drive some weights exactly to zero, giving sparse models.
Why the other options are wrong
- A. L1 can shrink weights exactly to zero; that is its main difference from ridge.
- B. Regularisation shrinks weights toward zero; it does not increase all weights.
- C. L1 regularisation also works for regression, as in lasso regression, not only classification.
Tip: L1 gives sparse models by zeroing weights; L2 spreads them out.
Question 9Medium
L2 (ridge) regularisation adds which term to the loss?
- lambda times the sum of squared weights
- lambda times the sum of absolute weights
- lambda times the number of features
- lambda times the largest weight only
Answer: A. lambda times the sum of squared weights
Explanation
Ridge penalises squared weights, shrinking them smoothly toward zero.
Step-by-step solution
- Ridge (L2) regularisation adds a penalty to the loss function.
- The penalty is lambda times the sum of each weight squared.
- So the added term is lambda times the sum of squared weights, option A.
Why the other options are wrong
- B. Summing absolute values of the weights is the L1 (lasso) penalty.
- C. The number of features is not used in the L2 penalty.
- D. L2 uses all the weights, not only the largest one.
Tip: L2 squares the weights, L1 takes their absolute values.
Question 10Medium
Why should a test set not be used to tune hyperparameters?
- It leaks information and gives an optimistic estimate of generalisation
- It makes training slower
- It lowers the number of features
- It changes the labels
Answer: A. It leaks information and gives an optimistic estimate of generalisation
Explanation
Tuning on the test set makes the final score biased. Use a separate validation set or cross-validation.
Step-by-step solution
- Test set is meant to evaluate model performance, not tune hyperparameters.
- Using it for tuning leaks information about the true distribution.
- This leads to an overly optimistic estimate of how well the model will generalise.
- Tuned hyperparameters may overfit to the test set instead of the training data.
- Final answer: It leaks information and gives an optimistic estimate of generalisation.
Why the other options are wrong
- B. Tuning on the test set does not slow training; the problem is a biased evaluation.
- C. Using a test set does not change the number of features; it only biases the estimate.
- D. Tuning does not change the test labels; the issue is information leakage, not label change.
Tip: Always use a separate validation set or cross-validation for hyperparameter tuning.
Practise all 10 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →