1
$\begingroup$

I was running my gated recurrent unit (GRU) model. I wanted to get an opinion if my loss and validation loss graph is good or not, since I'm new to this and don't really know if that is considered underfitting or not

enter image description here

enter image description here

$\endgroup$
2
$\begingroup$

When ever you are buliding a ML Model don't take accuracy seriously(Mistake done by Netflix that cost them alot), you should try to get the hit scores as they will help you to know how many times your model worked on real world users.However, if your model must have to measure the accuracy try it with the RMSE score as it will penalise you more for being more out of the Line. Here is the link for more information on it RMSE Its hard to predict if its overfitting or underfitting as your graph is vague(for example what does graph lines representing). However, you can solve underfitting by following steps: 1) Increase the size or number of parameters in the ML model. 2) Increase the complexity or type of the model. 3) Increasing the training time until cost function in ML is minimised.

For overfitting you can try Regularization methods like weight decay provide an easy way to control overfitting for large neural network models. A modern recommendation for regularization is to use early stopping with dropout and a weight constraint.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thank you very much, this is some great info! I my model suffered from overfitting, I did a little bit of tweaking then it fitted well. I added L2 refularization, dropout, decreased number of layers and also reduced learning rate a little. $\endgroup$ – Ali Youssef Apr 12 at 19:47
1
$\begingroup$

You should at least crop the plots and add a legend. Maybe also provide some scores (accuracy, auc, whatever you're using). Anyway, it doesn't look your model is underfitting, if it was you should have high error at both, training and test phase and the lines would not cross.

| improve this answer | |
$\endgroup$
  • $\begingroup$ My final final MSE loss was 0.001371944 and validation MSE loss was 0.001448105. The Test scores were [0.030501108373429363, 0.00272163194425038]. Does crossing lines indicate that it is a good fit? $\endgroup$ – Ali Youssef Mar 13 at 2:13
  • $\begingroup$ It's hard to say from a single plot. The best thing to do is always to perform several training of the same model, save history loss and MSE and then average them. In this way you get rid of some causal outcomes (it's not unlikely for example to have lower validation loss than training one with Keras, due to some batch averaging they defined). Anyway, your MSE is pretty low, I would be more concerned of overfitting but also the test one is low, which is good. Are you using some already made dataset from TensorFlow? $\endgroup$ – Edoardo Guerriero Mar 15 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.