0
0
ML Pythonprogramming~20 mins

Overfitting and underfitting in ML Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Overfitting and Underfitting Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Identifying Overfitting from Model Behavior

You train a model on a dataset. After training, you notice the training accuracy is 98%, but the test accuracy is only 65%. What does this most likely indicate?

AThe model is underfitting the data and needs more training.
BThe model is overfitting the training data and does not generalize well.
CThe model has perfect generalization and is well balanced.
DThe test data is too easy compared to training data.
Attempts:
2 left
Predict Output
intermediate
2:00remaining
Output of Training and Validation Loss Curves

Consider the following training and validation loss values over epochs for a model:

Epoch 1: train_loss=0.8, val_loss=0.9
Epoch 2: train_loss=0.5, val_loss=0.6
Epoch 3: train_loss=0.3, val_loss=0.7
Epoch 4: train_loss=0.1, val_loss=1.2
Epoch 5: train_loss=0.05, val_loss=1.5

What does this pattern most likely indicate about the model?

AThe model has a data leak causing validation loss to increase.
BThe model is underfitting because both losses are high.
CThe model is perfectly fitting the data with balanced losses.
DThe model is overfitting because training loss decreases but validation loss increases.
Attempts:
2 left
Model Choice
advanced
2:00remaining
Choosing a Model to Avoid Underfitting

You have a complex dataset with many features and nonlinear relationships. Which model choice is least likely to underfit this data?

AA deep neural network with multiple hidden layers.
BA logistic regression model without feature interactions.
CA simple linear regression model with few features.
DA decision tree with maximum depth of 2.
Attempts:
2 left
Hyperparameter
advanced
2:00remaining
Hyperparameter to Control Overfitting in Neural Networks

Which hyperparameter adjustment is most effective to reduce overfitting in a neural network?

AIncreasing the learning rate to speed up training.
BIncreasing the number of epochs to train longer.
CAdding dropout layers to randomly disable neurons during training.
DRemoving regularization to allow the model to fit training data better.
Attempts:
2 left
Metrics
expert
2:00remaining
Interpreting Metrics to Detect Underfitting

A model trained on a dataset shows the following metrics:

Training accuracy: 60%
Validation accuracy: 58%

Which conclusion is most accurate?

AThe model is underfitting because both training and validation accuracies are low and close.
BThe model is perfectly fitted with balanced accuracies.
CThe model is overfitting because training accuracy is much higher than validation accuracy.
DThe model has data leakage causing similar accuracies.
Attempts:
2 left