<< Chapter < Page | Chapter >> Page > |
Student: Assume that we have a very huge [inaudible], for example. A very huge set of houses and want to predict the linear for each house and so should the end result for each input – I’m seeing this very constantly for –
Instructor (Andrew Ng) :Yes, you’re right. So because locally weighted regression is a non-parametric algorithm every time you make a prediction you need to fit theta to your entire training set again. So you’re actually right. If you have a very large training set then this is a somewhat expensive algorithm to use. Because every time you want to make a prediction you need to fit a straight line to a huge data set again. Turns out there are algorithms that – turns out there are ways to make this much more efficient for large data sets as well. So don’t want to talk about that. If you’re interested, look up the work of Andrew Moore on KD-trees. He, sort of, figured out ways to fit these models much more efficiently. That’s not something I want to go into today. Okay? Let me move one. Let’s take more questions later.
So, okay. So that’s locally weighted regression. Remember the outline I had, I guess, at the beginning of this lecture. What I want to do now is talk about a probabilistic interpretation of linear regression, all right? And in particular of the – it’ll be this probabilistic interpretation that let’s us move on to talk about logistic regression, which will be our first classification algorithm. So let’s put aside locally weighted regression for now. We’ll just talk about ordinary unweighted linear regression. Let’s ask the question of why least squares, right? Of all the things we could optimize how do we come up with this criteria for minimizing the square of the area between the predictions of the hypotheses and the values Y predicted. So why not minimize the absolute value of the areas or the areas to the power of four or something? What I’m going to do now is present one set of assumptions that will serve to “justify” why we’re minimizing the sum of square zero. Okay?
It turns out that there are many assumptions that are sufficient to justify why we do least squares and this is just one of them. So just because I present one set of assumptions under which least squares regression make sense, but this is not the only set of assumptions. So even if the assumptions I describe don’t hold, least squares actually still makes sense in many circumstances. But this sort of new help, you know, give one rationalization, like, one reason for doing least squares regression. And, in particular, what I’m going to do is endow the least squares model with probabilistic semantics. So let’s assume in our example of predicting housing prices, that the price of the house it’s sold four, and there’s going to be some linear function of the features, plus some term epsilon I. Okay? And epsilon I will be our error term. You can think of the error term as capturing unmodeled effects, like, that maybe there’s some other features of a house, like, maybe how many fireplaces it has or whether there’s a garden or whatever, that there are additional features that we jut fail to capture or you can think of epsilon as random noise. Epsilon is our error term that captures both these unmodeled effects. Just things we forgot to model. Maybe the function isn’t quite linear or something. As well as random noise, like maybe that day the seller was in a really bad mood and so he sold it, just refused to go for a reasonable price or something. And now I will assume that the errors have a probabilistic – have a probability distribution. I’ll assume that the errors epsilon I are distributed just till they denote epsilon I is distributive according to a probability distribution. That’s a Gaussian distribution with mean zero and variance sigma squared. Okay? So let me just scripts in here, n stands for normal, right? To denote a normal distribution, also known as the Gaussian distribution, with mean zero and covariance sigma squared.
Notification Switch
Would you like to follow the 'Machine learning' conversation and receive update notifications?