To detect overfitting and underfitting, we look at training loss and validation loss or accuracy.
Underfitting happens when both training and validation errors are high. The model is too simple to learn the data well.
Overfitting happens when training error is very low but validation error is high. The model learns training data too well, including noise, and fails on new data.
So, the key metrics are training vs validation loss or accuracy. Their difference tells us if the model is overfitting or underfitting.
