MLS-C01 Question 220
Select 3You are training a machine learning model using the Amazon SageMaker built-in XGBoost algorithm to predict customer churn. After initial training, you observe that the model performs very well on the training dataset but poorly on the validation dataset. Which actions should you take to address this issue?
- A
Increase the number of training epochs to allow the model to learn more complex patterns.
- B
Add L1 or L2 regularization to the model to penalize overly complex models.
- C
Decrease the max_depth parameter of the XGBoost model to limit the complexity of the trees.
- D
Increase the size of the training dataset to ensure the model has more diverse examples.
- E
Use early stopping to terminate training when the validation error stops improving.
Show answer and explanation
Correct answers: B, C, E
Explanation
The model is overfitting, as indicated by its strong performance on the training dataset but poor performance on the validation dataset. To reduce overfitting, you can add regularization (L1 or L2), decrease the complexity of the model (e.g., max_depth for XGBoost), and use early stopping to prevent the model from over-training. Simply increasing the number of epochs or dataset size does not address the core issue of overfitting in this scenario.
- A. Incorrect.
Increasing the number of training epochs would likely exacerbate the overfitting problem, as the model would continue to memorize the training data rather than generalizing better.
- B. Correct.
Adding L1 or L2 regularization helps prevent overfitting by penalizing overly complex models, encouraging the model to generalize better.
- C. Correct.
Decreasing the max_depth parameter in XGBoost limits the complexity of the trees, which helps prevent the model from overfitting to the training data.
- D. Incorrect.
While increasing the size of the training dataset can help in some cases, it does not directly address the current overfitting issue caused by the model's complexity.
- E. Correct.
Using early stopping helps prevent overfitting by terminating training as soon as the validation error stops improving, ensuring the model does not continue to overfit the training data.