Member-only story

How to overcome overfitting in your ML model?

Rabin Poudyal
2 min readNov 12, 2020

fig. overfitting

Overfitting can occur due to different reasons. There are some ways to prevent this and improve your model. Some of them are:

  1. Perform early stopping
    Early stopping is one of the effective methods to try when you notice that the validation loss increases while training loss decreases. Remember that to perform early stopping you might need to divide your dataset into train, test, and cross-validation sets.
  2. Do Regularization
    Sometimes regularization is necessary because your model might be suffering from overfitting. In such a case adding the regularization term in your loss function prevents your model to learn complex functions from the data. This happens when your data contains some noise and your model also tries to fit the noise. The consequence is that it will fit the training data perfectly but will fail to generalize the unseen data.
  3. Add more dataset
    It might happen that your model is being overfitted because it has fewer data. For example, a model can easily memorize a set of small data. To prevent this, you will need to feed more data into your machine learning system.
  4. Perform feature selection
    Feature selection is one of the careful steps of designing a machine learning system. An ML model is just a mathematical relationship that maps input x into output y. So if we add useless…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Rabin Poudyal
Rabin Poudyal

Written by Rabin Poudyal

Software Engineer, Data Science Practitioner. Say "Hi!" via email: rabinpoudyal1995@gmail.com or visit my website https://rabinpoudyal.com.np

No responses yet

Write a response