1. You have some data about how much (y) some houses sold for and their size (x). These are pairs (x,y). It could be the sizes and values of all the properties sold in London last year.
2. You want to predict the price of another house when you only know its size x. Maybe your friend has a house to sell in London and wants to know what he is likely to get for it. To do this you need an equation linking x and y. This equation is called the hypothesis hθ(x).
3. To find hθ(x) =θ0 + θ1 x you need to find θ0 and θ1. There are two methods to do this. Gradient descent and Normal Equation. They are dealt with in more detail in the most recent set of lectures, Lectures IV. Gradient descent is a type of trial and improvement method. Normal equation is a direct calculation.
4. Once you've found θ0 and θ1, you have hθ(x) and can use it to predict the value of y for your new value of x, that is you can tell your friend how much he's likely to get for his property in London.
(Just as an aside: Try to stick to lower case for the x and y because later on X is used for a matrix and it will get confusing.)
Additional comments
Dan Scott - The theta values are the parameters for the straight line equation that best estimate the values of y given x: from the straight line formula y = a * x + b our two theta values correspond to b and a respectively. When we start we don't have a good estimate (0, 0). The purpose of gradient descent / linear regression is to use the training data to derive the best line that fits the data.
Anuj Shah - If you were to plot the data on an x-y plane, you'll see that there are multiple possible lines that can be drawn through the data. None of them perfect (unless the data all fits on the same straight line). As a result what you're looking to achieve is what is mathematically the most appropriate line to draw such that it minimizes the cost function.
No comments:
Post a Comment