C1_W2_Lab03_Predicting targets with normalised values

Please, can I get clarification on this statement in the optional lab:

" * when generating the plot, the normalized features were used. Any predictions using the parameters learned from a normalized training set must also be normalized."

This is the code that has this explanation:

It doesn’t look like yp was ‘de-normalised’ before it was plotted. So, how come yp calculated using normalised values is already what we expect from the model? I expected to see the values of yp also centred around 0 until de-normalised.

Generally we don’t normalize the output labels. In practice it usually doesn’t help very much. In that case, they don’t need to be de-normalized.

Unless there is something different about this specific lab? I haven’t read it recently, so don’t recall.

Thanks for your reply. If the output isn’t normalised, could you explain what this means:
when generating the plot, the normalized features were used. Any predictions using the parameters learned from a normalized training set must also be normalized.
Because yp is the dot product of the normalised values plus the normalised bias, I don’t understand why yp itself isn’t a normalised value. How did it generate a prediction that doesn’t need de-normalisation. I probably misunderstood something fundamental here. Could you take a few steps back in the process to explain how it works to me?

Normalization applies to the features. (i.e. the values in the X matrix used in training).

This means the weight values are based on using normalized features.

So when you want to make a prediction on new data, you have to apply the same normalization to those features, so they are compatible with the weights you got from training.

Ohh I get it now. I forgot that the cost is calculated based on the actual y data. Thanks for your help.