- #1
Our first learning algorithm will be
linear regression. In this video, you'll see
- #2
what the model looks like and more
importantly you'll see what the overall
- #3
process of supervised learning looks like. Let's
use some motivating example of predicting
- #4
housing prices. We're going to use a data
set of housing prices from the city of
- #5
Portland, Oregon. And here I'm gonna
plot my data set of a number of houses
- #6
that were different sizes that were sold
for a range of different prices. Let's say
- #7
that given this data set, you have a
friend that's trying to sell a house and
- #8
let's see if friend's house is size of
1250 square feet and you want to tell them
- #9
how much they might be able to sell the
house for. Well one thing you could do is
- #10
fit a model. Maybe fit a straight line
to this data. Looks something like that and based
- #11
on that, maybe you could tell your friend
that let's say maybe he can sell the
- #12
house for around $220,000.
So this is an example of a
- #13
supervised learning algorithm. And it's
supervised learning because we're given
- #14
the, quotes, "right answer" for each of
our examples. Namely we're told what was
- #15
the actual house, what was the actual
price of each of the houses in our data
- #16
set were sold for and moreover, this is
an example of a regression problem where
- #17
the term regression refers to the fact
that we are predicting a real-valued output
- #18
namely the price. And just to remind you
the other most common type of supervised
- #19
learning problem is called the
classification problem where we predict
- #20
discrete-valued outputs such as if we are
looking at cancer tumors and trying to
- #21
decide if a tumor is malignant or benign.
So that's a zero-one valued discrete output. More
- #22
formally, in supervised learning, we have
a data set and this data set is called a
- #23
training set. So for housing prices
example, we have a training set of
- #24
different housing prices and our job is to
learn from this data how to predict prices
- #25
of the houses. Let's define some notation
that we're using throughout this course.
- #26
We're going to define quite a lot of
symbols. It's okay if you don't remember
- #27
all the symbols right now but as the
course progresses it will be useful
- #28
[inaudible] convenient notation. So I'm gonna use
lower case m throughout this course to
- #29
denote the number of training examples. So
in this data set, if I have, you know,
- #30
let's say 47 rows in this table. Then I
have 47 training examples and m equals 47.
- #31
Let me use lowercase x to denote the
input variables often also called the
- #32
features. That would be the x is here, it would the input features. And I'm gonna
- #33
use y to denote my output variables or the
target variable which I'm going to
- #34
predict and so that's the second
column here. [inaudible] notation, I'm
- #35
going to use (x, y) to denote a single
training example. So, a single row in this
- #36
table corresponds to a single training
example and to refer to a specific
- #37
training example, I'm going to use this
notation x(i) comma gives me y(i) And, we're
- #38
going to use this to refer to the ith
training example. So this superscript i
- #39
over here, this is not exponentiation
right? This (x(i), y(i)), the superscript i in
- #40
parentheses that's just an index into my
training set and refers to the ith row in
- #41
this table, okay? So this is not x to
the power of i, y to the power of i. Instead
- #42
(x(i), y(i)) just refers to the ith row of this
table. So for example, x(1) refers to the
- #43
input value for the first training example so
that's 2104. That's this x in the first
- #44
row. x(2) will be equal to
1416 right? That's the second x
- #45
and y(1) will be equal to 460.
The first, the y value for my first
- #46
training example, that's what that (1)
refers to. So as mentioned, occasionally I'll ask you a
- #47
question to let you check your
understanding and a few seconds in this
- #48
video a multiple-choice question
will pop up in the video. When it does,
- #49
please use your mouse to select what you
think is the right answer. What defined by
- #50
the training set is. So here's how this
supervised learning algorithm works.