6

From the book Hands-On Machine Learning:

Note that the regularization term should only be added to the cost function during training. Once the model is trained, you want to use the unregularized performance measure to evaluate the model’s performance.

Why wouldn't you use the same model for both training and testing?

nnp
  • 63
  • 1
    You are using the same model for both training and testing; the quote is about the performance metric used to evaluate that model. When doing model evaluation, you shouldn't evaluate your model and add the regularization term's penalty to that evaluation. – jbowman Jan 05 '20 at 03:22

1 Answers1

5

I think there is a slight confusion.

What the author means is that during testing we focus on the MSE as this is what we evaluate performance on. The MSE plus the regularisation penalty is what we use to fit the model with. We are using the "same model"; just what we measure during training and testing is not the same. During training we evaluate the goodness-of-fit on known data and penalising model complexity at the same time, while during testing we evaluate goodness-of-fit on unknown data and assume that this performance generalises further.

Praful
  • 3
usεr11852
  • 44,125