Week 3: Choosing a model

Image 1:

Image 2:

I am a little confused with regards to the explanation in image 1 as to the reason J_test(w,b) is an optimistic estimate of the actual generalization error.

If you use the test set results to select the polynomial degree, it’s probably only going to be a good choice when used with that test set - but not when you use other data.