3
$\begingroup$

The test set values increase over iterations signaling overfitting, but why is the training set deviance continuing to drop at the same time? This seems to indicate to me that the training set is continuing to get better over iterations but the test set only worsens, there is also a large gap in the starting points of the deviance between the test and training sets. Any clues as to where to look for causes would be helpful.

results of GBM regressor

$\endgroup$
2
  • 1
    $\begingroup$ I know that is not your question but you can choose a number of boosting iterations such that the test error will not decrease any longer. $\endgroup$ Commented Nov 19, 2021 at 1:13
  • 1
    $\begingroup$ Have either of the answers clarified your confusion? You might consider accepting an answer so that others who have this confusion in the future can see that there is an answer that was found to be helpful. $\endgroup$
    – Dave
    Commented Dec 27, 2021 at 9:47

2 Answers 2

34
$\begingroup$

This is exactly what it means to overfit!

In many scenarios, you can make the training performance arbitrarily great, perhaps going as far as playing connect-the-dots. This is analogous to your training set curve decreasing. However, as you fit too tightly, you stop modeling the trend (signal) and start modeling coincidences in the training data that will not be present in the test data (noise).

$\endgroup$
1
  • 4
    $\begingroup$ When I read the question, I was like ... "isn't that the definition?" Thanks for making that confusion short-lived. $\endgroup$
    – d8aninja
    Commented Nov 22, 2021 at 0:56
22
$\begingroup$

Instead of looking at the deviance plot for training and test data we could also take a look at some plots of actual fits.

Below is an example of fitting with a polynomial. From left to right the number of terms in the polynomial model is increased.

What you can see is that as we go to the right, and as the number of terms used to fit are increased, then...

  • The training data error will continuously improve (get smaller) and the fitted line will be a better fit with the training data.

  • But this is not the same for the validation/test data error. Initially the error improves in the same way as with the training data, but further on the error will increase and get worse.

    This is because the lower training data error is not necessarily a sign that the model captures the deterministic part of the model. Instead, at some point if the model becomes too flexible, then it becomes too sensitive to fitting the random part of the training data.

graphical example

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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