Prediction with scaled values (multiply by 1000 instead of rescaling?)

In the optional lab: Feature scaling and Learning rate, the following values are normalised:

  1. X_norm
  2. w_norm
  3. b_norm
    Subsequently:
    X_house_predict = np.dot (X_norm, w_norm) + b_norm
    is carried out to get the predicted value

Finally printing is done with
print (f* “predicted price= {X_house_predict*1000}”)

I fail to understand where this 1000 comes from. Is it somehow derived from the Sigma and Mu values?

Hi @Cherian_Kk

Here in this photo you will see in the y axis that y(house price) is divide by 1000 to make the prediction and make the plot easy to read

so when we predict the price we multiply it back by 1000 to return to the actual price

Please feel free to ask any questions,
Thanks!
Abdelrahman

1 Like

I’m sorry if my query wasn’t clearly expressed. My doubt is in:

x_house_predict = np.dot(x_house_norm, w_norm) + b_norm

How is it that the predicted value can simply be multiplied by 1000 to get the un-normalised output value, when the input values are z-scale normalised values of X, W & B

Same is seen here in
yp[i] = np.dot(X_norm[i], w_norm) + b_norm

Hello Cherian,

If you notice, the target variable y, which is the price of the house was not normalized.

However, the y value was divided by 1000 right at the beginning and we used the output of this operation as the original value of the target variable y. And it is this value of y that was used in the training. Consequently, the predicted value \hat {y} will be off by a factor of 1000.

So, when the model predicts 150. The actual predicted value should be 150,000. It is for this reason that we do the simple multiplication with 1000.