How to determine if your model has Overfitting or Underfitting

Patrizia Castagno
5 min readSep 30, 2023
Underfitting Vs Overfitting (Source: Amazon)

In the exciting world of Machine Learning, building a model that performs exceptionally well on your training data can be a thrilling achievement. However, the true test of a machine learning model lies in its ability to make accurate predictions on new, unseen data. This is where the twin challenges of overfitting and underfitting come into play.

Imagine you’ve thoroughly trained your model, fine-tuning it for hours or even days, only to find that it performs poorly when faced with real-world data. Frustrating, isn’t it? Understanding whether your model is overfitting or underfitting is the first step towards resolving this dilemma.

Overfitting and underfitting are two common pitfalls in machine learning, both of which can hamper the model’s ability to generalize from the training data to new, unseen data. But fear not! In this blog, we’ll delve into the intricacies of overfitting and underfitting, providing you with the tools and knowledge to identify and address these issues effectively. Let’s get started!

What is Underfitting and Overfitting ?

Underfitting:

When a model is too simple and can’t capture important patterns in the data. It’s like oversimplifying a complex problem.It performs poorly on both training and new data.

>>How to know when my model has Underfitting ?

Here are some signs that indicate your model may be underfitting:

High Training Error: The model’s training error (loss) is relatively high and doesn’t decrease significantly with more training epochs. This suggests that the model struggles to fit even the training data well.

High Validation Error: The validation error (loss) is also high and shows little improvement as you continue training. The model’s poor performance extends to data it hasn’t seen during training.

Low Model Complexity: The model might be too simple, with too few layers, nodes, or features to adequately represent the data’s underlying patterns.

Failure to Capture Trends: The model fails to capture essential trends or relationships in the data. For example, in a regression task, it consistently…

--

--

Patrizia Castagno

Physics and Data Science.Eagerly share insights and learn collaboratively in this growth-focused space.LinkedIn:www.linkedin.com/in/patrizia-castagno-diserafino