WalzoneInterview Prep
📞 Interviewing soon? Practice with a realistic AI mock phone interview — it calls you, then scores you. First 15 min FREE →

Data Science · Basic · question 10 of 100

Can you explain the concept of overfitting and underfitting in machine learning?

📕 Buy this interview preparation book: 100 Data Science questions & answers — PDF + EPUB for $5

In machine learning, one of the primary goals is to build models that can accurately predict unseen data that is not part of the training set. However, building accurate models is a challenging task because a model that is too simple may not be able to capture the complexity of the data, and a model that is too complex may fit noise in the data instead of the underlying patterns. Therefore, it is crucial to find an optimal balance between model complexity and accuracy.

Overfitting and underfitting are two common problems that arise when training machine learning models. Overfitting occurs when a model fits the training data too well, including the noise, resulting in poor performance on unseen data. On the other hand, underfitting occurs when the model is too simple and does not capture the underlying patterns of the data, again leading to poor performance on unseen data.

Overfitting can occur when the model is too complex relative to the size of the training data or when we train the model for too many iterations. Overfitting can be detected by observing high training accuracy, but low test accuracy.

There are several ways to address overfitting, including:

Underfitting can occur when we build a model that is not complex enough to capture the underlying patterns in the data. Underfitting can be detected by observing low training accuracy and low test accuracy.

There are several ways to address underfitting, including:

We can summarize the concept of overfitting and underfitting as optimizing a model to find a balance between bias and variance. A model with high bias has underfitting issue while a model with high variance has overfitting issue. We need to find a sweet spot between these two.

Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic Data Science interview — then scores it.
📞 Practice Data Science — free 15 min
📕 Buy this interview preparation book: 100 Data Science questions & answers — PDF + EPUB for $5

All 100 Data Science questions · All topics