# C1\_W2\_Lab03\_Predicting targets with normalised values

**URL:** <https://community.deeplearning.ai/t/c1-w2-lab03-predicting-targets-with-normalised-values/553952>\
**Category:** Unsupervised Learning, Recommenders, Reinforcement\
**Tags:** week-module-2\
**Created:** [January 24, 2024, 6:29pm UTC](https://community.deeplearning.ai/t/c1-w2-lab03-predicting-targets-with-normalised-values/553952 "2024-01-24T18:29:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucia\_Uwalaka](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@Lucia\_Uwalaka](https://community.deeplearning.ai/u/Lucia_Uwalaka)\
**Post date:** [January 24, 2024, 6:29pm UTC](https://community.deeplearning.ai/t/c1-w2-lab03-predicting-targets-with-normalised-values/553952/1 "2024-01-24T18:29:42Z")

</div>

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:

 ![image](https://global.discourse-cdn.com/dlai/original/3X/3/8/38d7b54306a4e2c6008cd594dc29270f14addad6.png)

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.

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [January 24, 2024, 8:53pm UTC](https://community.deeplearning.ai/t/c1-w2-lab03-predicting-targets-with-normalised-values/553952/2 "2024-01-24T20:53:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lucia\_Uwalaka](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@Lucia\_Uwalaka](https://community.deeplearning.ai/u/Lucia_Uwalaka)\
**Post date:** [January 24, 2024, 10:23pm UTC](https://community.deeplearning.ai/t/c1-w2-lab03-predicting-targets-with-normalised-values/553952/3 "2024-01-24T22:23:03Z")

</div>

> [@Lucia\_Uwalaka](#):
>
> when generating the plot, the normalized features were used. Any predictions using the parameters learned from a normalized training set must also be normalized.

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?

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [January 24, 2024, 10:35pm UTC](https://community.deeplearning.ai/t/c1-w2-lab03-predicting-targets-with-normalised-values/553952/4 "2024-01-24T22:35:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lucia\_Uwalaka](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@Lucia\_Uwalaka](https://community.deeplearning.ai/u/Lucia_Uwalaka)\
**Post date:** [January 24, 2024, 10:46pm UTC](https://community.deeplearning.ai/t/c1-w2-lab03-predicting-targets-with-normalised-values/553952/5 "2024-01-24T22:46:47Z")

</div>

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