MLS-C01 Question 185
Select 3You are training a machine learning model to predict house prices using a dataset with several features, including square footage, number of bathrooms, location, and construction year. During initial training, you notice that the model is overfitting the training data. To address this, which of the following regularization techniques should you consider implementing?
- A
Apply L1 regularization to the model's loss function
- B
Use L2 regularization to penalize large model weights
- C
Increase the number of epochs during training
- D
Add dropout layers to the model architecture
- E
Reduce the size of the training dataset
Show answer and explanation
Correct answers: A, B, D
Explanation
Overfitting occurs when a model performs well on the training data but poorly on unseen data. Regularization techniques such as L1 (lasso) and L2 (ridge) regularization add penalties to the model's loss function to constrain the model's complexity and weights, preventing overfitting. Dropout is another effective technique for regularizing deep learning models by reducing reliance on specific neurons during training. Increasing training epochs or reducing the dataset size would not address overfitting and may even worsen the problem.
- A. Correct.
L1 regularization adds a penalty proportional to the absolute value of the coefficients to the loss function, which helps reduce overfitting by encouraging sparsity in the model parameters.
- B. Correct.
L2 regularization penalizes the square of the coefficients, making large weights smaller, which helps reduce overfitting and improves generalization.
- C. Incorrect.
Increasing the number of epochs can exacerbate overfitting, as the model has more opportunities to memorize the training data instead of generalizing well to unseen data.
- D. Correct.
Dropout layers randomly deactivate a proportion of neurons during training, which prevents the model from relying too heavily on specific features and reduces overfitting.
- E. Incorrect.
Reducing the size of the training dataset is generally not a recommended approach to address overfitting, as it can decrease the amount of information available to the model and lead to poorer performance.