Hi all,

I am learning Linear Regression with Andrew Ng and he mentioned how to scale up and speed up the gradient decent, so he gave example:

(price) =w1 * x1+ w2 x2 + b

where w1, w2 and b are input

x1 is the size of the house

x3 is the number of rooms

so when we implement it, we’ll have something like this:

price =50*2000+0.1*5+50 and the result is exceeding 100,000 million dollars!

but it should be around 100,000 dollars, so from where we got the other multiplied 1000 dollars?

Is it from a video of the Machine Learning Specialization? Can you share the name of the video with us?

yes it is,

Supervised Machine Learning: Regression and Classification >> Week 2 >> Feature scaling part 1 >> around minute 1:50

appreciated man!

Thanks @sajad27,

We had scaled down all the prices by 1000 at first, so that for a house at the price of $500,000, we say it is $500 (k). The (k) here means thousand. When we fit the model, we provide the price as 500, instead of $500k or $500000 (Note that both the dollar sign and the k are taken away, and only 500 is left).

Since the model is trained under the condition that the thousand unit is taken away, all predictions from that model lacks that thousand unit. Therefore, if we predict a house to worth 100,050.5, we need to put the dollar sign and the k back and convert it to $100,050,500.

Cheers,

Raymond

PS: I will move your thread to the Machine Learning Specialization Course 1 Week 2 category.

1 Like

Amazing man!

and yes, please move the thread to the proper category, sorry for inconvenience